#!/bin/bash

bitcoin_address_list_rng=$(find ./ -iname "victim*addresses*bitcoin*" -exec cat {} \; | sort -u)

bitcoin_address_list_brainwallet=$(find ./ -iname "brainwallet*victim*addr*bitcoin*" -exec cat {} \; | sort -u)
ethereum_address_list_brainwallet=$(find ./ -iname "brainwallet*victim*addr*eth*" -exec cat {} \; | sort -u)
litecoin_address_list_brainwallet=$(find ./ -iname "brainwallet*victim*addr*litecoin*" -exec cat {} \; | sort -u)

echo -n "Number of unique weak PRNG Bitcoin wallet addresses: "
echo "${bitcoin_address_list_rng}" | wc -l
for prefix in "1" "3" "bc1q" "bc1p"
    do
    echo -n "Prefix ${prefix}: "
    echo "${bitcoin_address_list_rng}" | grep -Poh "^${prefix}" | wc -l
done
echo ""

echo -n "Number of unique weak PRNG Ethereum wallet addresses: "
find ./ -iname "victim*addresses*ethereum*" -exec cat {} \; | sort -u | wc -l
echo ""

echo -n "Number of unique weak brainwallet Bitcoin wallet addresses: "
echo "${bitcoin_address_list_brainwallet}" | wc -l
for prefix in "1" "3" "bc1q" "bc1p"
    do
    echo -n "Prefix ${prefix}: "
    echo "${bitcoin_address_list_brainwallet}" | grep -Poh "^${prefix}" | wc -l
done
echo ""

echo -n "Number of unique weak brainwallet Ethereum wallet addresses: "
echo "${ethereum_address_list_brainwallet}" | wc -l
echo ""

echo -n "Number of unique weak brainwallet Litecoin wallet addresses: "
echo "${litecoin_address_list_brainwallet}" | wc -l
echo ""
