1

I'm trying to create a watch-only wallet importing the extended public key from a Ledger Nano (as an example) but is not to easy to do directly to my Node, I should do it through electrum personal server or something like that. I was trying to find a clear (like 5 years old) explanation of what is the reason for that. I was trying to do that in the mainnet and from the regtest following the next command in order to get the checksum but all the time a message said that the key is not valid.

bitcoin-cli --regtest getdescriptorinfo "wpkh(vpub5UwuWtLWaprMvQBpnZeufhRAqYsgrYf7ZMxr6Kf7N41aa9M7UzZJ1e7HMwzdxGnfer5g2PaFgcvmNU7iRZAasNXz6EdDW6FGdcKf8m4oF7b/*)"

And there are plans to allow this import function?, I think so it's a very convenience feature.

5
  • I forgot to comment that the vpub is only an example in order to don't put a real xpub from a ledger nano. – decentralized.b Jun 11 '20 at 22:34
  • It seems like you are asking two questions here. Can you clarify, exactly, what it is that you want to know? – Andrew Chow Jun 11 '20 at 23:05
  • Thank you @AndrewChow, the main question is why Bitcoin Core does not support importing extended public keys directly?. I was reading that is not possible but it is not clear for me the main reason why it is not possible. And on another hand, it is possible, I would like to know if there are plans to made this possible in the near future, but the main question is the first one. – decentralized.b Jun 12 '20 at 8:34
  • Why are you asking about getdescriptorinfo? How is that related? – Andrew Chow Jun 12 '20 at 14:38
  • This was because I was thinking (erroneously) that I could apply the process to import an xpub described in this answer (bitcoin.stackexchange.com/questions/88520/…) But this not works for extended public keys. – decentralized.b Jun 12 '20 at 18:01
1

The structure of the Bitcoin Core wallet makes it difficult to implement importing extended public keys. This structure makes several assumptions about keys available in the keypool which xpubs do not meet. One such assumption is availability of private keys. While it isn't impossible to implement support for it, doing so is difficult to do, difficult to review, and is largely a hack on top of a hack.

Recently, native descriptor wallets was merged into Bitcoin Core so you will be able to import xpubs that are in a descriptor in 0.21. Native descriptor wallets took a long time to implement because of structural changes that had to be made to the wallet to even be able to support this.

3
  • Thank you Andrew for answering so quickly. The last part from your answer is not to clear for me, my bad. Does it mean that in the future version 0.21 from Bitcoin Core maybe it could be possible to import xpubs? Thanks!. – decentralized.b Jun 12 '20 at 17:31
  • Yes. In 0.21 and later, you can create a descriptor wallet which allows you to import descriptors. Such descriptors can contain xpubs. – Andrew Chow Jun 12 '20 at 17:42
  • Thank you, is clear for me know. – decentralized.b Jun 12 '20 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.