Hash Chains & Block Linking
Build a minimal blockchain with hash pointers to understand immutability.
What Is a Hash Chain?
A hash chain links data blocks so that each block contains the hash of the previous block. Modifying any block changes its hash, which invalidates all subsequent blocks. This creates a tamper-evident, append-only ledger.
Block Structure
Each block contains: (1) data payload (transactions), (2) previous block hash (pointer to prior block), (3) timestamp, (4) nonce (for PoW), (5) Merkle root of transactions. The first block (genesis) has previous_hash = "0"*64.