What is difficulty adjustment?

The automatic change to Bitcoin's mining target every 2,016 blocks that keeps new blocks arriving roughly ten minutes apart.

Not yet verifiedHow we verify

3 min read

In this entry

The automatic change to Bitcoin's mining target every 2,016 blocks that keeps new blocks arriving roughly ten minutes apart.

Nodes compare how long the last 2,016 blocks actually took against the two weeks they were meant to take, then move the difficulty by that ratio, capped at a factor of four in either direction (source: Bitcoin developer documentation). It is the mechanism that makes Bitcoin's supply schedule a promise the network can keep regardless of how much mining equipment exists.

The thing people get wrong is treating difficulty as a fee or a setting someone controls. No one sets it. Every full node computes the same number from the timestamps already in the chain, which is why a miner cannot cheat it and a company cannot lower it.

How it works

  1. Every block header contains a target. A block is valid only if its hash is below that target, so a lower target means fewer valid hashes and more work per block.
  2. At every 2,016-block boundary, nodes measure the time the previous 2,016 blocks took and divide the intended 20,160 minutes by it.
  3. The target is multiplied by that ratio, clamped so it can move by no more than a factor of four up or down in a single retarget (source: Bitcoin developer documentation).
  4. Every node applies the same rule to the same data, so they all arrive at the same new target without communicating.

The effect runs one retarget behind reality. If hash rate leaves the network mid-period, blocks slow immediately and stay slow until the next adjustment lowers the target. If hash rate arrives, blocks come faster than ten minutes until the adjustment raises it.

Other proof-of-work chains use the same idea with different constants, and some retarget every block to react faster.

Example

Take an illustrative period in which the last 2,016 blocks took 15 days instead of the intended 14. Nodes divide 14 by 15 and multiply the target by about 1.071, an easier target, which reports as a difficulty drop of roughly 6.7%. Blocks should then return to about ten minutes at the same hash rate. Work the arithmetic the other way for a fast period: 12 days elapsed gives 14 divided by 12, a 16.7% difficulty increase.

Why it matters when you buy

Slow blocks mean slow confirmations, so a deposit that normally credits in an hour can take considerably longer after a large drop in mining capacity, and exchanges do not shorten their confirmation requirements to compensate. Difficulty also fixes the pace of new supply, which is the input to every Bitcoin issuance figure you will read; see the Bitcoin coin page and the chain pages for current network measures.

hash rate — the computing power the adjustment responds to, mining — the work being measured, proof of work — the consensus rule this enforces, block subsidy — the reward being kept on schedule, bitcoin halving — the other half of the supply rule, confirmation — what slows when blocks slow.

Questions

How often does Bitcoin's difficulty change?

Every 2,016 blocks, which is about two weeks when blocks average ten minutes. Because the interval is counted in blocks rather than days, a slow period pushes the next adjustment further out in calendar time.

Can a difficulty adjustment stop my transaction confirming?

No. It changes how fast blocks arrive, not whether a transaction is valid. A transaction paying a competitive fee still confirms, just possibly after a longer wait.

Does higher difficulty make Bitcoin more secure?

More hash rate raises the cost of rewriting recent history, and difficulty rises with it. Security also depends on how that hash rate is distributed, which difficulty says nothing about.