Dump All Bitcoin Addresses to a GPG Protected Backup
I use the following script to periodically backup my bitcoin private keys in an OOB backup incase my wallet.dat
decides to no longer work.
# Unlock Wallet for 1 min
read WP
bitcoind walletpassphrase "$WP" 60
# Dump Addresses to a dated GPG protected file
bitcoind listaddressgroupings \
| ruby -e '$stdin.read.scan(/^\s+"(1[a-z0-9]{30,})"/i).each{|m| pubKey = m[0]; privKey = `bitcoind dumpprivkey #{m[0]}`; puts "Address: #{pubKey}\nPrivkey: #{privKey}\n" }' \
| gpg -e -r ErebusBat@gmail.com -o /var/backups/bitcoin/PrivateKeys-$(date +%Y%m%d-%H%M%S).txt.asc
bitcoind walletlock
unset WP
Written by Andrew Burns
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Gpg
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#