‹ CHAPTER 9, ALL LESSONS

PATHFINDER · CHAPTER 9 · LESSON 3 OF 5

Mempool, blocks & confirmations

Anatomy of a block

What is actually inside a block? 5 min

A block is two things: a small header of 80 bytes, and the list of transactions it confirms, usually a few thousand.

The header, six fields

  • Version: which rules and signals the miner uses.
  • Previous block hash: the link to the block before.
  • Merkle root: one hash summarising every transaction in the block.
  • Timestamp: the time the miner wrote, within limits nodes check.
  • Bits: the current difficulty target, in compact form.
  • Nonce: the number the miner changes while searching for a valid hash.

The Merkle root is built by hashing transactions in pairs, then the pairs in pairs, until one hash remains. Change a single transaction and the root changes, and with it the block hash.

The coinbase transaction

The first transaction of every block is special. It has no real input: it creates the block subsidy out of nothing and collects all the fees of the block, paid to an address the miner chooses. Its coins can only be spent after 100 more blocks.

▶ SEE IT IN THE MACHINE

At BLOCK HASH, the press strikes the block once its header has a valid hash, and the timestamp dial records it.

What to remember

  • A block is an 80 byte header plus its transactions.
  • The Merkle root summarises every transaction in one hash.
  • The coinbase transaction pays the subsidy and fees to the miner.

Quick check

What does the Merkle root in the header represent?

What is special about the coinbase transaction?