The Blockchain: Immutable Ledger
Every node you learned about in the last lesson stores the same structure: the blockchain itself, a specific data format that makes Bitcoin's transaction history extremely difficult to alter after the fact. This lesson explains exactly how blocks link together into a chain, why that linkage is what makes the history "immutable" in practice, and what that word does and does not mean.
The Concept
A block is a batch of validated transactions bundled together with a header. The header contains, among other fields: a timestamp, the nonce found through proof of work (Lesson 2), a Merkle root, and — critically — the cryptographic hash of the previous block's header. That last field is the "chain" in blockchain: each block's identity is mathematically derived in part from the block before it, which was derived in part from the block before that, all the way back to the very first block, the Genesis Block, mined by Satoshi Nakamoto in January 2009.
This chaining is what makes the ledger practically immutable. If anyone tried to alter a transaction inside a block that was mined some time ago — say, to make it look like a payment never happened — that change would alter the block's header hash, which would no longer match the "previous block hash" field stored in the next block, breaking the link. To make the tampered block appear valid again, the attacker would have to redo the proof-of-work for that block and every single block mined after it, racing to produce a longer alternative chain than the honest network before anyone notices. Because the honest network is simultaneously still extending the real chain with enormous distributed computing power, this becomes exponentially harder the further back in history the attacker tries to rewrite, and effectively impossible for anything beyond a very recent handful of blocks. This is why a transaction is considered more final the more blocks have been added on top of it — commonly summarized as waiting for a number of "confirmations."
The Merkle root deserves a mention because it is what lets a block header — only 80 bytes — represent potentially thousands of transactions. All the transactions in a block are hashed together in pairs, repeatedly, until a single hash remains: the Merkle root. This lets a lightweight wallet (from the previous lesson) ask a full node "prove my transaction is in block X" and receive a short proof, without downloading every transaction in that block.
It is worth being precise about what "immutable" means here: it does not mean literally impossible to change under any circumstance, nor does it mean a transaction can never be reorganized. In rare cases, the most recent one or two blocks can be replaced if a competing block with more proof of work appears almost simultaneously — this is a normal, expected occurrence called a chain reorganization, and it is why wallets and exchanges wait for multiple confirmations before treating a large payment as final. What "immutable" does mean is that altering history that is more than a few blocks old requires an amount of real-world computational work that has never, in Bitcoin's history since 2009, been economically or practically achieved.
Worked Example
Suppose block 900,000 contains a payment from Alice to Bob. An attacker wants to erase this payment and instead show the same coins going to themselves. They would need to: recreate block 900,000 with the altered transaction, find a new valid nonce for it (proof of work from scratch), then do the same for block 900,001, 900,002, and every block mined since — all while the honest network continues adding new blocks on top of the real chain at the normal rate. If the attacker cannot out-produce the entire rest of the network's combined computing power, their alternative chain never becomes the longest (highest cumulative work) chain, and every honest node simply ignores it. The further back block 900,000 recedes into history as new blocks are added on top of it, the more work the attacker would need to redo, which is why six confirmations (roughly one hour) is a common convention for treating a Bitcoin payment as final for a meaningful amount of money.
Exercise
Using a block explorer, find any block more than six months old and note how many blocks have been mined on top of it since (the explorer typically shows "confirmations" or lets you subtract its height from the current tip). Write one sentence estimating, in plain terms, why rewriting that block today would be considered effectively impossible.
Recap
- Each block's header includes the previous block's hash, chaining them together so altering old data breaks the chain and is detectable by every node.
- Rewriting history requires redoing proof of work for the altered block and everything built on top of it, faster than the honest network — which becomes exponentially harder the older the block is.
- "Immutable" means extremely costly to alter, not literally unchangeable; the most recent block or two can still be reorganized normally, which is why confirmations matter.
Resources
- Bitcoin Developer Guide, "Block Chain" (developer.bitcoin.org/devguide/block_chain.html) — block header fields and Merkle trees.
- Satoshi Nakamoto, "Bitcoin: A Peer-to-Peer Electronic Cash System" (bitcoin.org/bitcoin.pdf), Section 7, "Reclaiming Disk Space."
- mempool.space — look up any block's height, hash, and confirmation count directly.