Looking at RIPEMD-160 Bitcoin Addresses for Fun and No Profit

The computer code bit

Extracting the transactions

git clone https://github.com/kf106/btcposbal2csv
cd btcposbal2csv
sudo ./install.sh
source venv/bin/activate
python btcposbal2csv.py /path_to_Bitcoin/chainstate addresses.csv
awk -F"," '{x+=$2}END{print "Satoshi total is " x}' ./ripe.csv

Introducing RIPEMD-160

python convert2ripemd160.py > ./ripe.csv
sed -n '$=' ./ripe.csv
awk -F "\"*,\"*" '{print $4}' ripe.csv > ripeonly.csv
sort ripeonly.csv > ripesort.csv
keir@chainfrog$ head ripesort.csv
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000001
0000000000000000000000000000000000000002
0000000000000000000000000000000000000003
0000000000000000000000000000000000000004
0000000000000000000000000000000000000005
0000000000000000000000000000000000000006
0000000000000000000000000000000000000007
0000000000000000000000000000000000000008
keir@chainfrog$ tail ripesort.csv 
ffffffffffffffffffffffdb004301555a5a7869
ffffffffffffffffffffffdb004301ffffffffff
ffffffffffffffffffffffffffdb004301ffffff
ffffffffffffffffffffffffffffffc200110801
ffffffffffffffffffffffffffffffffdb004301
ffffffffffffffffffffffffffffffffffc00011
ffffffffffffffffffffffffffffffffffffdb00
fffffffffffffffffffffffffffffffffffffe36
ffffffffffffffffffffffffffffffffffffffff

Being lazy is a lot less work

while read line; do echo $line | openssl rmd160 -binary | xxd -p; done < ripeonly.csv >> pseudorand.csv
grep --count '\(.\)\1\1\1\1\1\1\1\1\1' pseudorandsort.csv
grep --count '\(.\)\1\1\1\1\1\1\1\1\1' ripesort.csv
764d544f51655a49586276536d7a0a0000000000
76616e206461616c0a0000000000000000000000
76616e206461616c0a0a0a0a0000000000000000
766173652c2062616c6c6f6f6e2e000000000000
766520796f750a00000000000000000000000000
76657273696f6e3a302e3031ffffffffffffffff
7669430a00000000000000000000000000000000
7669612040636f696e6465736b00000000000000
766ac43156a7f2d26e9099f10000000000000000
766c612055726261637a6b790a00000000000000
76cc000000002b9f24000000000002988b2c230e
76d575876f00000000000000000000000042a0ec
7700000000000000000000000000000000000000

Adding up the satoshis

grep ",.*,.*,.*\(.\)\1\1\1\1\1\1\1\1\1.*$" ripe.csv > ripeweird.csv
awk -F"," '{x+=$2}END{print "Satoshi total is " x}' ./ripeweird.csv

Vanity of vanities

sort --field-separator="," -n -k 2 ripeweird.csv > ripeweirdsort.csv
tail ripeweirdsort.csv
12H2TgmSqUJnNkRoCAtpKxk83LeJHHhVTA,2106000,297114,0e0000000000000001000000008ba4d185000000
111111GQBM6cV1NPHRrwkUWY1EnGNCVo,15000000,565919,0000000000541e4b4dc4cac85e3d550fbf82ff37
111111XQU2hAwaF2YjLHVkKoqQiFnDEF,100000000,348797,0000000000a614b2c1b4c37f30905d978b352a4b
111111W1yUY2vSgXDQBUp95qGoVwej5v,100000000,353912,00000000009e800cc10ba10802bd6afaf4462073
111111e4BfZw5QZPDBxKNekL2wApVCVd,344129179,512371,0000000000ca6840ea97057ac93b617024d0198c
111111nFTRm5GCoUNS7mURKmZEJAu1j,500044493,550136,00000000000442f272ba5cb84c0259ccd91d10f0
111111811zDiVJNrGoufFmZUdetqXMqV,1600000000,512707,0000000000263cf663dd808113f7428e021f6e05
111111YnPJJ6Zb6Gri3yP9UEi4hbk7xT,3678801024,487760,0000000000ad9b82ad38b0f0c0c0f76f3eeca574
1111111111111111111114oLvT2,6720404010,491637,0000000000000000000000000000000000000000
1111116d87CjjDyP8SF5v1LTvUq22VFg,8957970093,488065,00000000001eb6ba52e378d3be9864eb7238e9f2

Summing up

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Keir Finlow-Bates

Keir Finlow-Bates

593 Followers

CEO and co-founder of Chainfrog Oy, a Finnish startup researching and developing advanced blockchain technologies.