Why economic feasibility can lead to the collapse of Bitcoin
The author of the article is Alexey Malanov, an expert in the development of anti-virus technologies at Kaspersky Lab.
Let us discuss what determines the profitability of Bitcoin mining, what principles for adapting the mining speed were incorporated into it initially, and why these principles may ultimately lead to the collapse of this cryptocurrency. ')
We assume that the reader has an idea of the basic mechanisms of the functioning of Bitcoin, such as: blockchain , mining , mining pools, block reward.
A warning. In this article, we explore the theoretical possibility of the development of the described scenario, taking into account the algorithms embedded in Bitcoin. We did not set ourselves the goal to analyze in detail the cost structure of miners, prices for electricity in various parts of the world, bank rates and payback periods of equipment.
51% attack
In the Bitcoin community, the Attack 51% is well known. If the miner controls more than half of all mining capacities, he has the ability to:
Pay your Bitcoins (for goods, services) or simply exchange them for the usual money.
Start generating blocks in which the completed transaction is not included. The generated blocks do not show other miners.
Wait for the goods.
Unveil the block chain generated by him.
Wherein:
All other miners will have to accept the attacker's blockchain version as the only true one, because it is longer, as the miner has more mining power than all other participants combined;
The attacker receives the goods and retains his bitcoins, as in his version of the story he did not spend them;
The attacker receives a reward for all the generated blocks, and not half the blocks that he would have generated if he played fair and built a common chain. Although his income will remain the same until the next recount of complexity;
When attacking, the attacker most likely buys coins of another cryptocurrency for bitcoins, because it is fast, fairly safe and irreversible.
The community agrees that such an attack, be it feasible, would call into question the further functioning of the Bitcoin network.
It is also important to understand that for a successful attack it is not necessary to control 51% or more of the powers. With some probability it is feasible and with a smaller share. For example, possessing 30% of power, an attacker may with the probability of ~ 18% secretly generate a chain of 5 blocks in a row that will be longer than the public one. In this case, the attacker gets the same advantages as with the “Attack 51%”. And in case of failure, he can just try again. Most services accepting payments in Bitcoins require only five “confirmations”, that is, such a generated chain will suffice.
Adapting the complexity of mining
After generating every 2016 blocks, the Bitcoin network adapts the complexity of mining. The norm is considered such complexity, in which the mining of one unit takes an average of 10 minutes. Thus, two weeks should be spent on calculating 2016 blocks. If the generation went away, for example, only one week, then after the next recalculation the complexity will be doubled (thus, the next 2016 units with the same network capacity will have to be generated again 2 weeks later).
Note that the Bitcoin network programmatically prohibits changing the complexity of mining by more than 4 times in one recalculation.
Direct consequences of these rules. If mining capacities are added or turned off somewhere in the middle of the 2016 block period, then:
This does not affect the reward that the remaining miners will receive. The reward is determined by the miner’s hashrate, not its share in the total hash rate. For example, if you turn off half the power, the remaining miners will extract twice as many blocks, but in half the time. Profit will continue.
This directly affects the speed of production. If 99% of miners stop mining, the next recalculation of complexity will occur in about 4 years. And the time of generating one block will be approximately 16 hours.
The authors of Bitcoin assumed that the described algorithm would smoothly adjust the power of the network, displacing the least energy-efficient equipment and returning the margins of the remaining in a reasonable frame. However, in reality, such a rare recalculation of complexity leads to a different miner strategy: they will be able to deceive the algorithm, artificially lowering the network performance. After all, if the equipment is suddenly turned off, the profit for the day remains at the same level, and if it is turned on suddenly, the costs are reduced.
Mining commissions and free will of miners
The miners, in addition to the reward for the block (of the emitted currency), also take away the commission for conducting the transactions included in the block. Now the commission is about 10% of the reward for the unit. We will not dwell on this in detail, however, according to our calculations, it turns out that the existence of commissions makes the mining strategy under study even more profitable.
Another aspect, mining pools often do not directly control the mining capacity in their composition. Each participant and the owner of the equipment is free to choose in which pool to work. Usually the decision to move from pool to pool is made out of economic considerations.
However, the policy of switching on / off capacities and switching capacities to the mining of alternative currency (Bitcoin Cash) is determined by the pool manager. In other words, we believe that the described strategy of behavior should be accepted and implemented only by ~ 20 participants - owners of pools, the equipment owners themselves, although they have “free will”, but do not play a role.
Suppose that the total power of all miners has stabilized, consider one of the strategies to increase margins.
An example of miner behavior with a stable power of the Bitcoin network
For simplicity, let's say that you control half of the total capacity of the Bitcoin network. You can keep your equipment turned on all the time and get a reward of approximately 1008 units (50%).
Or you can do the following:
Wait until the beginning of the next period of 2016 blocks.
Turn off your power.
Wait for the remaining miners for 4 weeks to start 2016 blocks.
After that, the Bitcoin network will twice reduce the complexity of mining for the next period.
You turn on your power, it will allow the entire network to mine 2016 blocks in one week.
In just one week you will receive a reward for the same (approximately) 1008 blocks.
Please note that in the first scenario, for 5 weeks of normal work, you would receive a reward for 5/2 * 1008 = 2520 blocks, but you would pay for electricity all the time. In the second scenario, for the same five weeks, you get a reward for 1008 blocks, but pay for electricity only for one week.
Suppose that the cost of electricity is about 90% of the reward. It is easy to calculate that the profit in the first scenario for five weeks is equivalent to a reward for 2520 * 0.1 = 252 blocks, and in the second scenario “reward - costs” = 1008 - 0.9 * 1008/2 = 554.4. That is, the proposed strategy turns out to be 2 times more profitable.
Cost-effective miner behavior with different parameters
Let be:
Smart miner controls share x of the total network capacity.
For all 2016 blocks, the reward in bitcoins is A .
For the work of all network equipment for two weeks, the cost of electricity and maintenance amount to C . We assume that the rental of premises and the cost of equipment downtime are negligible. For simplicity, we deliberately do not take into account the depreciation of equipment.
Then:
In normal work, the miner's reward is Ax−Cx over a period of two weeks.
If a smart miner turns off its equipment, the network will generate 2016 blocks in time frac1(1−x) more. For example, if x=1/3 it will take one and a half times more time to complete the work.
After the end of the period of adaptation of the complexity of the network and the inclusion of the equipment of a smart miner, the network will perform work in (1−x) times faster than two weeks. For example, if x=1/3 after switching on its equipment, it will take 2/3 of the usual time, approximately 10 days.
The total duration of the two periods will be (frac11−x+1−x)∗(2weeks) ;
Thus, in the usual situation (without shutdowns), the miners, working these two periods, earn Pnormaloperation=(frac11−x+1−x)∗(A−C)=(2+fracx21−x)∗(A−C) That is, all miners receive a little more than two net profits for such an elongated conditional period.
A smart miner working with shutdown will not earn anything in the first period, but in the second, shorter period will receive Psmart=Ax−Cx(1−x)=Ax−Cx+Cx2 That is, a smart miner gets one familiar net profit and additionally saves a share. x from costs.
All non-disabled miners will earn for a slow period. Pslowperiod=A−C , and for the fast period Pfastperiod=A−C(1−x) because the reward is the same, but they work faster.
It is easy to see that:
If the cost of the miner is exactly equal to his reward (the miner works with a zero margin), then a smart approach will allow him to get a net profit of Ax2 .
If the miner works with free electricity (100% margin), then during normal work he will earn more than two profits per period, and during work with downtime - one.
Find out how much equipment x should be turned off to maximize the profit of all miners at a margin M=(A−C)/A :
maxx(Pslowperiod+Pfastperiod−Pnormalwork)=
maxx(A−C+A−C(1−x)ldots−ldots(2+fracx21−x)(A−C))
maxx(M+M+(1−M)xldots−ldots(2+fracx21−x)M)
maxx(frac(x−Mx)(1−x)−Mx21−x)=
maxx(frac−x2−Mx+x1−x)
This expression peaks at x=1−sqrtM . For example, when M=4 smart miners should temporarily turn off 80% of the equipment.
Why miners do not use the described strategy now
Growth of power Bitcoin network.Over the year, the network capacity has increased by more than 4 times ( Source ) The increasing complexity of the Bitcoin network for all time.Since January 2016, the complexity has grown 8 times, as well as the cost of Bitcoin ( Source )
The described strategy makes sense only if the overall complexity of the network is not growing. Otherwise, turning off the equipment does not lead to a decrease in complexity and is economically unprofitable.
So far, mining capacities have been increasing at a rapid pace; This is a consequence of the growth rate of Bitcoin. Miner’s profit is calculated in bitcoins, and costs are borne in traditional currency. The growth rate of bitcoin ( Source )
However, it is reasonable to assume that if bitcoin does not increase infinitely in price, then sooner or later it will be economically impractical to introduce new mining facilities, and the cost of electricity will be almost equal to the reward.
What threatens the shutdown of mining capacities
When the commissioning of new mining capacities is stopped, miners will be able to apply the strategy described above. Bitcoin capacity distribution by pool ( Source)
If mining pools maximize their own benefit, then with a margin of 6.25%, we should expect shutdown of up to 75% of capacity. It makes no sense to turn off the equipment, because the network will not reduce the complexity more than 4 times.
After that, to conduct the “51% Attack”, the attacker must either control more than half of the remaining power (which is easily accomplished with the current distribution of capacities), or suddenly turn on more equipment than worked before (which is not yet feasible given the share of the largest pool).
The question arises, is it profitable to attack a network to a person who has invested heavily in building up mining capacity? Yes, profitable. Provided the mining margin is low, the cost of the existing mining equipment is also reduced. In other words, if mining does not bring profit, it remains unprofitable to remain honest. In addition, an attacker may remain anonymous, and, among other things, play to lower the price of bitcoin.
Bitcoin Cash Attack
We deliberately do not consider a situation in which the cost of electricity will quickly and significantly increase, or, more likely, the cost of bitcoins will quickly and significantly fall. In this case, the miner strategy is fairly obvious. With sharp adverse price fluctuations, all 100% miners will turn off the equipment. Only those who use free electricity will remain afloat. In this case, the work of the network will simply stop - it will take time, commensurate with life, to finalize the “two weeks”, and the impossibility of conducting transactions will lower the price of bitcoin even more.
Literally the other day in BitcoinMagazine, our colleague analyzed the situation with the currency Bitcoin Cash, which appeared as a result of the Bitcoin network split on August 1, 2017. The new currency has the principle of Emergency Difficulty Adjustment. EDA makes it possible to adapt the complexity in the Bitcoin Cash network more often, namely: if less than 6 blocks were formed in 12 hours, the complexity is reduced by 20%. The author comes to conclusions similar to ours, but, more importantly, he notes that he is already observing the manipulations of smart miners. He fears the destabilization of the Bitcoin Cash network and expects developers to intervene soon.
Conclusion
We analyzed one of the economically viable strategies for the behavior of honest miners in conditions when the power of the Bitcoin network stops growing. They calculated some key parameters of such a strategy and found that following it is beneficial for each participant individually, but significantly increases the risks of the 51% Attack and potentially the collapse of the Bitcoin system as a whole.
If all the miners were able to securely agree, they could go further: conditionally turn off all the equipment, except for one device. This would be optimal in terms of profits, but fatal in terms of network security.
How should miners act to guarantee safety? We see a couple of analogies here. The first is the crisis of overproduction, when it happens, manufacturers agree and publicly destroy part of the goods (at least this was the case in the Middle Ages). The second is nuclear disarmament, the countries possessing large arsenals agree on their proportional reduction.
In an ideal world, all miners should agree on turning off some of their equipment and, most importantly, on its controlled destruction. It is important not only to systematically destroy, but also strictly control its production.
Count on such a "peaceful" result is not necessary. The recent division of the Bitcoin chain into two and the formation of Bitcoin Cash shows that miners are not always able and willing to solve common problems together. Perhaps in the future, the capacity for cooperation will be the deciding factor. Time will tell how our theoretical study fits in with practice.