How a Blockchain Actually Works
2026-06-02
Strip away the marketing and a blockchain is a boring, useful idea: an append-only log that thousands of strangers can agree on without trusting each other. The interesting part is not the word "blockchain" but the three primitives that make tampering detectable and history practically immutable: cryptographic hashes, Merkle trees, and a chain of block headers.
The Hash Function Is the Whole Trick
A cryptographic hash like SHA-256 takes any input and returns a fixed 256-bit fingerprint. Two properties matter. First, it is deterministic: the same input always yields the same output. Second, it is collision-resistant and avalanche-sensitive: flip one bit of input and roughly half the output bits change unpredictably. You cannot run it backwards to recover the input, and you cannot feasibly find two inputs with the same fingerprint.
That means a hash is a commitment. Publish the hash of a document today, reveal the document later, and anyone can verify you did not change a single character in between.
From Transactions to a Block
A block bundles many transactions plus a small header. The transactions are not hashed as one blob; they are organized into a Merkle tree. Each transaction is hashed, pairs of hashes are hashed together, and so on up to a single Merkle root in the header. This structure lets a lightweight wallet prove that one specific transaction is in a block by checking a short path of hashes instead of downloading every transaction. That proof is logarithmic in the number of transactions, not linear.
Chaining Blocks Together
Each block header contains the hash of the previous block header. That single field is what makes it a chain. Change any transaction in block 800,000 and its Merkle root changes, which changes that block's hash, which breaks the "previous hash" pointer in block 800,001, and every block after it. To rewrite history you would have to re-create every subsequent block faster than the rest of the network extends the honest chain.
Why This Is Tamper-Evident, Not Tamper-Proof
Nothing physically stops someone from editing their own copy of the ledger. The point is that everyone else instantly sees the mismatch, because their chain of hashes no longer agrees with the edited one. Immutability is a social and economic outcome enforced by consensus, not a law of physics. The hashes only make cheating detectable; consensus rules make it expensive.
State Versus History
Bitcoin stores history as a set of unspent transaction outputs (UTXOs) you consume and recreate. Ethereum keeps an explicit account-balance state tree updated by each block. Either way the chain of blocks is the audit log, and the current "state" is what you get by replaying that log from genesis. A new node trusts no one: it downloads the blocks and recomputes everything.
What to Take Away
- Hashes turn any data into a tamper-evident fingerprint.
- Merkle trees let you prove inclusion cheaply without the full dataset.
- Header chaining makes editing old history cascade and break visibly.
- Consensus (covered in a separate post) is what makes that breakage costly.
Everything else in crypto, smart contracts, stablecoins, rollups, is built on top of these ideas. Get comfortable with them and the rest of the stack stops looking like magic.