A Chain of Blocks
The blockchain is exactly what it sounds like: a chain of blocks, each linking to the one before it. Every block contains the hash of the previous block, creating an unbroken chain back to the very first block (the "genesis block").
Each block references its parent by including the parent's hash. This creates a dependency: if you change anything in an old block, its hash changes, which breaks the link to the next block.
What's In a Block?
Block Header (80 bytes)
- Version — Protocol version
- Previous Block Hash — Links to parent
- Merkle Root — Hash of all transactions
- Timestamp — When block was created
- Bits — Difficulty target
- Nonce — Miner's guess counter
Block Body
- Transaction Count — Number of txs
- Coinbase Transaction — Miner's reward
- Transactions — All other txs
A block can contain thousands of transactions, limited by the 4M weight unit cap.
The Merkle Tree
How do you commit to thousands of transactions in just 32 bytes? The Merkle tree—a structure that hashes transactions in pairs, then hashes those hashes, until you get a single "root" hash.
If any transaction changes, the Merkle root changes, which changes the block header hash. The Merkle tree makes it possible to prove a transaction is in a block without downloading the entire block.
Why Immutable?
The blockchain is practically immutable because changing any old block requires redoing all the proof-of-work for that block AND every block after it.
Immutability Demo
Try to tamper with an old block and see what happens:
✓ Valid
✓ Valid
✓ Valid
✓ Valid
✓ Valid
An attacker would need to redo the work for blocks 2, 3, 4, 5, and every future block—while the honest network keeps adding more blocks. Unless they have >50% of hashpower, they can never catch up.
The Longest Chain Rule
When nodes see two valid chains (a "fork"), they follow the one with the most cumulative proof-of-work—usually the longest chain. This resolves conflicts automatically.
| Situation | Resolution |
|---|---|
| Two miners find blocks simultaneously | Temporary fork; one chain wins when next block is found |
| Attacker creates alternative chain | Honest chain wins if it has more work |
| Network partition heals | Shorter chain's blocks become "orphaned" |
This is why you wait for confirmations. The first confirmation could theoretically be reversed. Six confirmations? Essentially impossible without majority hashpower.
Frequently Asked Questions
Can the blockchain be deleted?
No. Everyone runs a full copy. Even if you destroyed 99% of nodes, the blockchain would survive on the remaining ones. The data is redundant by design.
What is a 51% attack?
Controlling >50% of hashrate lets you rewrite history and double-spend. But it costs enormous electricity, the attacker's coins become worthless, and they lose their mining investment. It's economically suicidal.
Why 6 confirmations?
Each block makes reversal harder. After 6 blocks (~1 hour), the math is so overwhelmingly against reversal that it's considered settled. Large transactions wait for more confirmations; small ones can use fewer.