Bitcoin is a carefully-balanced game of incentives. In a decentralized ecosystem, aligning the interests of participants is vital to the long-term viability of the network. The incentives that drive nodes
to secure the network are mainly financial – in acting honestly, they stand to be rewarded. By attempting to cheat, they miss out on potential revenue.
This is apparent in mining. Parties invest large amounts of capital into electricity and specialized hardware, in the hopes of recouping their investment and turning a profit by adding blocks
to the blockchain. Miners seek to maximize their returns, and the easiest way to do so is by playing by the rules.
If a miner appends a block
to the chain, they receive all of the fees paid on the transactions from their block, as well as a portion of newly-minted coins. We call this the block reward
, and the amount of coins received is halved every 210,000 blocks (roughly every four years). At the time of writing, the reward is worth 12.5 BTC, but will be reduced to 6.25 in a matter of months
The financial incentive to mine has rendered the practice highly competitive, which ultimately boosts the security and decentralization of the network. Some speculate that these incentives can be gamed. In this article, we’ll take a look at the concept of selfish mining.
The most comprehensive exploration of selfish mining can be found in the 2013 paper Majority is not Enough: Bitcoin Mining is Vulnerable
by researchers Ittay Eyal and Emin Gun Sirer. The paper’s thesis is that, contrary to popular belief, the incentives for Bitcoin miners are flawed and may ultimately lead to the centralization of the network.
Let’s demonstrate selfish mining with an example. Suppose that the total hash rate is evenly divided up amongst 4 miners: Alice, Bob, Carol, and Dan (each with 25%). Alice, Bob, and Carol play by the rules, but Dan is trying to exploit the system for his own gain.
Under normal circumstances, we would expect the miner that finds a block to append it to the chain immediately. And this is what Alice, Bob, and Carol do as honest participants. But if Dan finds a block, he withholds it (it’s a valid solution, but it has yet to be added). Dan may get lucky and find two blocks in a row before anyone else.
Let’s suppose that 100,000 blocks have been mined. So now we have Alice, Bob, and Carol attempting to propose the 100,001st block. Dan finds it but keeps this information private. There are now two chains, the public one and Dan’s secret (and longer) one. While the others are still trying to find block 100,001, he finds 100,002.
Dan’s chain is now two blocks ahead. Provided his luck doesn’t run out and he is always able to remain ahead of the other chain with this distance, he keeps going. When the others catch up so that they’re only one block behind, he unveils his chain.
Dan’s now-public chain is longer
than the one the other participants were working on. According to a rule that we call the longest chain rule
, the “correct” chain to work on is that which has accrued the most Proof-of-Work
(a metric also referred to as chainwork
). So, if a node detects a chain that has more accumulated work, it will switch and dedicate mining power to this longer chain.
Now, Alice, Bob, and Carol see Dan’s chain – they now recognize this one as the chain to follow. Any rewards they would have earned on the other chain will no longer exist. And since Dan has mined those blocks on the current chain, he keeps all of the rewards.
It would indeed be cheaper for all participants to just behave as they’re expected to. Selfish mining creates a great deal of waste, but it’s important to note that those engaging in the practice maintain a strategic advantage over other participants to the network. As a result, the attacker will likely be joined by miners, who will only make matters worse.
In their paper, Eyal and Sirer highlight this as a major risk: over time, selfish mining could lead to mining pools growing in hash rate, as parties will team up with the selfish entities to maximize their revenue. Once a single pool has acquired the majority of the power, it may attempt a 51% attack
Others don’t perceive such conduct to be a threat, citing ideological considerations by miners, as well as an incentive to keep the network operating in a decentralized fashion. Allowing the ecosystem to be corrupted will prevent its miners from recouping their investment into electricity and machinery, or turning a profit.
If selfish mining can be successfully pulled off by a consortium of miners, it may indeed be an attractive strategy for those involved to boost their own revenue. In a worst-case scenario, the incentives will cause honest miners to join the selfish miners, harming Bitcoin’s decentralization.
On the grander scheme, however, it makes little sense for parties to align themselves in this manner. After all, acting to undermine the security of the network may cause the Bitcoin price to drop, which directly impacts the profitability of a mining operation.