I want to know if an address is spendable by an HD seed and for that purpose I am using the following command:
> bitcoin-cli getaddressinfo 3LFc64RRd96ejjYvm14KaogBF9fmeNmePW | jq '.solvable'
false
However as mentioned here and here it's impossible to know with 100% certainty that an HD seed can't spend from a certain address as one would need to generate infinite addresses. To counterbalance that I discovered a command that increases the 'search space':
> bitcoin-cli keypoolrefill 1000
However, I am not sure getaddressinfo
is sentitive to this keypoolinfo
parameter or is just checking the addresses so far generated (the ones that can be obtained via bitcoin-cli listreceivedbyaddress 0 true
). I could test this with a second node but my other node might be using another seed to generate new addresses. Even though I used sethdseed
, I see a different xpriv
when dumping the wallet.