Visualizing Bitcoin Blockchain Block Hashes [ztiOvSHAcFz]
This video shows a visualization of the hashes of the blocks on the Bitcoin blockchain which shows the difficulty increasing over time.
Scripts used to produce output:
Script 1 to export data from bitcoin-cli:
for block in $(seq 1 $(bitcoin-cli getblockcount)); do
hash="`bitcoin-cli getblockhash $block`";
diff=`bitcoin-cli getblock $hash | grep "^ \"difficulty\" :" | awk '{print $3}' | tr -d ','`
date=`bitcoin-cli getblock $hash | grep "^ \"time\" :" | awk '{print $3}' | tr -d ','`
date2=`date -d @$date`
printf "%-65s %-8s %-22s %-15s\n" $hash $block $diff "$date2"
done
Script 2 to produce output file:
cat hashes | while read line; do
hash=`echo $line | awk '{print $1}' | tr [a-z] [A-Z]`
height=`echo $line | awk '{print $2}'`
date=`echo $line | awk '{print $5 " " $6 " " $9}' `
export BC_LINE_LENGTH=300
bin=`echo "ibase=16;obase=2;$hash" | bc `
length=${#bin}
zeros=`expr 256 - $length`
for zero in `seq 1 $zeros `; do
if [ "$zero" -eq 32 ] ; then
echo -n -e '\E[37;41m'"\033[1m0\033[0m"
else
echo -n -e '\E[33;44m'"\033[1m0\033[0m"
fi
done
printf "%-20s %-7s %-12s\n" "$bin" "$height" "$date"
done #flag pattern crypto #convert bitcoins to dollars #bitcoin rede trump #bitcoin apex platform #how to create a crypto coin