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.

block #12prev 0000…a1hash 7f3c…9eblock #13prev 7f3c…9ehash b204…1dblock #14prev b204…1dhash c8a7…40
Each block stores the hash of the one before it. That is the chain.

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:

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?

Choose one answer

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?

Choose one answer

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.