Author

Topic: I can't get my private key (Read 444 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
April 29, 2022, 11:31:38 PM
#11
Bumping this quite old thread to include a solution involving today's latest Bitcoin Core version (v23.0).

It's now possible to export the parent descriptor with xprv key by using the command: listdescriptors true.
You can get your address' prvKey with the help of Iancoleman's BIP39 tool (or any alternative).

Steps:
  • First use the command: getaddressinfo
    and take note of the result.
  • Export the parent descriptor (private) with the command: listdescriptors true.
  • Select the correct parent descriptor based from the address' script type (pkh, wpkh, sh),
    also check if it's a descriptor for receiving or change addresses ("internal": false = receiving | true = change); then take note of its xprv key.
  • Launch BIP39 tool (offline) and paste the xprv key as "BIP32 Root Key".
  • Select the correct derivation path as described in the descriptor, the derived addresses and private keys will be listed below the page.

If the address is not in the list:
In getaddressinfo's result, look for "hdkeypath":" to see the index (last digit), since the tool will only show 20 by default; generate more rows if it's 20+.
Also check if the path is correct.

For Taproot descriptors, the suggested tool doesn't support it yet.
newbie
Activity: 15
Merit: 13
August 05, 2021, 03:30:08 PM
#10
Ok, Thank you.
HCP
legendary
Activity: 2086
Merit: 4361
August 03, 2021, 08:21:47 PM
#9
If you read the release notes for 0.21.0, you'll see the descriptor wallets are regarded as "experimental" and should not be the "default" wallet type created: https://bitcoincore.org/en/releases/0.21.0/

Additionally, the import and export functionality for these types of wallets is different:
As Legacy Wallets and Descriptor Wallets use different mechanisms for storing and importing scripts and keys the existing import RPCs have been disabled for descriptor wallets. New export RPCs for Descriptor Wallets have not yet been added.

The following RPCs are disabled for Descriptor Wallets:

- importprivkey
- importpubkey
- importaddress
- importwallet
- dumpprivkey
- dumpwallet
- importmulti
- addmultisigaddress
- sethdseed
So, as you can see... there are no "Export" functions for descriptor wallets as yet. So you will not be able to export anything at this time.

Note that v0.21.1 is just the update to support Taproot... so the 0.21.0 info regarding descriptor wallets should still hold true.


Essentially, unless you explicitly need descriptor support (and you can only use it for importing at this time), I would suggest that you continue to use the "legacy" wallet option by making sure that the "descriptor wallet" option is not used during wallet creation.
sr. member
Activity: 1518
Merit: 264
July 27, 2021, 08:02:44 AM
#8
Thank you very much.

How about putting the wallet.dat in core wallet and try? Latest version.
newbie
Activity: 15
Merit: 13
July 27, 2021, 03:48:42 AM
#7
Thank you very much.
newbie
Activity: 15
Merit: 13
July 26, 2021, 07:28:58 AM
#6
I tried creating to reproduce the problem (by enable "descriptor wallet" and "encrypt wallet" when creating new wallet) and managed to reproduce the problem. It happens because Bitcoin Core doesn't support such command for descriptor wallet according to https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md.
Is it better that I change the type of wallet to know my private key or I stay with this one ?
legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
July 26, 2021, 07:10:07 AM
#5
I tried creating to reproduce the problem (by enable "descriptor wallet" and "encrypt wallet" when creating new wallet) and managed to reproduce the problem. It happens because Bitcoin Core doesn't support such command for descriptor wallet according to https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md.
newbie
Activity: 15
Merit: 13
July 26, 2021, 06:52:25 AM
#4
I am told that the type of my wallet does not support this command.

Can you try it again and show us the exact error/warning message?

then dumpprivkey afterward.

Or use dumpwallet if you plan to get private key from many address.
I just did a test and when I deselect DescriptorWallet it shows me my private key but not when I select DescriptorWallet and even when I write '' dumpwallet '' it gives me the same error message: ''This type of wallet does not support this command (code -4)''


newbie
Activity: 15
Merit: 13
July 26, 2021, 06:27:17 AM
#3
Do you mind posting the commands you've used? Is it a standard wallet? If so, all you should be using is the walletpassphrase command to unlock the wallet, then dumpprivkey afterward.
I have already written these commands and I am told that my wallet does not support this kind of commands. When I created it, I just encrypted it, wrote a passphrase and that's it. Nothing more
staff
Activity: 3500
Merit: 6152
July 26, 2021, 06:07:34 AM
#2
Do you mind posting the commands you've used? Is it a standard wallet? If so, all you should be using is the walletpassphrase command to unlock the wallet, then dumpprivkey afterward.
newbie
Activity: 15
Merit: 13
July 26, 2021, 05:59:42 AM
#1
Hello, on Bitcoin core 0.21.1, when I write the commands on the console to see my private key, I am told that the type of my wallet does not support this command. It is an encrypted wallet with passphrase. Can someone tell me how to get my private key ? Thank you.
Jump to: