python-hdwallet icon indicating copy to clipboard operation
python-hdwallet copied to clipboard

Fix buggy testing process of `test_from_xpublic_key`

Open chenluyong opened this issue 2 years ago • 2 comments

Fix buggy testing process Public Key should not support hard derivations.

see bip-0032 Implications

chenluyong avatar May 09 '22 15:05 chenluyong

The derivation process has been verified by iancoleman

can be testing.

BIP39 Mnemonic avocado harsh input rack like desert mask nominee left atom original tower shy barely base

Account Extended Public Key xpub6CnRmcvtuVkmYV7UrPbrrhpJaor6iy5cFLQHdsgYQsfz9338T6Wqy3vHP1MXCEPMKzq1C8fErhrGnzEYarzsF814HnCzNF6vqo9JiGjjvE2

Address 16W7JeQXEzmYKX8UMFMrg6FwNSPduVdYHo

chenluyong avatar May 09 '22 15:05 chenluyong

Although they have the same path, the derived public key and private key are asymmetric, for example:

xprivate_key:m/44'/0'/0'/0/0
xpublic_key:m/44'/0'/0'/0/0

Due to the hardening derivation, the expected symmetric results cannot be obtained, even though they were initially symmetric.


Their paths are equal, and the public and private keys are also symmetric, for example:

xprivate_key:m/0/0
xpublic_key:m/0/0

chenluyong avatar May 09 '22 15:05 chenluyong