Track 1 · Mechanics · lesson 1
Blocks and the chain
7 min
You know the shape now: each block commits to the one before it. This lesson opens a block up and names the parts, because every one of them comes back later.
A block is a header plus a list
The list is the transactions. The header is small — a few hundred bytes — and it is what actually gets hashed and chained.
The header carries:
- parent hash — the link backwards
- height — how many blocks came before it
- timestamp — roughly when it was produced
- state root — a fingerprint of the entire world after this block
- transactions root — a fingerprint of the list below
Notice that the header does not contain the transactions, only a fingerprint of them. That separation is doing real work: you can verify a block's place in the chain by checking a few hundred bytes, without ever downloading the transactions themselves.
Phones rely on this. So do bridges between chains.
Predict
The header includes a state root — a fingerprint of every account balance after this block. Why store that, when the transactions alone would let you recompute it?
Height is not time
Blocks are numbered, and that number — the height — is the closest thing a chain has to a clock. Ethereum aims for a block every 12 seconds; Bitcoin every ten minutes.
The timestamp in the header is self-reported by whoever produced the block, and only loosely policed. Contracts that need a reliable clock cannot lean on it too hard, which is a trap you will exploit in the Breach Lab.
Check
Which part of a block is hashed to produce the hash that the next block points at?
Worth remembering
- A block is a small header plus a list of transactions; only the header is hashed and chained.
- The header holds the parent hash, height, timestamp, state root and transactions root.
- The state root fingerprints the world after the block, so you can check a balance without replaying history.
- Height is the chain's clock. The timestamp is self-reported and only loosely policed.