Skip to content

Add HD wallet schema metadata - #122

Closed
mtg0001 wants to merge 2 commits into
Bitflash-sh:mainfrom
mtg0001:bip44-wallet-metadata
Closed

Add HD wallet schema metadata#122
mtg0001 wants to merge 2 commits into
Bitflash-sh:mainfrom
mtg0001:bip44-wallet-metadata

Conversation

@mtg0001

@mtg0001 mtg0001 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add HD wallet schema metadata to wallet.dat: hdschema, hdreceivenext, and hdchangenext.
  • Infer older seeded wallets with no schema record as legacy-hd (m/index') instead of rewriting them silently.
  • Keep new/restored phrases on the current legacy schema for now, while writing the metadata needed for a later BIP44 switch.
  • Surface the schema and receive/change counters through the recovery audit and Wallet Safety dialog.
  • Add wallet self-test coverage for schema initialization, invalid-phrase preservation, and audit reporting.

Why

This is the second BIP44 preparation step after #121. The wallet cannot safely move from the existing m/index' derivation to BIP44 until wallet.dat can say which derivation layout a seed uses. Without that marker, a future restore could scan the wrong path family and make old coins look missing.

This PR deliberately does not change address generation yet. It only records and reports the derivation schema boundary so the next PR can add dual-path restore without ambiguity.

Stack

Stacked after #121 (Add BIP32 path derivation foundation). Review this after #121, or compare this branch against bip44-foundation to see only the metadata changes.

Testing

  • git diff --check
  • 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