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?

3 Answers 3


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

  • 1
    That won't dump keys associated with 'change' addresses. Commented Sep 5, 2012 at 1:31
  • 2
    According to the documentation... "Listing the bitcoin addresses in your wallet is easily done via listreceivedbyaddress. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true." Commented Sep 7, 2012 at 23:34

Using bitcoin-qt for an interface:


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.