Putting It Together

The Blockchain

How blocks link together, why this makes history immutable, and what "longest chain" really means.

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").

Block 0
000000000019d6...
Block 1
00000000839a8e...
Block 2
000000006a625f...
Block ...
...
Block 880,000+
00000000000000...

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.

Merkle Root
Hash(H1+H2)
Hash(H3+H4)
H1: Tx1
H2: Tx2
H3: Tx3
H4: Tx4

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:

Block 1
✓ Valid
Block 2
✓ Valid
Block 3
✓ Valid
Block 4
✓ Valid
Block 5
✓ 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 deeper a block is in the chain, the more secure it is. Six confirmations (blocks) is traditionally considered "final" for large transactions.

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.

Next: Bitcoin Economics →

Block rewards, halving, and why there will only ever be 21 million.

📌 TL;DR
Each block contains the previous block's hash, creating a chain. Change any past block, and every subsequent hash breaks. The longest valid chain wins—the majority hashpower decides what's "true."

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.

← Previous: Transactions Next: Economics →