1

I know about pywallet, about this modification for bitcoind, but what is a simple way to merge two wallets, or export a list of private keys and addresses of all of wallets from litecoin, dogecoin, bitcoin, quark, et cetera?

Thank you!

Nick ODell
  • 29,396
  • 11
  • 72
  • 130
Alex
  • 11
  • 2

1 Answers1

5

Latest versions of the reference Bitcoin implementation have the 'dumpwallet' RPC command, which dumps a human-readable list of all of your private keys.

The format is simple: just comment-lines (starting with #) or lines that are the private key (plus metadata about the key). So to combine keys from several wallets you would:

  1. Re-run bitcoind/Bitcoin-Qt, giving the -wallet=/path/to/wallet option
  2. dumpwallet the private keys to a file (walletpassphrase first if the wallet has a passphrase)
  3. Shutdown
  4. concatenate the files together
  5. Re-run and importwallet the combined file

The last step will take a while as the blockchain is scanned for transactions to/from the imported private keys (concatenating several wallet keys together in step 3 saves time over repeatedly dumping/importing).

A php or python or bash script that did all of the starting/stopping/concatenating either using the JSON/RPC interface or bitcoin-cli would be spiffy. Extra credit if it noticed which wallets were locked and prompted for passphrases....

gavinandresen
  • 3,360
  • 21
  • 23