# Gravity

# Gravity

### By LaurentMT

### Posted August 27, 2018

**This is post 1 of 3 in a series**

*â€śLaw I: Every UTXO persists in its state, except insofar as it is compelled to change its state by force impressed.â€ťâ€Šâ€”â€ŠIsaac Newton, Principia 2.0*

Newton diffracting an UTXO with payment batching

In the last years, a lot has been written about the â€śhuge waste of energyâ€ť resulting from Bitcoinâ€™s Proof of Work (PoW). In this series of four posts, weâ€™re going to challenge this widespread opinion by questioning the main metrics used to highlight the alleged increasing inefficiency of Bitcoinâ€™s PoW.

In this first part, weâ€™ll first discuss the main utility of PoW in the Bitcoin protocol. Then, after a reminder of two important properties of Bitcoinâ€™s PoW, weâ€™ll define a mathematical formalization of this utility (Bitcoin.Days Secured) and weâ€™ll use it to define two new metrics (Unit Cost and Average Cost). At last, weâ€™ll check what these metrics can teach us about the evolution of the efficiency of Bitcoinâ€™s PoW over time.

## Prologue: The Cryptopocalypse is coming

The news was on all the media a few months ago. The cryptopocalypse is coming. Bitcoinâ€™s Proof of Work (PoW) is so bad that itâ€™s going to destroy the world in 2020â€¦

Pot pourri

Reading a bit further, you may have noticed that most of these articles were based on the results of an analysis provided by Alex De Vries, a â€śfinancial economist and blockchain specialistâ€ť working for PWC Netherlands and author of the site Digiconomist.

I must confess that I have mixed feelings about this study. My issue with De Vriesâ€™s work isnâ€™t the estimated electricity consumption (this part has already received its â€śfair shareâ€ť of criticisms) but the repeated use of a specific metrics: **the electricity consumption per transaction**. Donâ€™t get me wrong. In terms of communication, this metrics is pure genius especially for those eager to make a point against Bitcoinâ€™s PoW. The figure seems so outrageously disproportionate that it prevents any further discussion. The problem is that this metrics is fundamentally wrong. For several reasons.

First, it mistakes the number of transactions with the number of payments. But letâ€™s be fair, that doesnâ€™t radically change the actual figure. So letâ€™s forget about that.

The second issue is that the figure is often published without specifying that thereâ€™s no correlation between the electricity consumed and the number of transactions; or to put it differently itâ€™s almost never acknowledged that the electricity consumed is a fixed cost with regards to the number of transactions (and not a variable cost). With technical solutions like payment channels or the Lightning Network, itâ€™s obvious that we can radically decrease the value of this metrics as low as we want. That highlights 2 points: the metrics is easily â€śabusableâ€ť and it doesnâ€™t tell us anything about future performances of Bitcoinâ€™s PoW.

The last problem with this metrics is that it promotes a flawed understanding of the utility of Bitcoinâ€™s PoW. Itâ€™s no surprise that it has gained a lot of traction in a period of â€śBlockchain, not Bitcoinâ€ť frenzy but we should make our best to promote rational thinking instead of an endless squabbling based on emotional reactions.

So. Arrived at this point, weâ€™re facing the obvious questionâ€¦

## What is the utility of Bitcoinâ€™s PoW ?

### The â€śGold Miningâ€ť theory

A first theory is that the main utility of the PoW algorithm is the issuance of new coins. Paul Sztorc has written a good post on the subject. This theory is seducing because it seems consistent with the widespread metaphor of gold mining used for explaining the mechanism.

I have sympathy for this theory and I think that it captures an important aspect of the protocol but for this series of articles, Iâ€™m not going to consider the issuance of new coins as the main function of the PoW algorithm. To support this choice, Iâ€™ll refer to this observation: while itâ€™s expected that the emission of new coins stops around 2140, itâ€™s not planned that Bitcoin mining stops at the same date. That suggests that PoW plays another important role in Bitcoin.

### The â€śSection IVâ€ť theory

A second theory is that the answer to our question was given 10 years ago by the creator of Bitcoin. In the fourth section of the White Paper to be more specific.

