Skip to content

Add BIP32 path derivation foundation - #121

Closed
mtg0001 wants to merge 1 commit into
Bitflash-sh:mainfrom
mtg0001:bip44-foundation
Closed

Add BIP32 path derivation foundation#121
mtg0001 wants to merge 1 commit into
Bitflash-sh:mainfrom
mtg0001:bip44-foundation

Conversation

@mtg0001

@mtg0001 mtg0001 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add general BIP32 private child derivation for both hardened and non-hardened child numbers.
  • Add BIP32DerivePath() so wallet code can derive multi-level paths instead of only the current single hardened child.
  • Keep the existing BIP32DeriveHardenedChild(parent, index) wrapper intact for the current wallet path.
  • Extend test_bip32 with official BIP32 test vector 1 paths, including mixed hardened/non-hardened derivation.

Why

BIP44 cannot be wired safely until the BIP32 layer can derive paths such as m/44'/coin_type'/0'/0/i and m/44'/coin_type'/0'/1/i. The current wallet only needs m/index', so this PR deliberately does not change wallet behavior, stored metadata, restore scanning, or address generation yet.

This is the foundation PR: it makes the cryptographic path machinery testable before the wallet starts using a BIP44 layout.

Testing

  • git diff --check
  • make -f makefile.mingw test_bip32.exe && ./test_bip32.exe from MSYS2 UCRT64 in src/
  • make -f makefile.mingw tests from MSYS2 UCRT64 in src/

@Bitflash-sh

Copy link
Copy Markdown
Owner

Landed in #124, which contains this branch — the four were stacked, so squashing the top brought all of them into main as 876d7a7. Closing this one as merged rather than leaving it open against changes that are already in.

The real-coin verification is written up on #124.

@Bitflash-sh Bitflash-sh closed this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants