3

When I run dumpprivkey from Bitcoin Core 0.21.1. I get the following error message:

error code: -4
error message:
This type of wallet does not support this command

I came across achow's explanation stating that

"Descriptor Wallets store Output Script Descriptors in the wallet and use these to generate the addresses that users can use. Legacy Wallets (the non-descriptor wallet type, and the only type of wallet previous versions would create) instead used private keys to generate addresses."

If dumprivkey does not work, how can I get a private key from a descriptor wallet?

2

It is currently not possible to export private keys from a descriptor wallet.

There is currently an open pull request which allows the listdescriptors command to optionally return descriptors with private keys. This will be the method by which private keys can be exported from a descriptor wallet.

Note that only the master private key used in a descriptor will be allowed to be exported from descriptor wallets. This is because descriptor wallets will be using unhardened derivation for the child keys and there is a known issue where having the parent xpub and a child key derived with unhardened derivation will allow the parent xprv to be computed. So to be clear to users that what they are doing is potentially unsafe, we will only allow exporting the master private key (it is more obviously unsafe when you have the master private key as users are unlikely to know about this weakness and may think that giving out child keys and the parent xpub is safe).

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.