## Objective: mine the Bitcoin genesis block from struct import pack from hashlib import sha256 from codecs import decode from binascii import hexlify ## Bitcoin uses the SHA256d hash function, which is the SHA256 function ## run twice (double). def sha256d(data): return sha256(sha256(data).digest()).digest() ## We want to display our results as hex in RPC Byte Order, so ## we need to reverse the byte order def internal2rpc(hash): return hexlify(hash[::-1]) ## The version number 1 as a little-endian (<) unsigned-long (L) version = pack(") unsigned-long (L) nbits = pack("