I know we can do this by menu "File - Backup", but how can we get the private key of the address(or something else we can restore wallet) then write it down or print it out?
2 Answers
You want to use the listdescriptors true
RPC command. It will list all the output descriptors that the wallet consists of, together with their private key material (typically, in the form of xprvs). These descriptors can be imported into another wallet using the importdescriptors
RPC to get an equivalent wallet.
-
-
Can we get address and private key from the descriptor? @Pieter Wuille– foolbearCommented Apr 15 at 9:43
You can backup your wallet on bitcoin using the "backupwallet" RPC or "File > Backup" on GUI
$ bitcoin-cli -rpcwallet="wallet-01" backupwallet /path/to/Backups/backup-01.dat
More information on managing your wallet can be found at https://github.com/bitcoin/bitcoin/blob/master/doc/managing-wallets.md#14-backing-up-the-wallet
-
I don't think this answers OP's question; they're looking for printable data. Commented Jan 22 at 14:52
-
@foolbear if you are looking to get the private key of addresses to print you can use the dumpprivkey "address" RPC Commented Jan 23 at 11:30
-
-
-
So the only way is backup the whole wallet in Bitcoin Core, thanks. @PieterWuille– foolbearCommented Jan 24 at 1:59