// learn · episode 02

Blocks & chains

In episode 1 you made fingerprints and mined for lucky ones. Now we stack those fingerprints into a structure with a remarkable property: change anything, anywhere in its history, and the whole world can see it. Everything runs in your browser.

01 · anatomy

What's inside a block

This toy block focuses on three fields: some data (say, a ledger entry), the previous block's hash (its lineage), and a nonce (a value the miner varies). A hash meeting the target demonstrates the proof of work. Real block headers include additional fields; the historical example below shows Bitcoin's format.

block #7

✗ invalid

prev hash — the lineage

000a3fc8b7e21d904c55f10287e6f3b19d2c4a8e0f6b5d3c2a190807e6d5c4b3

the fingerprint of block #6 — baked into this block's own hash

nonce — varied by the miner

0

hash — the fingerprint

sealed only while it starts with “000”

Edit the data and the seal breaks instantly — the old nonce is worthless against the new fingerprint. That's the avalanche effect from episode 1, now guarding a ledger entry.

02 · the chain

Chain them together

Here's the trick that turns blocks into a blockchain: every block's hash includes the hash of the block before it. They're not a list — they're a chain of custody. Try changing any ledger entry below, especially an early one, and watch what happens downstream.

⛏ forging the chain — mining 5 blocks…

block #1 genesis

✗ broken

nonce 0

prev 000000 (genesis)

block #2

✗ broken

nonce 0

prev

block #3

✗ broken

nonce 0

prev

block #4

✗ broken

nonce 0

prev

block #5

✗ broken

nonce 0

prev

03 · the real thing

A real one

The toy chain illustrates links between hashes; Bitcoin uses a more detailed header and consensus rules. Here is the most famous block ever mined — the very first — with every header field annotated. You'll recognize all of them.

Bitcoin block #0 — the genesis block

real, historical block
version
1
which rule-set the miner followed
prev block hash
0000000000000000000000000000000000000000000000000000000000000000
all zeros — there is no block before the genesis block, exactly like block #1 in your chain above
merkle root
4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
one hash summarizing every transaction in the block — real blocks carry thousands at once
timestamp
2009-01-03 18:15 UTC
the timestamp recorded in the block header
bits (difficulty)
0x1d00ffff
compact encoding of the proof-of-work target
nonce
2,083,236,893
the successful nonce value; it does not reveal how many attempts the miner made
hash
000000000019d6689c085ae165831e9934ff763ae46a2a6c172b3f1b60a8ce26
ten leading hex zeros — every Bitcoin block since chains back to this fingerprint

Inside its single transaction, Satoshi Nakamoto left a newspaper headline as a timestamp proof: “The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.” The first block's data field was already making a point about the system it replaced.

Bitcoin targets an average interval of about 10 minutes; actual intervals vary

transaction counts vary with transaction size and block capacity

anyone, anywhere can re-verify the entire history — that's the point

next up

Episode 03 — Consensus & proof of work play now →

You can now build history and prove tampering. Next: how thousands of strangers agree on which history is the real one.

Building something that needs this to be right? →