What is selfish mining?

selfish cryptocurrency miningThe Proof-of-Work (POW) miner reward system, like any system, has its advantages and disadvantages. The main disadvantage of POW is the possibility of a 51% attack, i.e. anyone who gets more than 50% of the power of the network will be able to take full control of this blockchain. This is the most well-known and critical POW consensus vulnerability, but there are other less critical vulnerabilities. We will talk about one of these vulnerabilities called selfish mining in this article.

In the beginning, a little theory about cryptocurrency mining.

As an example, let's take the most famous Bitcoin cryptocurrency blockchain, where the main characteristic for our analysis is the block time.

Block time is a mathematically defined amount of time for new data to be written to the blockchain. In our case, for Bitcoin, the block time is set to 10 minutes. In other words, the difficulty of block search is automatically adjusted to the number of miners in the network so that the block search time tends to the 10 minutes specified in the program.

For a better understanding of the cryptocurrency mining process, we recommend that you read the following material: What does a computer do when mining cryptocurrencies in simple words

The process of searching for the next block to write it to the blockchain, although striving for the specified 10 minutes, can be either less or more than 10 minutes with a large time spread. Those. block search time can be less than a minute, and can be 1 hour or more. It all depends on the luck factor in finding the number of Nonce that satisfies the current conditions of the blockchain network. But over a long period of time, on average, each block appears once every 10 minutes

That's it on this feature of POW mining, i.e. on random deviations in the time of finding new blocks, the Selfish Mining attack is based.

 

What is Selfish Mining?

By default, each miner, when a new block is found, transmits its data to the network instantly, so that other network participants would reset their tasks and start looking for a new block with new data (the hash sum of the last found block). If a conditional miner finds a block due to luck in 1 minute instead of 10 minutes, instead of writing this block to the blockchain, i.e. notify all miners about finding a new block, hides information about the found block from other network members. In this case, while other participants continue to search for a block, let's conditionally call it number 100, our selfish miner is already looking for 101 blocks, because. only he knows the hash sum of the previous block 100, which he needs for mathematical calculations when looking for the Nonce number.

Thus, a selfish miner can delay the issuance of data on the found block to the blockchain network for several minutes, thereby giving himself a head start in finding the next block for these very few minutes. While other participants will start working on finding a new block from the very beginning, our dishonest miner can already do half the work to find the next block, which greatly increases the chance that the next block will find it.

It should be borne in mind here that the longer the delay in issuing the found block to the network, the greater the chance that this block will be found by another miner and written to the blockchain before the attacker. Thus, the attacker will lose not only the reward for the already found block, but all the work of the miner will be useless, because. the block of another miner will have a completely different hash amount.

Only a pool can implement a Selfish attack on Bitcoin now. Bitcoin mining now involves hundreds of thousands if not millions of ASIC miners. To effectively use selfish mining, the power of the attacker must be at the level of the power of other network participants, so that he could realize his advantage in a few minutes in relation to other miners. If Selfish mining uses a small miner with a calculated block search once a day or more, then the earned head start of several minutes due to selfish mining will not matter much to him.

If we assume that all network participants will use the opportunity of selfish mining, then as a result the average block time will increase, which will lead to a decrease in mining income, which will naturally not be beneficial in the long run for all participants. Therefore, it can be assumed that such a scenario has a minimal chance of being realized.

Another negative scenario for selfish mining to be used by all miners in the network is greater centralization and a higher risk of one of the power pools getting 51% by washing out smaller pools that will lose the most in this situation. Because Initially, small pools have an estimated block time of several hours or even days, and reducing this time by several minutes due to selfish mining will not give any effect. What can not be said about large pools with a share in the total hashrate of 20 or 30%.

Each user can contribute to reduce the negative effect of selfish mining and connect their mining equipment to a proven mining pool that values ​​​​its reputation. One of these pools is Binance Pool, which belongs to a well-known crypto exchange and is integrated into the company's general service for the most convenient use.

Selfish mining can be applied not only to the Bitcoin blockchain network, but also to all other POW cryptocurrencies, for example, Ethereum, which has a block time of 13 seconds.

Conclusion: Sellfish mining cannot be called a full-fledged threat to POW mining. Rather, it is an exploit that unscrupulous pool owners can use to show higher rates in finding blocks to attract clients in the short term. The less popular the cryptocurrency, the more it is subject to the Selfish Mining attack.