Section 4

Iâ€™m going to summarize this theory with the following sentence

The main utility of Bitcoinâ€™s PoW is to secure an economic history.(1)

This is all well and good but in its current form this assertion isnâ€™t very useful. A mathematical model would be far better. That raises a new question: how to express the â€śsecurity of an economic historyâ€ť as a mathematical equation ?

## Digital Gravity

From the previous definition, we can state that our model should be able to express:

- economic values secured by the system (ideally, it should be able to do that atomically or in aggregate),
- the security provided to these economic values (or at least a good proxy metrics).

Since thereâ€™s no such thing as a â€ścoinâ€ť in the Bitcoin protocol, our model will use the concept of Unspent Transaction Output (UTXO) as the elementary object of value.We can then easily define the total economic value secured by the system by adding the economic values of all the UTXOs existing at a given moment (UTXO set). Good. We already know how to express economic values in our model.

Now we need to express security. Obviously, PoW is going to play an important role here. Thus, it seems important to recall two of its properties

Proof of Work is Global and Cumulative

In a sense, PoW is similar to Gravity (to a homogeneous gravitational field to be more specific) which has a simultaneous influence over all bodies in its field, with a cumulative effect on their individual speed.

In the case of Bitcoin:

- when a new block is mined, the security provided by its PoW is simultaneously and equally applied to all the existing UTXOs,
- an UTXO â€śaccumulatesâ€ť the PoWs associated to all the blocks mined since its creation. All others things being equal, the more hashes accumulated, the more secure the UTXO.

These two properties are fundamental for studying the economics of Bitcoinâ€™s PoW. Sadly, theyâ€™re totally missing in the metrics used by De Vries.

## Letâ€™s make a few assumptions

Before going further, letâ€™s make a few assumptions:

- A1: For the last 9 years, Bitcoin has been the most secure public blockchain in terms of PoW.
- A2: At any given point in time, all existing and significant computing power usable for Bitcoin mining was used to mine Bitcoin.
- A3: The marginal cost and revenue of Bitcoin mining are equal.
- A4: Fees paid to miners are negligible when compared to block rewards and they can be ignored.

While these assumptions are likely to be more or less inaccurate in the real world, they seem good enough for this preliminary investigation.

Ok. Now, letâ€™s try to translate this idea of the â€śsecurity of an economic historyâ€ť into a mathematical model.

## Number of â€śBitcoin.Hashes Securedâ€ť by an UTXO

Our first attempt will be straightforward. Basically, weâ€™re going to multiply the value of the UTXO by the number of hashes it has â€śaccumulatedâ€ť between its creation and a given block.

While simple, this definition captures the intuition that the system provides more utility when an UTXO has â€śaccumulatedâ€ť more hashes and/or when its value is higher.

That being said, this model isnâ€™t really satisfying because the number of accumulated hashes isnâ€™t a very good proxy for measuring the security of an UTXO. The main reason is that the quantity of computing power dedicated to Bitcoin mining has greatly increased over the years. Thus, the computation of a PoW securing an old block may have required 10 minutes in 2009 but it will be computed in a fraction of that duration when done with modern ASICs.

Satoshiâ€™s Wall (number of seconds required to compute the PoW of a past block with 100% of the average computing power used during the period between 2 difficulty adjustments)

It seems clear that we need a better model taking into account this fact.

## Number of â€śBitcoin.Days Securedâ€ť by an UTXO

First, weâ€™re going to add a new item to our list of assumptions

- A5: On large enough periods of time, the average amount of computing power dedicated to Bitcoin mining monotonically increases.

Once again, we canâ€™t assert that this assumption is always true or will always be true. Anyway, it has been almost always true in the past, so letâ€™s go with this hypothesis.

We can now define the security of an UTXO at a given block B as the number of days that would be required to rewrite the history since the creation of the UTXO, with 100% of the computing power used to mine block B.

For an individual UTXO that give us the following equation

and the following equation for the UTXO set

