‹ CHAPTER 11, ALL LESSONS

PATHFINDER · CHAPTER 11 · LESSON 3 OF 4

Double spending

Reorgs and orphan blocks

What happens when two miners find a block at the same time? 5 min

Sometimes two miners find a valid block at nearly the same moment, at the same height. Part of the network sees one first, part sees the other. For a short while, two versions of the tip exist.

The tie breaks itself

Each miner keeps building on the block it saw first. Soon one side finds the next block and becomes heavier. Nodes on the other side switch to it: this switch is a reorganisation, a reorg. The abandoned block is called stale, often orphan.

Transactions from the stale block are not lost. Most were also in the winning block; the rest return to the mempool and are mined again. The miner of the stale block loses the reward, which is why miners want their blocks to travel fast.

  • One block reorgs happen from time to time and are harmless.
  • Two block reorgs are very rare.
  • Deeper ones, without an attack, are essentially never seen.

What to remember

  • Two blocks at the same height cause a brief split.
  • The next block decides; the other becomes stale.
  • Transactions of the stale block go back to the mempool.

Quick check

What happens to the transactions of a stale block?

Who loses something when a block becomes stale?