Post
Topic
Board Project Development
Re: python-hd-wallet-scanner - scan for HD Wallet master private key and addresses
by
pooya87
on 04/05/2021, 04:07:00 UTC
Hi Pooya87,

Just so I can steal some knowledge from you. Does this mean that even if I find a HD key (xprv) it might not be the master xprv of a wallet but the xprv of an address that could be way down the hierarchy of addresses in a particular wallet? My initial concept was to try and find Wallets rather than just addresses.
Yes. It's the same collision principle as with keys <> addresses.
Bitcoin private keys are 256 bits while the addresses (most of them) are 160 bits that means there is more than one private key corresponding to each address. The reason why we will never actually find such a collision is because 2160 is huge.
Similarly BIP32 key derivation uses a 256-bit key + a 256-bit chain code in HMACSHA512 so there is even more master keys that correspond to a single child address. In simple terms we could say that theoretically there exists xprv1 and xprv2 that generate completely different addresses except one.