# Effective Selfish Mining Defense Strategies to Improve Bitcoin Dependability
## 2 CTMC-Based Dependability Analysis  
Figure 1 illustrates the main states and transitions among the states for bitcoin subject to selfish mining under the three-block strategy in the CTMC model.  
State 0 is the initial state, where only one main chain exists without any branches. The system may transit from state 0 to state 1 when a malicious miner (MM) finds a block but keeps it secretly, leading to a private branch that is one block longer than the main chain; the transition rate is assumed to be \(\lambda_{01}\). The system stays in state 0 with a rate of \(\mu_{00}\) if an honest miner (HM) mines the block first.  
The system may transit from state 1 to state 2 when the MM successfully mines the next block on his/her private branch; the transition rate is denoted as \(\lambda_{12}\). The system transits from state 1 to state 0\({}^{\prime}\) when the HM mines the next block before the MM; the transition rate is denoted as \(\mu_{10^{\prime}}\).  
The system may transit from state 0\({}^{\prime}\) to state 1 when the [PERSON] finds the new block first making the private branch one block longer than the main chain; the transition rate is \(\lambda_{0^{\prime}1}\). The system goes back to state 0 from state 0\({}^{\prime}\) if the HM finds the new block first; the transition rate is \(\mu_{020320}\).  
The system may transit from state 2 to state 3 when the [PERSON] discovers the next block first; the transition rate is \(\lambda_{23}\). The system transits from state 2 to state 1 if the HM discovers the next block first; the transition rate is \(\mu_{21}\).  
The system may transit from state 3 to state 4 when the HM successfully discovers the next block; the transition rate is \(\lambda_{34}\). In state 4, the MM broadcasts the private branch making it the main branch, thus the selfish mining attack succeeds.  
Based on the state transition diagram in Figure 1, Equation (1) gives the state equations of the CTMC with the transition rate matrix and the state probability vector on the left-hand side and the vector of the state probabilities' derivative on the right-hand side. Specifically, \(P_{k}(t)\) in Equation (1) represents the probability that the bitcoin occupies state \(k\) (\(k=0\), 0\({}^{\prime}\), 1, 2, 3, 4), and \(\dot{P}_{k}(t)\) represents the derivative of \(P_{k}(t)\).  
\[\begin{bmatrix}-\lambda_{01}&\mu_{00}&0&0&0\\ 0&-(\mu_{0\prime 0}+\lambda_{0\prime 1})&\mu_{10^{\prime}}&0&0&0\\ \lambda_{01}&\lambda_{q1}&-(\mu_{10^{\prime}}+\lambda_{12})&\mu_{21}&0&0\\ 0&0&\lambda_{12}&-(\mu_{21}+\lambda_{23})&0&0\\ 0&0&0&\lambda_{23}&-\lambda_{34}&0\\ 0&0&0&0&\lambda_{34}&0\end{bmatrix}\begin{bmatrix}P_{0}(t)\\ P_{0^{\prime}}(t)\\ P_{1}(t)\\ P_{2}(t)\\ P_{3}(t)\\ P_{4}(t)\end{bmatrix}=\begin{bmatrix}\dot{P}_{0}(t)\\ \dot{P}_{0^{\prime}}(t)\\ \dot{P}_{1}(t)\\ \dot{P}_{2}(t)\\ \dot{P}_{3}(t)\\ \dot{P}_{4}(t)\end{bmatrix} \tag{1}\]  
Applying the Laplace transform-based method using the initial state probabilities of \(P_{0}(0)=1\) and \(P_{k}(t)=0\) (for \(k=0^{\prime}\), \(1\), \(2\), \(3\), \(4\)), as well as the condition of \(\sum\limits_{k=0,0^{\prime}}^{4}P_{k}(t)=1\), the state probabilities \(P_{k}(t)\) can be obtained. Refer to [34] for a detailed  
Figure 1: State transition diagram (0: initial state, 0\({}^{\prime}\): double branches, 1: one-block lead, 2: two-block lead, 3: three-block lead, and 4: attack success).  
solution. The bitcoin dependability is \(D(t)=1-P_{4}(t)\) since the selfish mining attack succeeds in state 4. The CTMC-based method presented in this section is applied in Sections 3 and 4 to evaluate the performance of the proposed defense strategies.