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)
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.
Bitcoin halving and miners
Miners, as one can imagine, stand to be impacted the most when the next halving event takes place.
In the white paper, Satoshi explains that the addition of bitcoin comes at the expense of CPU time and electricity. Miners have special-purpose pieces of hardware that are constantly running in a bid to discover the next block, using a constant flow of electricity along the way.
They make money when the revenue generated through mining those bitcoins exceeds the cost of running the mine, which in addition to electricity also includes personnel overheard, insurance and any other charges that come along with powering a high-intensity data center.
But with the halving, miners stand to see their revenue fall by a commensurate amount, bringing with it a significant impact on their business.
According to the CoinDesk Bitcoin USD Price Index, the price of bitcoin averaged $577 as of 12PM EST on 10th June. If the 420,000th block were to have been sealed with the market at that price, the amount of revenue denominated in US dollars that a miner could expect to receive would have fallen from $14,425 to $7,212.50 in an instant.
Losing 50% of revenue could result in some bitcoin miners having to shut their operations down. At least one miner has moved to pull the plug ahead of the halving.
However, there has been rigorous debate over how much of a concern the halving will be, given that the event is pre-programmed in the code and miners have likely been preparing for the event. Unlike with gold or another precious metal where a new, big discovery can happen at any time, miners know exactly what to expect and when.
Some argue that miners don't necessarily have to lose 50% of their revenue simply because their income is going to drop by half. As the argument goes, prevailing demand for bitcoins will stay constant, forcing the price higher once fewer bitcoins are being generated on a day-to-day basis.
For example, if miners were selling all 25 of their bitcoins per block to pay their bills, this would be an introduction of 25 new bitcoin into the market roughly every ten minutes (though this can fluctuate depending on network variance).
If the price were to stay constant at $577 even with these new bitcoins being added, that means there is $14,425 of available demand for every given block.
If the number of available bitcoin released every ten minutes were to fall by half to 12.5 BTC, the price of bitcoin will have to increase to make up for the $14,425 in available demand. Therefore, just because a miner sees its subsidy drop from 25 bitcoin to 12.5 doesn't mean the revenue in USD will drop as well.
Halving in the Real World
Fortunately, the bitcoin network has been through this situation before, albeit with a much smaller mining presence and less overall market activity.
Bitcoin experienced its first halving event on 28th November, 2012, the subsidy falling from 50 to 25 bitcoins per block.
At the time, the network hashrate was approximately 25,000 GH/s - a far cry from where it is today. A month later, the network hashrate dropped to approximately 20,000GH/s, a 20% drop. By February 2013, however, the hashrate had returned to its previous high and continued to rise from there.
At halving, the price for a bitcoin was approximately $12.25, which meant that miners received approximately $612.50 per sealed block. By February 2013, the price had actually increased to approximately $30. Miners had lost half of their bitcoin subsidy, but the price had increased enough to more than offset this. By April 2013, the price had increased to approximately $181.
But there is a big difference between a hashrate of 25,000GH/s, when the average person could run a bitcoin miner at home, and today, when industrial-grade mining farms in China, Iceland, the northwest US and the Republic of Georgia make up the bulk of mining activity seen today.
Today, the network hashrate stands at 1.4 exahash at the time of this writing. For context, that is 1.4 billion gigahash per second. If July's halving mirrored the last one, the hashrate could drop to approximately 1.12 exahash.
Fortunately, miners can look to litecoin for insight into what might occur at halving.
The hashrate right before Litecoin's halving took place was approximately 1.19 TH/s. On August 25, 2015 Litecoin's halving occurred. Over the next few days, the hashrate dropped from 1.19 TH/s to 1.11 TH/s.
The reality is that the hashrate only dropped by about 80 GH/s, which was only about a 7% drop.
Charlie Lee, Director of Engineering at Coinbase and Litecoin's Satoshi Nakamoto, offered the following theory as to why the hashrate didn't really drop:
"The hashrate dropped a little but then climbed back up pretty quickly to the previous level. That's really unexpected, but I think I have an explanation. I talked to some Chineses miners at Scaling Bitcoin and learned something interesting. Most miners have found electricity for free or close to 0 cost."
Essentially, because the cost of electricity was so low, miners didn't see any reason to shut their hardware down that they had already paid for. In other words, while profit did drop, it was all profit at electricity rates.
With a significant percentage of mining taking place in locations that already provide cheap electricity, the outcome could be similar when the number of new bitcoins introduced falls: the hashrate may drop, but it might not be as significant a drop as it was the first time.
The exact impact on the network - and the price - remains to be seen, and the weeks leading up to the event will likely see no shortage of commentary and speculation as to the outcome.