Selfish mining: Do not pull the blanket over yourself

Photo - Selfish mining: Do not pull the blanket over yourself
With its open nature, PoW blockchains allow anyone to join a pool as long as they follow the security protocol. But do all miners play fair?
Proof-of-Work mining is energy intensive and imposes high costs. Single miners have to combine their computational resources into pools.
Users pay transaction fees, which serve as a direct financial incentive for miners. Mining fees are calculated for each block and distributed among blockchain nodes.
A validator that mines a new block verifies a transaction and adds it to the blockchain. It then receives commission and splits it among the other nodes based on their performance.
Regrettably, not all miners play fair. Some prefer to pull the blanket (rewards) over themselves. This mining strategy is called selfish mining.

Selfish mining mechanisms

PoW has one critical vulnerability that developers usually prefer to veil, but unscrupulous miners can successfully exploit: multiple blocks have a chance of being confirmed at the same time. More than two blocks in close succession is a rare occurrence, but it's not uncommon to find two blocks waiting for confirmation at the same time.

What happens in this case?

If both blocks are created at once and linked to the same last block, the blockchain will split into two separate branches. This process is called "sprouting". Network branches complicate its architecture and slows down transactions.
So there is a rule: when a node validates a block, it must convey this information to other nodes, so that the blocks do not conflict with each other. 

However, selfish miners keep this information secret from the rest of the participants. In doing so, they mislead the "honest" nodes who keep adding new blocks and force them to unintentionally split the blockchain.

Let's imagine that block 1001 has just got mined by a selfish miner who didn’t inform other nodes of this. The other miners, being unaware of the update, continue adding new blocks from block 1000 onward. As a result, we have two blocks linked to block 1000: one block of the selfish miner, and the other block of the honest validator. And both have the same sequence number – 1001. The blockchain now splits in two.

The selfish miner keeps mining and adding new blocks to his private chain, which continues to grow in length. Once it gains a sufficient advantage in blocks added, it informs the other nodes about block 1001. The blockchain immediately recognizes that the selfish miner's block was found first, and defines its chain as valid, thereby invalidating blocks added by honest nodes.
As a result, honest pool members waste resources for mining alternative blocks and receive no rewards. And selfish miners claim all of the fees attached to the transactions, as their chain becomes the main public chain. 

High rewards encourage other validators in the network to join the selfish pool. It continues to expand and increase its power.

Dangers of selfish mining

The computing power of each node is called "hash rate". A higher hash rate increases the probability of mining a block. Hence, if a selfish pool continues to grow with new members, it may gain control over the blockchain. 

PoW blockchain requires the majority of nodes to be honest. But if 51% of the total hash rate belongs to a selfish mining pool, it may simply ignore transactions with negligible fees, thereby denying validation to many legitimate transactions. A mining pool that captures more than 50% of the hash rate can decide which transactions to include in the next block. This leads to centralization and violates the basic principle of blockchain – no central authority.

However, this is an unlikely outcome. Any fraudulent activity within the network, if detected, will lead to a sharp drop in coin value. Yet, short-term selfish mining is often used to earn higher rewards.