I'm still new to Bitcoin Core, but yesterday we came across what I thought was an interesting discussion on our local forum about wallet descriptors in Bitcoin Core. By default as far as I know we can't retrieve the private key, as @achow101 said
Descriptor wallets do not allow dumpprivkey because the fundamental principle behind descriptor wallets is that private keys are not enough information to transport a wallet. Private keys lack derivation information and lack information about what kind of scripts to create. They also do not work for wallets that have anything more complicated than just single key scripts. Thus allowing a RPC that only outputs private keys would be working against the point of having descriptors.
Instead of dumpprivkey, descriptor wallets have listdescriptors. This will output all of the descriptors stored in the wallet, which means that it will include information about derivation paths and scripts to create. Descriptors are a full backup of the key and script information stored in the wallet. With 23.0, listdescriptors will also be able to optionally output descriptors containing private keys.
However one of the members on our local forum was able to provide a way to find the private key in the wallet descriptor, via third party support of course. I haven't tried it but one of the other members on the local forum has tried it and had success
Here's How:
- Open "console" and enter passphrase
walletpassphrase "your password" 600, If your wallet has encrypt passphrase
- Next use the argument
getaddressinfo "your address" ~ Note the type of script address in the parent descriptor section ("parent_desc") pkh, wpkh, sh or tr
~ Note the hdkeypath
- Next use the argument
listdescriptors true- From the results, look for a descriptor ("desc") that has the same script address type (pkh, wpkh, sh or tr) as the "parent_desc" that you previously noted And make sure it has the same hdkeypath too
- Note the extended private key (xprv key)
- Download BIP39 Tool (Mnemonic Code Converter)
https://github.com/iancoleman/bip39/releases , and run it offline (turn off the internet network)
- Enter the xprv key in the BIP32 Root Key column in the BIP39 Tool
- Done, you will find the private key from the address on the descriptor wallet
A link to the discussion on our local board, can be found
HERE. Is the method above safe to do?