Activate BIP44 wallet derivation - #124
Conversation
|
Additional live-chain smoke test on the PR branch, using a disposable datadir and no real wallet files:
Remaining before any SLIP-0044 request: a mined change-output restore where the spend is confirmed in a later block, ideally sending to a second disposable wallet so the restored source wallet's remaining balance proves the change branch unambiguously. |
|
Manual restore test update after the external-spend/change check:
After the fix, the same wallet restored from phrase only reports: Automated tests rerun after the fix: |
|
One more restore edge case was tested before audit. The previous manual proof used Added
Retested without Automated tests still pass: |
|
Merging this stack. It is the first time wallet derivation has come through this cleanly here, and the compatibility design is the reason: the schema is recorded per wallet, wallets that predate the field are inferred as legacy, nobody is migrated behind their back, and restore walks the legacy branch alongside the BIP44 ones. That is the right shape. I did not take the self-tests as proof. This area has burned us before — #115 passed every test on the bench and still could not find real money — so it was tested against real coin on a real chain. Compatibility, on a real walletThe wallet from the #115 proof: a phrase installed, 701 derived indices, coins at 201 and 302.
An upgraded wallet keeps every address it had. That was the thing that had to be true. The case that matters most: an existing user restoring after the upgradeReal chain, no The legacy compatibility branch does its job with real money on the other end. And the new branch, with coin that actually movedThe one thing derivation tests cannot show is whether the scan finds a coin that was really paid to a BIP44 address. So one was:
Coin fully accounted for on both sides afterwards: 4.00 in the sender as change, 1.00 in the restored wallet. Also built the merge against current Two things that are now owed, and neither is a code defect1. The coin type is provisional. 4346950 has no SLIP-0044 assignment; the comment says "proposed registry row". Once this ships, every phrase created under it depends on that number permanently. If a different one is ever assigned, the provisional path cannot be replaced — it can only be kept as a fourth compatibility branch, the same way the legacy path is kept now. That is a maintenance obligation we are taking on knowingly, and I am opening an issue for it rather than letting it live only in a comment. 2. A phrase created here restores to nothing on 1.2.15 and earlier. The words carry no schema, so an older build derives the legacy path and finds an empty wallet. Anyone running more than one machine can hit this by restoring on the one they have not upgraded — and "my coins are gone" is exactly the wrong thing for a recovery phrase to say. This needs to be loud in the release notes, and the release should wait until the machines that matter are already on it. One observation, not a blocker: restore now derives three branches per batch, so an ordinary case wrote 1501–1801 keys to find one or two transactions. It works, it is just heavier, and each future compatibility branch multiplies it again. |
Summary
m/44'/4346950'/0'/0/indexfor receiving addresses.m/44'/4346950'/0'/1/index.legacy-hdwallets on their recordedm/index'schema.Why
This is the first PR in the stack that turns the BIP44 preparation into actual wallet behavior. It keeps the old schema alive for existing wallets, while new recovery phrases start using the standard BIP44 receive/change split.
The compatibility branch matters because wallets created before this change used
m/index'. A new build must not make those old phrases look empty during restore.Stack
Stacked after #121, #122, and #123.
Testing
git diff --checkmingw32-make -f makefile.mingw testsfrom MSYS2 UCRT64 insrc//newphrasesucceeds/recoveryauditreportsderivation schema: bip44,BIP44 coin type: 4346950 (provisional BITFLASH), and receive/change counters101/0/showderived=3derives the first three receiving addressesNot Yet
This is still not a request for the official SLIP-0044 registry. Before asking SatoshiLabs for
4346950 | BITFLASH | Bitflash, this should be audited and then tested with real local-chain coins: receive outputs, change outputs, gap behavior, and phrase-only restore on a synced/non-empty chain.