Created
February 14, 2019 16:32
-
-
Save kirkins/fb0c09d51d812a8ba751612020560423 to your computer and use it in GitHub Desktop.
For checking the balance of several bitcoin addresses in a text file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# For format of 64 chars without 0x at the start | |
# Source script from: https://github.com/grondilu/bitcoin-bash-tools.git | |
source ./bitcoin.sh | |
while read k; do | |
PUBLIC=$(newBitcoinKey 0x$k \ | |
| grep bitcoin\ address \ | |
| head -1 \ | |
| cut -f 2 -d ":" \ | |
| tr -d " ") | |
BALANCE=$(wget -qO- blockchain.info/rawaddr/$PUBLIC 2>&1 \ | |
| grep -Po '"final_balance":\K[0-9]+') | |
if [ -n "$BALANCE" ]; then | |
echo $k,$PUBLIC,$BALANCE | |
fi | |
done < keys.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment