...
A file backup would be the most comprehensive recovery option in the event of catastrophe. Since the file is so sensitive though, having multiple copies also increases your hack risks. Secure your backups!
Private Keys
It is not recommended dangerous to print or expose your private key, especially in a terminal or any other insecure environment. However, if you absolutely need to your private key(s). Be extremely cautious with these operations. Anyone with access to your private key(s) can control your Bitcoin funds associated with that address. We generally recommended you use hardware wallets or other secure methods for managing your private keys.
If you absolutely must retrieve your private key for a specific address - you must first determine the type of wallet you’re using:
Code Block |
---|
bitcoin-cli |
...
getwalletinfo |
Examine the descriptors attribute in the result.
true = use the
listdescriptors
method.false = use the
dumpprivkey
method.
The dumpprivkey
command is deprecated and unusable for non-legacy wallets. Example:
Code Block |
---|
bitcoin-cli dumpprivkey "your_bitcoin_address" |
Replace
"your_bitcoin_address"
with the actual address for which you want to retrieve the private key. This command will output the private key associated with that address.Be extremely cautious with this operation. Anyone with access to your private key can control your Bitcoin funds associated with that address. We generally recommended you use hardware wallets or other secure methods for managing your private keys.Only works for legacy-type (non-descriptor) wallets.
The listdescriptors
command works for non-legacy wallets (bech32, bech32m, and descriptors). It is a bit more complex to use than dumpprivkey
, and prints out the all the keys in JSON format.
Code Block |
---|
bitcoin-cli listdescriptors true |
Returns all descriptors and their private keys, including their derivation paths.
...
Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
hidden | true |
---|
...