guest@backslash:~/posts/bitcoin/bitcoin-recover-keys$

Bitcoin recover keys

~1 mincrypto bitcoin lightning network linux

Bitcoin recover keys

How to extract the private keys from an old Bitcoin Wallet (Android) backup, now that the app can no longer sync.

Bitcoin Wallet (Android)

Good old “Bitcoin Wallet” is not syncing with servers anymore. So you will not be able to broadcast TX from that app.

Link to Google Play app

Luckily the app is open source and they have provided hints to uncover the keys from backup file.

Just adding my experience on top of it..

Decrypt backup

sh
# will prompt for backup password
openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup-testnet-2014-11-01 > bitcoin-wallet-decrypted-backup

cat bitcoin-wallet-decrypted-backup | tr -cd "[:print:]" | awk '{print $1}'

If it prints “org.bitcoin.production”, you got the right password and the backup file uses the bitcoinj protobuf format

Open the wallet with bitcoinj and extract key

After cloning git clone -b release-0.15 https://github.com/bitcoinj/bitcoinj.git

I also installed Java 11, cause the build would not work

sh
sudo apt install openjdk-11-jdk

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

Then the wallet builds

sh
cd bitcoinj/tools
./wallet-tool

Reset and sync

sh
./wallet-tool reset --wallet=/home/slash/bitcoin/decrypted-backup

Dump priv keys

sh
./wallet-tool dump --wallet=/home/slash/bitcoin/decrypted-backup --password={pincode}

BACKSLASH(1)                  User Commands

NAME
       backslash - keyboard navigation

KEYS
       j / k      scroll down / up
       n / p      next / previous post
       gg / G     top / bottom of the page
       /          filter posts
       ?          this help
       Esc        close