# On profitability of stubborn mining

We compute and compare profitabilities of stubborn mining strategies that are variations of selfish mining. These are deviant mining strategies violating Bitcoin's network protocol rules. We apply the foundational set-up from our previous companion article on the profitability of selfish mining, and the new martingale techniques to get a closed-form computation for the revenue ratio, which is the correct benchmark for profitability. Catalan numbers and Catalan distributions appear in the closed-form computations. This marks the first appearance of Catalan numbers in the Mathematics of the Bitcoin protocol.

## Authors

• 9 publications
• 9 publications
• ### On Profitability of Trailing Mining

We compute the revenue ratio of the Trail Stubborn mining strategy in th...
11/22/2018 ∙ by Cyril Grunspan, et al. ∙ 0

• ### The mathematics of Bitcoin

We survey recent results on the mathematical stability of Bitcoin protoc...
03/02/2020 ∙ by Cyril Grunspan, et al. ∙ 0

• ### Profit lag and alternate network mining

For a mining strategy we define the notion of "profit lag" as the minimu...
10/06/2020 ∙ by Cyril Grunspan, et al. ∙ 0

• ### Selfish Mining and Dyck Words in Bitcoin and Ethereum Networks

04/11/2019 ∙ by Cyril Grunspan, et al. ∙ 0

• ### Bitcoin Selfish Mining and Dyck Words

We give a straightforward proof for the formula giving the long-term app...
02/05/2019 ∙ by Cyril Grunspan, et al. ∙ 0

• ### Protocol for a Study of the Effect of Surface Mining in Central Appalachia on Adverse Birth Outcomes

Surface mining has become a major method of coal mining in Central Appal...
05/04/2020 ∙ by Dylan S. Small, et al. ∙ 0

• ### Valuation of Crypto-Currency Mining Operations

Traditionally, the Net Present Value method is used to compare diverging...
02/04/2018 ∙ by J. Berengueres, et al. ∙ 0

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1. Introduction

In our previous article [3] we gave a rigorous foundation for the profitability analysis of alternative mining strategies in the Bitcoin network [6]. As for games with repetition, it depends on the proper analysis of the revenue and the duration over attack cycles. More precisely, we prove that the expected revenue and expected duration over an attack cycle give the “Revenue Ratio”

 Γ=E[R]E[τ]

This is the correct benchmark for the profitability of the strategy.

This analysis was applied to the “Selfish Mining” strategy from [1]. We also introduced in [3]

martingale tools that yield, by the application of Doob’s Stopping Time Theorem, the expected duration of the attack cycles. With the Markov model (used in

[1] and other articles in the literature) one cannot compute the expected cycle duration . As we prove in [3], it is only after a difficulty adjustment that Selfish Mining or any other “block withholding strategy” can become profitable. To compute the expected time of the next difficulty adjustment it is necessary to be able to compute the expected duration of cyles .

In this article we apply again these new powerful techniques to some of the “Stubborn Mining” strategies presented in [7]. So far only a numerical Monte-Carlo analysis seems to be known for these strategies. For the “Lead-Stubborn Mining” (LSM) and the “Equal Fork Stubborn Mining” (EFSM) strategies we compute the “Revenue Ratios”.

We fix some notations. Let be the block reward, and the average inter-block validation time for the total network (around minutes for the Bitcoin network). We denote by the relative hashing power of the attacker. Let be the fraction of the honest network that the attacker attracts to mine on top of his fork. For a miner that after a difficulty adjustment has a Revenue Ratio we define his apparent hashrate by

 ~q=~Γ⋅τ0b .

The apparent hashrate of a miner can also be defined after a difficulty adjustment as the average proportion of blocks mined by the miner in the official blockchain. We make use of

 C(x)=1−√1−4x2x=21+√1−4x=+∞∑n=0Cnxn

which is the generating series for Catalan numbers (see Appendix A).

The revenue ratio of the “Lead-stubborn mining” strategy is

 Γ(LSM)=(q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+q(p−q))bτ0  .

After a difficulty adjustment, the apparent hashrate of the stubborn miner is

 ~qLSM=q⋅p+pq−q2p+pq−q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+pq−q  .
###### Theorem 2 (Equal Fork Stubborn mining).

The revenue ratio of the “Equal Fork Stubborn mining” strategy is

 Γ(EFSM)=(q−(1−γγ)(p−q)(1−pC((1−γ)pq)))bτ0  .

After a difficulty adjustment, the apparent hashrate of the miner is

 ~qEFSM=qp−(1−γ)(p−q)γp(1−pC((1−γ)pq)) .

