Dump all bitcoin private keys

I have used this script to export all private keys in a wallet. The blockchain does not have to be synced, but the wallet obviously has to be unlocked (with walletpassphrase).

No warranty.

#!/usr/bin/env bash

while read -r address; do
  echo $address
  bitcoin-cli dumpprivkey $address
done < <(bitcoin-cli listaddressgroupings | grep -E '[13][a-zA-Z0-9]{27,34}' --only-matching --color=never)
Published on Jan. 9, 2015 at 2:57 p.m. by Nicolas and tagged Bitcoin. You can follow the discussion with the comment feed for this post. Feeling generous? Donate!

0 comments

Start a new thread

Cancel reply
Markdown. Syntax highlighting with <code lang="php"><?php echo "Hello, world!"; ?></code> etc.