(CRITICAL) Incorrect derivation for certain BIP39 keys, fund loss >:(
See original GitHub issueTest case (by luck this is the first one I generated, thankfully I cross-referenced with other tools. Not all mnemonics / root keys trigger this bug)
mnemonic: fruit wave dwarf banana earth journey tattoo true farm silk olive fence
passphrase: banana
https://iancoleman.github.io/bip39/ derived first address: 17rxURoF96VhmkcEGCj5LNQkmN9HVhWb7F
(also shared by Electrum)
Other clients derive a different address (Copay, BIP32JP, etc): 13EuKhffWkBE2KUwcbkbELZb1MpzbimJ3Y
Issue Analytics
- State:
- Created 7 years ago
- Comments:27 (10 by maintainers)
Top Results From Across the Web
If you use ALGO with your Ledger, be aware that the BIP39 ...
In order to enable recovery from a BIP39 seed, we would need tools to generated the ALGO private keys from the BIP39 seed...
Read more >Seed phrases are forever: paper, metal, and other backups
Seed phrases are key to bitcoin custody, so your back up method—paper, metal, or otherwise—is also essential to ensure your bitcoin remain ...
Read more >Mnemonic Seed - A simple explanation of BIP39.
A mnemonic sentence (“mnemonic code”, “seed phrase”, “seed words”) is a way of representing a large randomly-generated number as a sequence of words,...
Read more >Bad Proofs in Formal Verification - Devcon Archive
Formal verification can be a huge boon to smart contract security as it checks all possible execution paths. Unfortunately, even verified code can...
Read more >Recovery Seed, PIN and Passphrase - Trezor Blog
Your recovery seed is the most critical part of your crypto wallet. ... he may see you clicking some blank buttons, but he...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve extensively compared results across several libraries, and
bcoin
(https://github.com/bcoin-org/bcoin),bitcoinjs-lib
(https://github.com/bitcoinjs/bitcoinjs-lib),libbtc
(https://github.com/libbtc/libbtc),hdkeys
(https://github.com/cryptocoinjs/hdkey), and many others, are all using correct BIP32 derivation.The derivation in Copay (and anything using bitcore-lib) is incorrect. The bug is when there is a leading zero of the private key and the hash during derivation does not include the zero. The BIP32 specification states that the size of the private key is always 32 bytes before it’s hashed.
FWIW: Funds will still be recoverable, however it may be cumbersome to derive both sets of private keys for recovery for those derivations affected.
NBitcoin: 17rxURoF96VhmkcEGCj5LNQkmN9HVhWb7F @dangershony I used @Thashiznets implementation, but kind of changed lots of stuff, so you might need to check also.
Output