We compare these strategies to “Honest Mining” (HM) and “Selfish Mining” (SM) and we determine in the parameter plane which one performs the best.

## 2. Generalities.

### 2.1. Profitability.

In [3], we studied the profitability of integrable repetition games which are composed of cycles, with a finite expected duration . The stopping time is also called a strategy. Mining strategies are repetition games, and sound mining strategies are integrable. For the comparison of profitability of two strategies we only need to compare the Revenue Ratio of each one (see [3])

 Γ=E[R]E[τ]

where is the revenue over a cycle.

The number of blocks and validated by the attacker and honest miners respectively are independent Poisson processes (see [8] for background on Poisson Process). The attack cycle ends when the honest miners catch-up the attackers. The number of validated blocks in a cycle in the official blockchain is . We denote by (resp. ) the inter-block validation time for the honest miners (resp. attackers).

### 2.2. Profitability after a difficulty adjustment.

The following Theorem describes how the Revenue Ratio changes after a difficulty adjustment (see [3]).

###### Theorem 2.1.

After a difficulty adjustment the new Revenue Ratio is given by

 ~Γ=Γ⋅δ ,

where

 δ=E[τ]τ0⋅E[N(τ)∨N′(τ)] .
###### Proof.

After a difficulty adjustment, the expected revenue is the same, , but the expected duration of a cycle is . So, the new revenue ratio is . ∎

### 2.3. Description of Stubborn strategies.

We describe first the Selfish Mining (SM) strategy. Let be the advance of the secret fork over the public blockchain. When the honest miners validate a block then the selfish miner does the following:

• If , he mines normally.

• If then he broadcasts his block. A competition follows.

• If then he broadcasts his secret fork.

• If then he broadcasts blocks from his secret fork to match the length of the public blockchain.

• Except in the first two cases, he keeps working on top of his secret fork.

For the Lead-Stubborn Mining (LSM) strategy, with he proceeds as in the SM strategy for and with he releases all his secret fork and mines normally on top of it.

In other words, a stubborn miner following the Lead Stuborn Mining strategy (LSM) waits until the honest miners catch up with him to broadcast all of his secret fork. Then, when this happens, there is a final round. Notice that a selfish miner following SM strategy does not take the risk of being caught by the honest miners. If his advance shrinks to , then he broadcasts his fork.

For the Equal Fork Stubborn Mining (EFSM) strategy, everything is equal to LSM, but for if he finds a new block he does not reveal it.

In other words a stubborn miner following the Equal Fork Stubborn Mining strategy (EFSM) waits for the official blockchain to overcome his secret fork by one block. He only gives up when the length of the official blockchain equals the length of his secret fork plus one. In particular, the last round of the attack cycle of the strategy is always lost by such a miner. His reward comes only when blocks of the official blockchain are built by honest miners on top of one of his blocks. Indeed, the rogue miner never adds new blocks to the official blockchain. He only tries to replace old blocks mined by the honest miners with some of his blocks.

### 3.1. Stopping time.

For each mining strategy we consider the stopping time associated with an attack cycle. Let be the stopping time of the “Lead-Stubborn” Mining strategy.

###### Proposition 3.1.

We have

 τLSM=τ+(TN(τ)+1∧T′N(τ)+1)⋅1T′1≤T1

