# Stochastic Modelling of Selfish Mining in Proof-of-Work Protocols +
###### Abstract
This cycle may eventually culminate in the selfish miner controlling the majority of the network and thus breaking Bitcoin's incentive compatibility [4]. To illustrate selfish mining in detail, consider block tree (a) of Figure 1, in which a selfish miner, say, [PERSON], controls 20% of the network's hashing power (\(\alpha=0.2\)) and the honest miners collectively control 80% (\((1-\alpha)=0.8\)). We use [PERSON]'s [2] definition of \(\alpha\) as the selfish miner's share of the network's total hashing power. In scenario (a) in Figure 1, [PERSON] mines block 3 on top of block 2, but does not publish it in an attempt to further increase her advantage. Thus, [PERSON] does not know about block 3 so continues to mine on top of block 2. [PERSON] mines the next block, which he immediately broadcasts to the network. Upon the receival of [PERSON]'s newly mined block 4, [PERSON] will publish her privately kept block 3 in an attempt to avoid losing the block reward. At this point, it is a race between [PERSON]'s block and [PERSON]'s block. The next block that is mined decides, whether block 3 or block 4 will be part of the main chain. Another honest miner, say, [PERSON], mines the next block on top of block 4. Consequently, [PERSON] lost the race and wasted her computational resources on a block that without acting selfishly would have, with almost certainty, been part of the main chain. The potential advantage of selfish mining could also come at the risk of losing block revenue for not publishing the block immediately. However, consider scenario (b) in Figure 1, in which a selfish miner, still say [PERSON], controls 40% of the network's hashing power (\(\alpha=0.4\)) and the honest miners collectively control 60% (\((1-\alpha)=0.6\)). With blocks 9 and 10, [PERSON] has managed to build up a lead of two blocks over the public chain. Now [PERSON], an honest miner, finds block 11 and immediately publishes it. Upon receival of block 11, [PERSON] will publish her privately kept two blocks (9 and 10), making it the longest chain and thus the main chain. Once [PERSON] receives block 10, he will acknowledge the longer chain as the main chain. Hence, [PERSON]'s block 11 ends up being an orphan. [PERSON] made [PERSON] waste resources on a block that was never going to end up in the main chain. This is the mechanism by which selfish mining may increase a selfish miner's fair share of block rewards. Figure 1: Visualisation of block trees for different selfish shares of the network’s hashing power (\(\alpha\)). (**a**) in which selfish miner controls 20% share of the hashing power; (**b**) in which selfish miner controls 40% share of the hashing power. Note that if all miners behave _honestly_, then in expectation, a miner's share of total block revenue is equal to the miner's share of the network's hashing power. This is considered to be the _fair share_[5]. That is to say the fair share of the revenue for the selfish miner in scenario (a) would have been 0.2, but the realised selfish share of revenue was 0. This is due to the failed selfish mining attack. In scenario (b), in which two successful selfish mining attacks took place, the fair revenue share would have been 0.4, but the realised share of the revenue for the selfish miner was 0.5. These two scenarios illustrate that selfish mining may not always be a profitable strategy [6]. The main determinant for profitability is the selfish miner's share of the network's hashing power as well as the ability to win block races. Given the far-reaching implications of this attack vector, it is worth investigating whether selfish mining is a profitable strategy. To achieve this, we introduce an agent-based model to study the dynamics and influences of selfish mining attacks, which is expanded from our previous conference paper [7]. Our main research questions in this paper are:  
* RQ1: What is the effect of network latency, network topology, node's centrality and heterogeneous hashing power distributions on the profitability of selfish mining?