I know that PyWallet has a -dumpwallet but without using pywallet, how can I export all the addresses and privatekeys with the stock bitcoind?
Is there an API command that lists all addresses held by the wallet?
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI know that PyWallet has a -dumpwallet but without using pywallet, how can I export all the addresses and privatekeys with the stock bitcoind?
Is there an API command that lists all addresses held by the wallet?
You could send the dumpprivkey JSON-RPC call to the client. It takes a single parameter of BitcoinAddress to reveal the private key for that specific address.
To export all private keys for all addresses, you would have to call listreceivedbyaddress to list the addresses and then call dumpprivkey for each.
See: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list
Using bitcoin-qt for an interface:
listaddressgroupings
is the command which will list all addresses in use. Run it in the debug console window from the 'Help/Debug Window' screen.
Then, apparently, you can dump all the private keys, but only one at a time, using dumpprivkey for each key.
Seems lame.
Just go to your QT Wallet Console (Help -> Debug Window -> Console)
dumpwallet "C:/users/yout-user-name/dumpwallet.txt"
The command will export every of your private keys into that text file.
P/s: in case you have encrypted Wallet before you need run this command before run dumpwallet
walletpassphrase "your pass phrase" 600