Education • 6 min read
By Christian Trummer
05.04.2024
Welcome back to part 3 of our Halve Time series.
You can read Eric’s intro post here, and Paul’s look at the economics of the Halving here if you haven’t already. If this is the first piece you’ve clicked on then the basic idea is that we are writing a series of articles that celebrate and explore the Halving.
We all became interested in crypto for different reasons, we all brought different skills and passions, and the Halving is a good moment to celebrate that. At its core, the Halving is about the mechanics of a beautiful way to control supply, and a time to look at how that technology has evolved. But this isn’t just a technical event, it's a celebration of Bitcoin's enduring design and its journey toward becoming a decentralised cornerstone of the digital economy.
First things first - let’s take a look at the code. Fair warning, we are going to get technical here, but this is one of the foundations not just of the Halving event, but also of the wider crypto world. This is the part of technology that underpins the future, so strap in. It’s also the absolute proof to all critics when they believe that 21 million bitcoin is not a hard limit.
At the heart of the Halving event is a simple yet beautiful piece of code within the Bitcoin protocol. This code dictates that every 210,000 blocks, the reward for mining new blocks is halved.
Here's a snippet of the code responsible:
Breaking this down, the top half of the code works out how many Halvings there have been.
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
This line establishes that the number of blocks needed for a Halving event is fixed at 210,000.Because the intHalving value can only ever be a whole number and is rounded down, that means that the network has to mine 840,000 blocks to trigger the fourth Halving.
The second half of this part of the code deals with rewards.
CAmount nSubsidy = 50 * COIN;
nSubsidy >>= halvings;
return nSubsidy;
This means that block rewards start with a fixed 50 BTC. However, a BTC isn’t a whole solid thing in the code. Each BTC is made up of 100,000,000 smaller pieces, so miners were rewarded with 50 x 100,000,000 ‘pieces’ of BTC. Essentially they are the same value, but when it comes to the code, the difference is important.
If we take the original reward of 5,000,000,000 (50 x 100,000,000) and write it in binary (Stay with me, yes the binary is important) we get
100101010000001011111001000000000
Now it’s time for the really interesting and beautiful part of the code:
nSubsidy >>= halvings;
We’re coming up to the fourth halving, using that number we get:
nSubsidy >>= 4
Or, “shift the numbers 4 places to the right”. This gives us a new binary number:
10010101000000101111100100000
When we take this binary number and convert it back into a number we get 312,500,000. Dividing this by the 100,000,000 BTC ‘pieces’ we get as a reward, we are left with 3.125 BTC. Exactly the number everyone is talking about.
The Halving, although only based on a few lines of code, is crucial to the promise of fixed supply for Bitcoin.
Because there are only 33 digits in total, we know that it is only possible for there to be 33 Halvings. We know what the block height will be, we know we will never pass 21 million BTC in circulation, and we can predict (based on the 10-minute average time to mine a block), with some certainty that we will reach this point in the year 2140.
A few lines of code have managed to recreate the diminishing returns of mining precious metals like gold. I think that’s pretty amazing.
To wrap up this piece, I wanted to look back at one major development we’ve seen in the network since the last Halving and look ahead to the two I think will be the standouts of the next Halving cycle.
The Taproot upgrade, activated on the Bitcoin network in November 2021, was one of the most significant enhancements to the network. Taproot marked a significant step forward, introducing enhancements in privacy, scalability, and efficiency. By enabling more complex conditions for transactions while improving their privacy, Taproot laid the groundwork for a more versatile Bitcoin network which we are still exploring.
One of the most exciting additions was the expansion of capabilities around smart contracts on the Bitcoin network. Smart contracts are self-executing contracts with the terms of the agreement directly written into code. Before Taproot, implementing complex smart contracts on Bitcoin was possible, but clunky and inefficient. Now they are more practical and give another solid potential use case for Bitcoin beyond simple transactions to more complex financial instruments.
Already there’s talk of a Bitcoin Virtual Machine (BitVM) being possible, which would enable the creation of layers on top of the Bitcoin network. This virtual machine would open the door to smart contracts and decentralised applications, allowing it to compete with the offerings of newer blockchains such as Ethereum.
The buzz around rollups suggests they could be the next big thing in enhancing transaction throughput and efficiency. By processing transactions off-chain and settling them on-chain, rollups could significantly reduce congestion and fees, making Bitcoin an even more attractive option for daily transactions. That will help further integrate Bitcoin as a core part of the financial ecosystem and end yet another debate about the ‘value’ it brings to the economy.
The Lightning Network has seen remarkable growth since the last Halving, emerging as a mainstream solution for Bitcoin's scalability challenges. Its primary goal is to facilitate instant, low-cost transactions, making Bitcoin a more practical option for everyday use and small payments, often referred to as microtransactions. The most exciting thing is that it’s already working. Since it was launched, we’ve seen a huge increase in lightning transactions, and I believe we’re seeing the start of more widespread adoption and perhaps to a truly functional money used by millions around the world for a wide variety of transactions…
At its core the Halving is code, but what that code represents is more exciting now than it has ever been. We are at the start of a new surge of interest, at a time of adoption and integration, and at a time of significant technological advancement. I can’t wait to see what the Bitcoin community will make of that future.
Bitpanda GmbH ve grup şirketleri (Bitpanda) Türk Parasının Kıymetini’nin Korunması Hakkında 32 sayılı Karar’ın 2/b maddesine göre Türkiye’de yerleşik sayılan hiçbir kişiye yönelik olarak 6362 sayılı Sermaye Piyasası Kanunu başta olmak üzere Türkiye Cumhuriyeti Devleti mevzuatı hükümleri gereği Türkiye’de faaliyet izni gerektiren hiçbir sermaye piyasası faaliyetine dair hizmet sunmamaktadır. Şayet Bitpanda’nın yabancı sermaye piyasalarında vermiş olduğu hizmetlerden Türkiye’de yerleşik kişilerin faydalandığı tespit edilecek olursa tüm zararları kullanıcıya ait olmak üzere bu hizmetler ivedilikle sona erdirilecektir.
We use cookies to optimise our services. Learn more
The information we collect is used by us as part of our EU-wide activities. Cookie settings
As the name would suggest, some cookies on our website are essential. They are necessary to remember your settings when using Bitpanda, (such as privacy or language settings), to protect the platform from attacks, or simply to stay logged in after you originally log in. You have the option to refuse, block or delete them, but this will significantly affect your experience using the website and not all our services will be available to you.
We use such cookies and similar technologies to collect information as users browse our website to help us better understand how it is used and then improve our services accordingly. It also helps us measure the overall performance of our website. We receive the date that this generates on an aggregated and anonymous basis. Blocking these cookies and tools does not affect the way our services work, but it does make it much harder for us to improve your experience.
These cookies are used to provide you with adverts relevant to Bitpanda. The tools for this are usually provided by third parties. With the help of these cookies and such third parties, we can ensure for example, that you don’t see the same ad more than once and that the advertisements are tailored to your interests. We can also use these technologies to measure the success of our marketing campaigns. Blocking these cookies and similar technologies does not generally affect the way our services work. Please note, however, that while you’ll still see advertisements about Bitpanda on websites, the adverts will no longer be personalised for you.