Friday, February 3

How only 21 million bitcoins could exist: Jameson Lopp explains

How many bitcoins (BTC) will exist at most throughout history? Those who are familiar with the matter know the answer: 21 million. But why? Jameson Lopp, a prominent software developer related to Bitcoin, took on the task of explaining the reason for this figure, which is not expressed within the whitepaper (white paper) of Bitcoin.

To be precise, the exact figure is not 21 million BTC, although it is close enough. In a post of his blog, Lopp details that the total number of satoshis (the smallest unit of bitcoin, which is equivalent to 0.00000001 BTC) that may exist is 2,099,999,997,690,000.

Implicit checks

In the original source code, there is this MAX_MONEY value that defines the maximum Bitcoin to exist, but this value has no direct implications on the bitcoins issued. Fountain:

Lopp details that within the Bitcoin source code there are implicit limitations, which prevent the existence of more than 21 million units of this currency.

First of all, it is necessary to know how BTC is issued through block mining. With every new block mined (which happens every 10 minutes or so) new BTC is added to the network. The amount is limited by halving. These events, approximately every four years (210 thousand blocks), halve the amount of BTC that is issued.

The formula shows how the total halving to occur has a limit of 32 achievements, between which, between each of these, the amount of bitcoins issued will be divided in half. Fountain:

The formula to generate new bitcoins has its implementation within the source code. As Lopp explains, “in 5 lines of code you can determine the maximum amount of bitcoin that will be issued.”

Once 64 halvings are reached, the supply of new Bitcoins will be eliminated: Source:

Although the above formula defines the 32nd halving as the end of bitcoin issuance, according to the bitcoin source code, it seems that this is not the case. The 32nd halving, which will occur in the year 2126, approximately, defines that, from that moment on, the emission of bitcoins will be so small that it will exceed the limit of 8 decimal places, which cannot be expressed within accounting of Bitcoin.

Despite this, the halving they will continue until they reach number 63, which will occur in the year 2260, approximately. This, as the source code itself shows, on line 1072. In other words, there will be no 64th halving.

Control the amount of emissions

Another important point that the Bitcoin protocol has to control the amount of BTC in circulation is the emission verification. The previous formula is maintained, as long as the emission is as expected.

Each reward generated in a mined block must correspond to what is expected according to the halving it is in, currently it would be 6.25 BTC. Fountain:

Since the emission of new bitcoins occurs in each mined block, these are verified to know if it has generated exactly the expected BTC according to the halving. Otherwise, the block will be discarded and marked as invalid. When this occurs, the miner forfeits the block reward.

Another thing that could change the maximum number of bitcoins in existence would be double spending. That is, the same coins can be spent more than once, to make various money transfers.

To prevent this, the network does double-spend verification and this is one of the reasons why Bitcoin exists. If double spending occurs, the network would be unusable, but the very robustness of Bitcoin prevents something like this from happening.

In addition to those mentioned above, there is another important validation that the Bitcoin source code does. Although this may seem logical, it plays a fundamental role. It is about verifying that the outputs (bitcoins sent) of a transaction are equal to or less than the inputs (bitcoins to send), since, if there is some type of inconsistency, BTC could be being issued unexpectedly.

Within the source code, the MoneyRange value establishes that the value in BTC entered is not expressed in negative terms, which if so, is marked as an invalid transaction. Fountain:

Finally, within these validations, there is the avoid what is known as “memory overflows”. These overflows stop the correct operation of the Bitcoin source code, in this case by handling invalid values. To do this, it is verified that the values ​​in a transaction are not negative numbers, which could vary the global accounting of Bitcoin.

Explicit checks

Lopp explains that, although the Bitcoin source code regulates itself so that only 21 million coins come into existence, there are also other ways to verify the amount of BTC in circulation through unspent UTXOS. The programmer calls these forms “explicit checks”.

Within the Bitcoin source code there is a function known as GetTxOutSetInfo that returns the value of all circulating BTC. It does so by accounting for the UTXOs that currently exist, which —according to Lopp— amount to more than 80 million.

To exemplify it, Lopp has made a graph that shows the growth of the amount of BTC circulating live.

The graph shows a clear decline in emissions which corresponds to the halving that occurred in May 2020. Source:

In the graph above you can see how the emission of BTC is constantly on the rise, which confirms the implicit verifications explained by Lopp. According to the website, quoted by the programmer, 18,929,150 BTC have been issued up to the time of writing this note.

Bitcoin, a deflationary asset

Over the years, the scarcity of issued bitcoins can cause a revaluation in its price. Fountain:

According to a graph posted on Jameson Lopp’s blog, Bitcoin inflation will tend to 0, while the amount of new BTC being issued is reduced.

By 2021, the year in which bitcoin reached its historical maximum price of over USD 67,000, the circulating BTC was already around more than 80% of the total 21 million.

On the other hand, although the deflation of bitcoin can affect its price, as has happened with the price of bitcoin after the halving, there are other factors that influence the price such as the levels of adoption and even speculation.

Could there be more than 21 million bitcoins?

The short answer is yes. It is possible that there are more than 21 million bitcoins, but it is not as easy as it seems.

As detailed by Lopp, there is the technical possibility of issuing more bitcoins, but modifications to the code would have to be made.

Keep in mind that Bitcoin is a decentralized protocol, whose modifications depend on the approval of the majority of nodes.

In this sense, issuing more BTC would depend on 2 fundamental values: governance and incentives. The first step to take is convincing the majority of Bitcoin nodes to accept the source code modifications, which will see more than 21 million BTC issued through what is known as a hard fork (or hard fork).

The second part on incentives is perhaps the most difficult to carry out. Since bitcoin is a deflationary asset, which appreciates over time under the principle of scarcity, many people may not be willing to depreciate their accumulated BTC by issuing more coins. This makes achieving this extremely difficult.

In the hypothetical scenario that a “Bitcoin” that would issue more than 21 million coins were created, it would not be a problem anyway. Nodes that wish to can continue to run the original source code (with limited issuance). Thus, the new “Bitcoin” (without limited or modified emission) would be considered by them as another currency, but not the real Bitcoin.