Post
Topic
Board Bitcoin Technical Support
Re: Bitcoin Core: New HD Wallets vs. Legacy
by
achow101
on 10/10/2023, 01:18:50 UTC
Thank you. That is already close. I have experimented with it and also used "bitcoin-cli getaddressinfo". To calculate the missing private keys in the hdkeypath I therefore followed these instructions

https://bitcointalk.org/index.php?topic=5351210.msg60007045#msg60007045

The tool calculates the public key for my test address in the keypath correctly but shows another bitcoin address.  Huh

I will research further there. But if you have any idea what could be the reason, please let me know.
The reason is that keys are not the same as addresses, and it is not a one-to-one mapping of pubkey to address. There are multiple addresses for a single pubkey as there are multiple address types. The purpose of descriptors is to make it clear which address type to create. However you've completely bypassed that by taking the key out of the descriptor and trying to compute the address manually. The reason you don't get the same address is most likely because you have chosen the wrong address type.