A naive blockchain implementation in Python. Consensus is based on proof-of-work as in the Bitcoin and Hashcash implementations.
The chain is represented as an ordered back-linked list starting with the genesis block at the root. Each block is identified by a hash, generated using the SHA256 algorithm on its block header which consists of the following metadata:
- its position in the blockchain (height).
- a reference to the hash of the previous (parent) block in the chain.
- a cryptographic hash of the root of the Merkle-Tree.
- the approximate creation time of the block (seconds from Unix Epoch).
- a unique answer to a difficult-to-solve mathematical puzzle (CPU cost function).