JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Mining, Difficulty, and the Halving

How Bitcoin keeps blocks arriving about every ten minutes no matter how many machines join, and how the reward for finding them is cut in half roughly every four years.

A clock that nobody owns

Picture a kitchen timer that should ring every ten minutes. The catch: the cook keeps changing. Sometimes one person is at the stove, sometimes ten thousand, and the fast cooks bring better knives every year. If the timer never adjusted, a crowd of fast cooks would make it ring every ten seconds. Bitcoin faces exactly this problem. It wants a new block roughly every ten minutes, forever — but the number of machines racing to produce one swings wildly. Its answer is an automatic dial that re-tunes the puzzle so the ten-minute rhythm holds no matter who shows up.

The race to produce blocks is mining, and it works by proof of work: miners try number after number until one makes the block's hash land below a target. Lower the target and the puzzle gets harder; raise it and it gets easier. That single knob is what the ten-minute clock turns.

Retargeting: the self-tuning dial

Bitcoin checks its clock every 2016 blocks — which, at ten minutes each, should take exactly two weeks. After each batch the network compares how long those 2016 blocks actually took against that two-week ideal, then resets the mining difficulty in proportion. If the batch arrived in one week, miners were going twice as fast as intended, so the puzzle doubles in difficulty. If it dragged out to four weeks, difficulty is halved. Everyone runs the same arithmetic independently and arrives at the same new target — no committee, no vote.

every 2016 blocks:
  actual_time   = timestamp(last) - timestamp(first)
  expected_time = 2016 * 10 minutes   (= 2 weeks)

  new_target = old_target * (actual_time / expected_time)

  # blocks came too FAST -> actual < expected -> target shrinks -> harder
  # blocks came too SLOW -> actual > expected -> target grows   -> easier
The retargeting rule. Each adjustment is also capped, so difficulty can move at most 4x up or down in one step.

The reward, and the halving

Why would anyone burn electricity to win this race? Because the winner gets paid. The miner who finds a valid block may add one special transaction, the coinbase, that mints brand-new bitcoin out of thin air and pays it to themselves. That freshly minted amount is the block subsidy, and it is how every bitcoin in existence first entered the world.

Here is the famous twist. The subsidy is not fixed — it is cut in half every 210,000 blocks, an event called the halving. At ten minutes a block, 210,000 blocks take roughly four years. It started at 50 bitcoin per block in 2009, dropped to 25, then 12.5, then 6.25, and so on down the ladder. Because the schedule is fixed and the cuts are geometric, the total that will ever exist converges to a hard ceiling of just under 21 million coins, reached around the year 2140.

halving every 210,000 blocks  (~4 years)

  2009  block subsidy = 50.0  BTC
  2012                = 25.0
  2016                = 12.5
  2020                =  6.25
  2024                =  3.125
  ...                  -> 0, around year 2140

  sum of all subsidies -> ~21,000,000 BTC  (a hard cap)
The subsidy halves on a fixed schedule, so total supply approaches a fixed ceiling and stops growing.

From subsidy to fees: the security budget

A miner's full reward is actually two parts added together: the block subsidy plus the transaction fees of everything packed into the block. Users attach a small fee to each transaction to compete for limited block space, and the winning miner collects them all alongside the freshly minted coins. Today the subsidy is by far the larger slice — but every halving shrinks it, and one day it reaches zero.

Together these two sources form the network's security budget — the total prize miners chase, and therefore the amount of real-world effort guarding the chain. The deep design bet is a handoff: as the subsidy fades toward zero across the coming century, fees are meant to grow into the main reward, keeping the prize large enough that honest mining stays worthwhile and rewriting history stays absurdly expensive.

All this rhythm and reward runs on real electricity, which is the literal cost that makes Bitcoin expensive to attack. With the clock and the halving clear, a later guide opens up that fixed 21-million ceiling itself — what makes it credible, and why nobody can quietly mint a coin past it.