What is the ‘Halving’? A Primer to Bitcoin’s Big Mining Change


Of all the rules in bitcoin’s code, few are as revered as the hard limit of bitcoin production.

The code dictates that 21 million coins will be released over the course of bitcoin’s lifecycle. By limiting the total amount of bitcoins that could be created, Satoshi Nakamoto was able to establish a defined amount of available data, a revolutionary accomplishment in and of itself.

The limited production of bitcoins was, in a way, aimed at counteracting the endless printing of paper currencies.

Nakamoto compared it to the discovery and mining of gold in the original Bitcoin white paper, writing:

“By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them. The steady addition of a constant of amount of new coins is analogous to gold miners expending resources to add gold to circulation. In our case, it is CPU time and electricity that is expended.”

But in the actual code, there is actually no “constant of amount of new coin.”

Instead, there are rules in place that dictate how much bitcoin will be released and when and how that supply is reduced overtime, ultimately leading to a time during which there will be no new bitcoins released.

Each time a new block is added to the bitcoin network, freshly minted bitcoins are rewarded to whichever miner discovered the valid block. This reward, initially set to 50 BTC, fell to 25 BTC in late 2012. Sometime next month, this number is expected to fall to 12.5 BTC. This event is known as a “halving”.

Bitcoin halving in the code


According to the Bitcoin Core Client, main.cpp, the initial nSubsidy was 50 * COIN, which is the constant 100 million satoshis.

In the code, there is a line that says:

Consensus.nSubsidyHalvingInterval = 210000;

This dictates that every 210,000 blocks, the amount of new coin released should suddenly cut in half. As the code runs, it continues to calculate how many blocks have been solved. When the number hits 210,000, the first halving event takes place.

When the 210,000th block was hit, the number of bitcoin released was 50 * COIN divided by 2, which is 2.5 billion satoshi or 25 bitcoin.

On line 1574, the code specifies how the maximum number of bitcoin is reached. It says:

If (halvings >= 64)
return 0;

This means that once there have been 64 halvings, there should be no further nSubsidy released. In other words, after 50 has been divided 64 times, the last bitcoin will have been released into the market and the total 21 million supply will be in circulation.

Unlike with other perceived deflationary assets, it is crystal clear in the code that there will be a maximum number of bitcoin – and it is through this halving process that this state of affairs is achieved.

Related posts

Leave a Comment