You may wonder why this choice of â€ś100% of computing power used to mine block Bâ€ť. Itâ€™s simple. Under our current assumptions, we can consider this definition as a kind of worst case scenario (â€śHow long would this UTXO remain secure if all the available computing power was used to rewrite the history ?â€ť). Moreover, while an alternative scenario (50%, 200%, N%) would change the absolute values of our results, it wouldnâ€™t change the overall evolution of the metrics over time.

## Bitcoinâ€™s PoW efficiency

All Right. Now that we have a model for the utility provided by Bitcoinâ€™s PoW, letâ€™s check what we can learn about its efficiency. For this, weâ€™re going to define two metrics.

### Unit Cost of a Bitcoin.Day Secured added by a given block

For this first metrics, weâ€™re going to divide the reward associated to the block (c.f. assumption A3 about the margin costs and revenues of mining) by the number of bitcoins.days secured added to the existing UTXOs by the block.

It gives us the following equation

By definition, the sum of the values of all the existing UTXOs is the number of existing bitcoins and is equal to the sum of all past block rewards:

Thus our equation can be rewritten as

and finally simplified as

There are a few observations to be made here.

First, the Unit Cost is expressed by default in bitcoins/bitcoin.day secured but we would obtain the same result if we expressed it in USD/USD.day secured (both the numerator and denominator of our equation express the value of bitcoins at the same instant).

More importantly, itâ€™s worth noting that the **Unit Cost doesnâ€™t depend on external factors** like the market price or the number of hashes computed.

The Unit Cost only depends on the rules defining the controlled supply of the currency.It is defined by design.

Letâ€™s check the chart associated to this metrics

I guess that many people will be surprised by this chart but we can clearly observe that **the** **Unit Cost is monotonically decreasing over time. This result can be explained by the joint influence of the deflationary model of Bitcoin**(halving of rewards) **and the temporary inflation caused by the creation of new coins**. The situation should change when all bitcoins have been created. At this point, external factors will play a role on the evolution of the Unit Cost but itâ€™s hard (if not impossible) to predict how things will evolve. Letâ€™s note that the situation may also change before this date if/when fees become an important part of the mining incentive .

### Average Cost of the Bitcoins.Days Secured added up to a given block

For this second metrics, weâ€™re going to add all the costs expended on mining from the first block to the block of interest. Then, weâ€™re going to divide this total cost by the sum of all the bitcoins.days secured created by these blocks.

Note that weâ€™ll express all costs and UTXO amounts in USD because we need to deal with the value of UTXOs at different periods of time.

That gives us the following equation

which can be rewritten as

and finally simplified as

That gives us this chart

As it was the case with the Unit Cost, **the Average Cost suggests that Bitcoinâ€™s PoW is indeed becoming more efficient over time**. This result might seem counter intuitive because of the apparent increasing absolute cost of Bitcoinâ€™s PoW but it starts to make sense when we realize that **this increasing cost is counterbalanced by the increasing total value secured by the system**.

## Conclusion

In this first part, we have discussed why the average cost per transaction isnâ€™t an adequate metrics for measuring the efficiency of Bitcoinâ€™s PoW and why this **efficiency should be defined in terms of the security of an economic history**.

Based on this observation and two important properties of Bitcoinâ€™s PoW (**its global and cumulative effects**) weâ€™ve formalized the utility of PoW with a very simple mathematical formula defining the total number of bitcoin.days secured by the system.

**At last, we have derived two metrics which both suggest that contrary to a widespread opinion,** **Bitcoinâ€™s PoW is actually becoming more and more efficient**.

In the next part of this series, weâ€™ll discuss a new metrics highlighting how the efficiency of the system has evolved under the influence of mining and hodling behaviors.

## Acknowledgments

I wish to thank @Beetcoin, Pierre P. and Stephane for theirs precious feedback and their patience. :)

A great thank you to @SamouraiWallet and TDevD for theirs feedback and their unfailing support of OXT.

**Notes**

*(1) See Kocherlakotaâ€™s theory of â€śmoney [being] equivalent to a primitive form of memoryâ€ť (R. Kocherlakota,* *Money is memory* *, 1996, Federal Reserve Bank of Minneapolis) and Luther & Olsonâ€™s paper* *Bitcoin is memory* *(2014)*