Clara Shikhelman and i went through the maths of the 2013 research paper “Majority is not enough”. Selfish mining is often ill-understood, and the paper goes quickly over some of the calculations. So i figured it would be helpful to post an explanation of the math so others (as well as my future self!) don’t have to figure it out from scratch again.The Selfish Mining strategy
A selfish miner aims to contribute more blocks to the main chain than would be expected based on its share of the network’s total hashrate. To achieve this it will attempt to cause more stale blocks to its competition than to itself, by only opportunistically revealing the blocks it mines. Past a certain threshold of network hashrate controlled, this strategy will bring more revenue to a miner than always publishing its blocks as soon as they are found.How low this threshold is depends on another parameter than its share of the network hashrate. This is the ability of the selfish miner to learn about a block found by another miner before all other miners, and to reach them before the other miner’s block does. This ability allows a selfish miner to get some portion of the rest of miners to mine on its own block rather than a competing one in the event of a 1-block race. The higher this ability, the lower the hashrate threshold at which selfish mining becomes profitable.However this ability is not a requirement for selfish mining to be profitable. Without it selfish mining becomes profitable for a miner controlling more than 1/3 of the network hashrate. In this post, we will only analyse this “worst case” scenario, that is all other miners will mine on top of the competing block and not the selfish miner’s in the event of a 1-block race.The selfish mining strategy (section 3.2 of the paper) is the following:
- Upon finding a block:
- If we are in a 1-block race with the public chain, publish the conflicting block along with the newfound block;
- Else do not publish the block, start mining on top of it.
- Upon another miner finding a block:
- If we do not have any unpublished block, switch to mining on top of it;
- Else if we have a single conflicting unpublished block, publish it and keep mining on top of our own block;
- Else if we have two conflicting unpublished blocks, publish them both and keep mining on top of them;
- Else (we have a conflicting chain of more than two blocks), publish our oldest block and keep mining on top of our private chain.
pull down to refresh
related posts