1

I created a new wallet in Bitcoin Core v23.x,
as expected it created an empty wallet
version 169900
descriptors true
format sqlite.

It seems it created 4 streams of 1000 keys each.

Anyway I told it create some P2PKH, P2SH-nested P2WPKH, P2WPKH, P2TR addresses.

It created a bech32m address, but it won't let me access private keys.

Whatever the address type, it's telling:

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

Why is this happening and where to go from here?

1 Answer 1

3

As the error message says, the type of wallet you are using does not support the dumpprivkey command. You are using a descriptor wallet, and individual private keys cannot be exported from the wallet.

You can get the master private keys by using listdescriptors true. This will output all of the descriptors stored in the wallet along with their corresponding private keys. Because Bitcoin Core uses BIP 32 derivation, instead of thousands of individual private keys, you will get descriptors which contain the master private key from which you can do derivation on to get the individual child keys.

Descriptor wallets specifically disabled export of child private keys because it is unsafe. Because unhardened derivation is used by default, a child private key and a parent extended public key is equivalent to having the parent extended private key. However it is not immediately obvious to the vast majority of users that this is unsafe, so child private key export is disabled.

2
  • When did Core switch to non-hardened as the default? Is there a reason non-hardened keys is the default? bitcoin.stackexchange.com/a/50247/26873
    – m1xolyd1an
    May 22 at 22:05
  • @m1xolyd1an Since descriptor wallets were added, and only for descriptor wallets. As descriptor wallets make it easier to import and export wallets via descriptors, we decided to move to use the standard derivation paths that allow for such exports.
    – Andrew Chow
    May 23 at 4:08

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.