Skip to content

Instantly share code, notes, and snippets.

@kirkins
Last active February 14, 2019 16:31
Show Gist options
  • Save kirkins/04ab6e242651a501dc26db1b6e93a4ad to your computer and use it in GitHub Desktop.
Save kirkins/04ab6e242651a501dc26db1b6e93a4ad to your computer and use it in GitHub Desktop.
Check the current balance from a list of private bitcoin keys
#!/usr/bin/env bash
# For keys in format of 66 chars starting with 0x
# Source script from: https://github.com/grondilu/bitcoin-bash-tools.git
source ./bitcoin.sh
while read k; do
WALLET=$(newBitcoinKey $k \
| grep bitcoin\ address \
| cut -f 2 -d ":" \
| tr -d " ")
wget -qO- blockchain.info/rawaddr/$WALLET 2>&1 | grep -Po '"final_balance":\K[0-9]+'
done < keys.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment