<p>As the error message says, the type of wallet you are using does not support the <code>dumpprivkey</code> command. You are using a descriptor wallet, and individual private keys cannot be exported from the wallet.</p>
<p>You can get the master private keys by using <code>listdescriptors true</code>. 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.</p>
<p>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.</p>

CC BY-SA 4.0
2023-03-29T13:03:03.893Z
Since "Descriptor wallets specifically disabled export of child private keys because it is unsafe.", how do I sign a 2-of-3 PSBT transaction whose one of its public keys is of an address derived in such a descriptor wallet - without exporting its child private key?  Looks like I will need to import the multisig adddress' descriptor into the wallet first, and it will need to have a masteror child private key, so I'll end up export it anyway. Or am I thinking about it in a wrong way?
Meglio
CC BY-SA 4.0
2022-05-22T22:05:54.707Z
When did Core switch to non-hardened as the default? Is there a reason non-hardened keys is the default? https://bitcoin.stackexchange.com/a/50247/26873
m1xolyd1an
CC BY-SA 4.0
2022-05-23T04:08:42.093Z
@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.
Ava Chow
CC BY-SA 4.0
2022-05-22T15:46:34.367Z
2022-05-22T15:46:34.367Z
Ava Chow
<p>I created a new wallet in Bitcoin Core v23.x,<br />
as expected it created an empty wallet<br />
version 169900<br />
descriptors true<br />
format sqlite.</p>
<p>It seems it created 4 streams of 1000 keys each.</p>
<p>Anyway I told it create some P2PKH, P2SH-nested P2WPKH, P2WPKH, P2TR addresses.</p>
<p>It created a bech32m address, but it won't let me access private keys.</p>
<p>Whatever the address type, it's telling:</p>
<blockquote>
<p>error code: -4<br />
error message:<br />
This type of wallet does not support this command</p>
</blockquote>
<p>Why is this happening and where to go from here?</p>

<bitcoin-core><wallet><private-key-export><output-script-descriptors>
Why can I not dump private keys from a descriptor wallet?
Mercedes
# Why can I not dump private keys from a descriptor wallet?

(Asked by: username_0 on 2022-05-22)

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?

**Tags:** bitcoin-core, wallet, private-key-export, output-script-descriptors


---

## 1 answers

### Answer by username_1 on 2022-05-22. Score: 6 | Accepted answer

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.

> **Comments:**
> **username_3**: When did Core switch to non-hardened as the default? Is there a reason non-hardened keys is the default? https://bitcoin.stackexchange.com/a/50247/26873  
> **username_1**: @username_3 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.  
> **username_2**: Since "Descriptor wallets specifically disabled export of child private keys because it is unsafe.", how do I sign a 2-of-3 PSBT transaction whose one of its public keys is of an address derived in such a descriptor wallet - without exporting its child private key?  Looks like I will need to import the multisig adddress' descriptor into the wallet first, and it will need to have a masteror child private key, so I'll end up export it anyway. Or am I thinking about it in a wrong way?  

---