with

 τ=inf{t≥T1;N(t)=N′(t)+1T1

In other words, either and the attack cycle ends at or and the attack cycle ends up a final round after the honest miner catch up with the attacker.

We calculate the expected duration time of an attack cycle.

###### Lemma 3.2.

We have

 E[τ]=pp−qτ0

and

 E[τLSM]=E[τ]+qτ0=τ0+2qE[τ]=p+pq−q2p−qτ0 .
###### Proof.

By the strong Markov property (see [8]), we have

 E[τ] =E[τ|T1T′1]⋅P[T1>T′1] =E[T1|T1T′1]⋅P[T1>T′1] =E[T1∧T′1]+E[~τ]⋅q

where with and . Both and are Poisson processes with parameters and . Thus, from Appendix 2 on Poisson Games, we have

 E[~τ]=τ0p−q

and

 E[τ]=τ0+qp−qτ0=pp−qτ0

If then

. Otherwise (and this event occurs with probability

), once the honest miners catch-up with the attacker at -time, there is a final round. ∎

Note that if then, and . Otherwise, and .

### 3.2. Revenue Ratio.

For , we denote by the -th Catalan number

 Cn=12n+1(2nn)=(2n)!n!(n+1)! .

We present in Appendix A the combinatorial properties of Catalan numbers used in this article, and the definition of -Catalan distributions.

The link between Catalan numbers and Bitcoin appears in the following lemma.

###### Lemma 3.3.

follows the second type -Catalan distribution, more precisely, we have and for ,

 P[N′(τ)=n]=Cn−1(pq)n .
###### Proof.

For we have . Consider . The event is the disjoint union of sub-events of the form where for each there is such that , and . The sequence of points with coordinates form a path starting at and ending at which stays strictly above the first bisector in the Euclidean plane. For example, with ,

 {N′(τ)=3}={S′1

The number of such paths is (see Proposition A.4 in Appendix A). Moreover, the number of (resp. ) in the sequence of is equal to . ∎

From the expected value computation of a second type -Catalan random variable (Proposition A.2 in Appendix A) we get:

###### Corollary 3.4.

We have

 E[N′(τ)]=pqp−q .
###### Remark 3.5.

An alternative probabilistic proof follows from Doob’s Theorem: We have for and we let (similar to Theorem C.1 in Appendix C).

Next we compute the expected revenue per attack cycle.

###### Proposition 3.6.

Let be the revenue over an attack cycle. We have

 E[RLSM]=(pp−q+q)qb−f(γ)b

with

 f(γ)=pq(1−γ)γ⋅(1−p(1−γ)C((1−γ)pq)) .
###### Proof.

Note that for ,

 P[RLSM=nb|N′(τ)=n] = γp P[RLSM=(n+1)b|N′(τ)=n] = q P[RLSM

Moreover, during an attack cycle, each time the honest miners find a block (except for the first block which is mined on a common root), there is a probability that it is found by a miner mining on top of the attacker’s fork. If and , this can happen at most times over an attack cycle. So, by Lemma B.1 from Appendix B,

 E[RLSM|(N′(τ)=n)∧(RLSM

Therefore, by conditioning on and using Lemma 3.2, Lemma 3.3 and Corollary 3.4, we get

 E[RLSM]b=∑n>0E[RLSMb∣∣∣N′(τ)=n]⋅P[N′(τ)=n] =∑n>0((n−1−(1−γ)nγ)⋅(1−γ)p+nγp+(n+1)q)⋅P[N′(τ)=n] =∑n>0(n+1−pγ+(1−γ)n+1γp)⋅P[N′(τ)=n] =E[N′(τ)]+(1−pγ)(1−P[N′(τ)=0])+p2q(1−γ)2γ∑n>0Cn−1((1−γ)pq)n−1 =pqp−q+(1−pγ)q+p2q(1−γ)2γC((1−γ)pq) =(pp−q+q)q−pqγ⋅(1−γ−p(1−γ)2C((1−γ)pq))

###### Theorem 3.7.

The revenue ratio of the Lead Stubborn strategy is

 Γ(LSM)=(q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+q(p−q))bτ0 .
###### Proof.

We have . Use Lemma 3.2 and Proposition 3.6. ∎

We compute now the revenue ratio and the apparent hashrate after a difficulty adjustment.

We have .

###### Proof.

For all , is a bounded stopping time. So, by proceeding as in Appendix 2, Doob’s theorem yields and . Taking limits when , the monotone convergence theorem yields and . Now, we observe that at the end of an attack cycle, we have necessarily . So, . Hence we get the result by taking expected values on both sides of the last equality. ∎

The following proposition is now a consequence of Theorem 2.1.

###### Proposition 3.9.

The parameter updating the difficulty is

 δLSM=p+pq−q2p+pq−q>1 .
###### Proof.

Using  Theorem 2.1, Lemma 3.2 and Lemma 3.8, we have

 δLSM=E[τLSM]τ012(E[τLSM]τ0+1)=E[τ]τ0+q1+qE[τ]τ0=pp−q+q1+pqp−q=p+pq−q2p+pq−q>1

### 3.4. Apparent hashrate after a difficulty adjustment

From Proposition 3.9, we can deduce the hashrate of the strategy on the long term.

###### Corollary 3.10.

After a difficulty adjustment, the apparent hashrate is

 ~qLSM=q⋅p+pq−q2p+pq−q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+pq−q
###### Proof.

By Theorem 2.1, we have:

 ~Γ(LSM)=Γ(LSM)δLSM =(q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+q(p−q))bτ0⋅p+pq−q2p+pq−q =(q⋅p+pq−q2p+pq−q−pq(p−q)(1−γ)γ⋅1−p(1−γ)C((1−γ)pq)p+pq−q)bτ0

## 4. Equal Fork Stubborn Mining strategy

### 4.1. Stopping time.

Let be the stopping time of an attack cycle for the Equal Fork Stubborn Mining strategy.

###### Proposition 4.1.

We have

 τEFSM=inf{t≥0;N(t)=N′(t)+1} .
###### Proof.

If , then we have . Otherwise, we wait for the honest miners to catch up with the stubborn miner and win the last round. ∎

From Theorem C.1 in Appendix C we get:

###### Lemma 4.2.

We have

 E[τEFSM]=τ0p−q .

### 4.2. Revenue ratio.

We denote by the revenue of the stubborn miner after an attack cycle.

###### Lemma 4.3.

The random variable is a -Catalan distribution, i.e. for , we have

 P[N′(τEFSM)=n]=Cnp(pq)n .
###### Proof.

The event can be decomposed as a disjoint union of sub-events of the form where for each there is such that , and and . The sequence of points with coordinates for form a path starting at and ending at which never crosses the first diagonal in the Euclidean plane before reaching the point . For example,

 {N′(ξ)=2}={S′1

The number of such paths is (see Proposition A.4 from Appendix A). Moreover, the number of (resp. ) in the sequence of is equal to (resp. ). Hence we get the result. ∎

From the expected value computation of a -Catalan random variable (Proposition A.2 in Appendix A) we get:

###### Corollary 4.4.

We have

 E[N′(τEFSM)]=qp−q .

We compute now .

###### Proposition 4.5.

We have

 E[REFSM]=qp−qb−g(γ)b

with

 g(γ)=1−γγ(1−pC((1−γ)pq)) .
###### Proof.

By definition of , if we know that , then the honest miners have mined blocks at time . Except for the first block, the probability that the block validated by the honest miners is mined on a fork created by the stubborn miner is . So, by Lemma B.1 from Appendix B,

 E[REFSMb∣∣∣N′(τEFSM)=n]=n+1−1−(1−γ)n+1γ .

Therefore, we have

 E[REFSM]b=∑n≥0E[REFSMb∣∣∣N′(τEFSM)=n]⋅P[N′(τEFSM)=n] =∑n≥0(n+1−1−(1−γ)n+1γ)⋅P[N′(τEFSM)=n] =∑n≥0nP[N′(τEFSM)=n]+1−γ−1γ∑n≥0P[N′(τEFSM)=n]+1−γγp∑n≥0((1−γ)pq)nCn =E[N′(τEFSM)]−1−γγ+1−γγpC((1−γ)pq) =qp−q−1−γγ(1−pC((1−γ)pq)) .

###### Theorem 4.6.

The revenue ratio of the “Equal Fork Stubborn mining” strategy is

 Γ(EFSM)=(q−1−γγ(p−q)(1−pC((1−γ)pq)))bτ0 .
###### Proof.

Use Lemma 4.2 and Proposition 4.5. ∎

###### Proposition 4.7.

The parameter updating the difficulty is

 δEFSM=1p>1 .
###### Proof.

At the end of an attack cycle, the number of new blocks in the official blockchain is and . Therefore we have

 δEFSM=E[τEFSM]τ0E[N(τEFSM)]=1p .

### 4.4. Apparent hashrate after a difficulty adjustment.

It’s now easy to get the long term apparent hashrate of the EFSM strategy.

###### Corollary 4.8.

After a difficulty adjustment, the apparent hashrate is

 ~qEFSM=qp−(1−γ)(p−q)γp(1−pC((1−γ)pq)) .
###### Proof.

Use Theorem 2.1 and Proposition 4.7. ∎

## 5. Comparison of strategies.

For different values of the parameters and , we can compare the profitability of the different strategies after a difficulty adjustment by comparing the revenue ratios after a difficulty adjustment, or, equivalently, their apparent hashrate.

We consider the four strategies:

• Honest Mining (HM).

• Selfish Mining (SM).

• Equal Fork Stubborn mining (EFSM).

We color the region according to which strategy is more profitable, and we obtain Figure 1.

From left to right, the best strategy is successively HM, SM, LSM and EFSM. Note that, the LSM strategy is superior only on a thin domain.

A similar picture is numerically computed by Montecarlo simulations in [7] where only a numerical study is carried out. See Figure 2 (disregard regions R4 to R7 that correspond to “Trail Stubborn Mining” strategies that are studied in [4]).

Regions R1, R2 and R3 correspond respectively to HM, SM and EFSM. We notice the absence of the region corresponding to LSM in between R2 and R3. Apparently the numerical methods did not detect it (also it is noticeable how in their figure the boundary between R2 and R3 is more blurred than other boundaries, as for example the one separating R1 and R2).

## Appendix A Catalan distributions.

For , we denote by the -th Catalan number

 Cn=12n+1(2nn)=(2n)!n!(n+1)! .

We refer to [5] for background and combinatorial properties of Catalan numbers. Their generating series is

 C(x)=+∞∑n=0Cnxn=1−√1−4x2x=21+√1−4x .

Observe that and , which justifies the following definition:

###### Definition A.1 (Catalan distributions).

Let and . A random variable taking values in is a -Catalan random variable if it follows the -Catalan distribution, that is, for

 P[X=n]=Cnp(pq)n .

The second type -Catalan distribution is defined by and for ,

 P[X=n]=Cn−1(pq)n .
###### Proposition A.2.

The expected value of a -Catalan random variable is

 E[X]=qp−q

If is a second type -Catalan random variable then

 E[X]=pqp−q .
###### Lemma A.3.

We have

 ddx(xC(x))∣∣∣x=pq=1p−q .
###### Proof of the Lemma.

We have and the result follows. ∎

###### Proof of the Proposition.

For the -Catalan random variable we have

 E[X] =+∞∑n=0n.P[X=n]=+∞∑n=0n.Cnp(pq)n =p+∞∑n=0Cn(n+1)(pq)n−p+∞∑n=0Cn(pq)n =pddx(xC(x))∣∣∣x=pq−pC(pq) =pp−q−1=qp−q  .

For the second type -Catalan random variable we have

 E[X] =+∞∑n=0n.P[X=n]=+∞∑n=1n.Cn−1(pq)n =+∞∑m=0Cm(m+1)(pq)m=pqddx(xC(x))∣∣∣x=pq =pqp−q  .

###### Proposition A.4.

The number of paths in going up and right at each step that start at and end-up at without touching the first diagonal is .

## Appendix B Biased coin tossing.

The following lemma is useful for both LSM and EFSM strategies.

###### Lemma B.1.

Let and . Let denotes the outcome of tossing a biased coin times with for . Let . Then we have .

###### Proof.

Note that where is the number of trials (stopping time) before getting ”Heads” when a coin is flipped repeatedly with a probability of getting ”Heads” each time. We have

 E[~Z∧(n+1)] =n∑i=1iP[~Z=i]+(n+1)P[~Z>n] =n∑i=1i(P[~Z>i−1]−P[~Z>i])+(n+1)P[~Z>n] =n∑i=0P[~Z>i]=n∑i=0(1−γ)i=1−(1−γ)n+1γ

## Appendix C Poisson Games.

###### Theorem C.1.

Let (resp. ) be a Poisson process with parameter (resp. ). Let be the stopping time defined by . If then and .

###### Proof.

The proof is similar to the proof of Theorem 4.4 from [2]. For , the stopping time is bounded. So, by applying Doob’s Theorem ([9]) to the martingales and , we get

 αE[τ∧t] =E[N(τ∧t)] =E[N(τ∧t)|τ≤t]P[τ≤t]+E[N(τ∧t)|τ>t]P[τ>t] =E[N(τ)|τ≤t]P[τ≤t]+E[N(t)|τ>t]P[τ>t] =E[N′(τ)+1|τ≤t]P[τ≤t]+E[N(t)]P[τ>t] =E[N′(τ)|τ≤t]P[τ≤t]+αtP[τ>t]+P[τ≤t] =E[N′(τ∧t)|τ≤t]P[τ≤t]+E[N′(τ∧t)|τ>t]P[τ>t] −E[N′(τ∧t)|τ>t]P[τ>t]+αtP[τ>t]+P[τ≤t] =E[N′(τ∧t)]−E[N′(t)|τ>t]P[τ>t]+αtP[τ>t]+P[τ≤t] =α′E[τ∧t]−α′tP[τ>t]+αtP[τ>t]+P[τ≤t]

So we have and

 (α−α′)E[τ∧t|τ≤t]P[τ≤t]=(α−α′)(E[τ∧t]−tP[τ>t])=P[τ≤t] .

Therefore,

 E[τ1τ≤t]=P[τ≤t]α−α′ .

Making , by monotone convergence we have and . Moreover, using Doob’s Theorem again, we have for ,

 E[N(τ)1τ≤t] =E[N(τ∧t)]−E[N(t)|τ>t]P[τ>t] =E[τ∧t]−αtP[τ>t]