

Date Mon 04 July 2016 Modified Wed 06 July 2016 By Neil Fincham Category Bitcoin, Halving Tags Bitcoin / Halving

CAmount GetBlockSubsidy ( int nHeight , const Consensus :: Params & consensusParams ) { int halvings = nHeight / consensusParams . nSubsidyHalvingInterval ; // Force block reward to zero when right shift is undefined. if ( halvings >= 64 ) return 0 ; CAmount nSubsidy = 50 * COIN ; // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years. nSubsidy >>= halvings ; return nSubsidy ; }

Simple right?

In just a few days we will have the second bitcoin halving event. Often in bitcoin we forget that not everyone is elbow deep in code all day, not everyone has been 'with us' for years and while we may talk about things like 'The Halving' we probably don't do the best job at explaining exactly what it is, why it is, what happened last time and what might happen this time.

What is it? For completeness, I will add the following line of code to the ones above;- consensus . nSubsidyHalvingInterval = 210000 ; What this code does is get the block subsidy (in bitcoins). The subsidy started out at 50 BTC (50 * COIN, where the coin is 100,000,000 satoshis) and halves that amount every 210,000 blocks (the consensus.nSubsidyHalvingInterval bit). This subsidy is claimed by the miners of that particular block (plus a small amount of transaction fees) as payment for their work securing the bitcoin network. They use it to pay their bills (mostly electricity and updating hardware) and what is left over is their profit. Since every block takes somewhere about 10 minutes because of the Poisson Process it works out to take approximately 4 years for those 210,000 blocks to be generated, after which, the block subsidy halves. In reality, because the total hash rate has been increasing so quickly since Satoshi mined block 0 as more and more miners have come online with better and even more specialised hardware the blocks have been found in less than 10 minutes on average but for the purpose of this article, we are just going to call them 10-minute blocks and 4 years between halvings. So, the subsidy started at 50 BTC on January 3rd, 2009, dropping to 25 BTC on November 28th, 2012 and it is about to drop to 12.5 BTC in a few days. The intention is that as the subsidy decreases the fees will take over paying the miners to secure the network. This pattern will continue from now until the 64th halving ( if (halvings >= 64) return 0; ) but in practical terms it means that by 2140 there will be no block subsidy at all and the subsidy will (probably ) be totally trivial well before that. Miners will, well before 2140, be relying totally on transaction fees (and that time is coming soon) in order to pay the bills and secure the bitcoin network. Below is a table that lays it out from the beginning until 2024 so you can get a feel for the progression. Block Year (Approx) BTC/block Start BTC BTC Added End BTC BTC Increase End BTC % of Limit 0 2009 50 0 10,500,000 10,500,000 infinite 50% 210000 2012 25 10,500,000 5,250,000 15,750,000 50% 75% 420000 2016 12.5 15,750,000 2,625,000 18,375,000 16.67% 87.5% 630000 2020 6.25 18,375,000 1,312,500 19,687,500 7.142857% 93.75% 840000 2024 3.125 19,687,500 656,250 20,343,750 3.33333333% 96.875% Rough numbers only, 2016 where we are now in bold. Check out the bitcoin wiki for the full progression.

Why do we do it? Right, now the semi-technical stuff is out of the way the obvious question is why do we do this? The answer is a bit philosophical (sorry) but it is one of the core tenants of bitcoin, controlled supply. Unlike the fiat currency's that we are all used to (USD, GBP, Euro, NZD etc.) we know exactly how many bitcoins will ever be in existence 20,999,999.9769 . We also know exactly how many have been minted at any particular point in time. This is not actually a new concept, proponents of the Austrian School of Economic Thought have been suggesting such a monetary system since the late 19th century. It separates money from the state similar to how the church was separated from the state in many countries over the past few centuries. It puts the value (or price if you like) directly into the hands of supply and demand and takes it away from any form of governance. No matter how much any authority wants they cannot print more, artificially fix or adjust supply in any way in order to manipulate their own (and others) economies. Supply and demand are kings in bitcoin and since supply is fixed, demand is the only variable and the only way the price of bitcoin is discovered. Because bitcoin cannot be destroyed but can be lost (please backup your wallets now) this also makes bitcoin a deflationary currency and that is a stark point of difference as to what we have now with our traditional fiat currencies. Not everyone agrees that a deflationary currency is a good thing, in fact, most traditional economists subscribe to Keynesian Economics and they most definitely don't see it as a good thing. Satoshi never explained why he chose 21 million as the upper limit nor did he explain why he chose 4 years for each halving (at least not when I was around or have found later apart from some vague references to gold mines). Like a lot of numbers in bitcoin they appear to be just arbitrary, perhaps they have some deeper meaning to him but in reality, the numbers are unimportant, what is important is that they exist and the effect (controlled supply in a predictable manner) that they have.

What happened last time? Not a lot. I wrote a few articles at the time. The block was found on slush's pool by a relatively new user called Laughingbear using a GPU in a standard PC that he normally used to play games. Bitcoin was going for USD $12.17 (at MtGOX) and there was a whopping 13.56295554 BTC of fees in the block (USD $165). The entire block reward was 38.56295554 BTC, at the going rate of the time that was just short of USD $470 (Oh, how things have changed). It was almost a year before we had any serious price movement and it did not seem related to the halving at all. The entire bitcoin market cap was just under USD $128 million compared to just over USD $10 billion today. Speculation with the mainstream media (and more than a few bitcoiners) was that bitcoin would be over, after all, how could mining continue at such a low return? The difficulty did a little dip before the halving but continued to grow, we knew at the time that the next generation cheaper and more efficient miners (ASIC's) were about to become generally available but we were still mining mostly with GPS's and FPGA's. If you had more than a few gigs of mining power you were considered a serious miner. All and all, it was a bit of a non-event.