‹ CHAPTER 10, ALL LESSONS

PATHFINDER · CHAPTER 10 · LESSON 2 OF 5

Mining & proof of work

Difficulty adjustment

Miners keep adding machines. Why do blocks still come every ten minutes? 5 min

Every 2016 blocks, about two weeks, every node looks at how long those blocks took. If they came faster than ten minutes on average, the target is lowered so valid hashes become rarer. If they came slower, the target is raised.

A thermostat with no one at the controls

Nobody decides the difficulty. Each node computes it from the timestamps in the chain, with the same formula, and gets the same result. A block that does not respect the new target is rejected by everyone.

One adjustment is capped: the difficulty can change by at most a factor of four up or down. When a large share of miners switched off in 2021 after a ban in China, blocks slowed for a few weeks, then the difficulty fell and the pace returned to ten minutes.

▶ SEE IT IN THE MACHINE

MINING DIFFICULTY is a gearbox with a lever: its position is the real change expected at the next retarget.

What to remember

  • Difficulty adjusts every 2016 blocks, about two weeks.
  • Every node computes it the same way, nobody sets it.
  • It keeps blocks near ten minutes whatever the hashrate.

Quick check

The hashrate doubles in a month. What happens over the following weeks?

Who sets the difficulty?