# Resilience Analysis for Double Spending via Sequential Decision Optimization
## 7 Attack Planning as an Optimal Switching Problem
### Numerical Illustration of Optimal Switching
Here, a deeper understanding of the natural bifurcations of the official chain (which slows down its growth) and the attacker's opportunity to enforce it (by publishing blocks, jamming the network and causing propagation delays) are crucial. All these problems must be systematically addressed to improve stability of block chain systems. Figure 3: The value \(v_{0}^{*}(0,2)\) of the double-spending attack for \(n=6\) confirming blocks depending on the mining ratio \(q\in[0.15,0.3]\) calculated for \(C=100\), \(C=50\), and \(C=30\) (solid, dashed, and dotted line respectively). **Acknowledgments:** This work would not have been possible without the advice, help, kind support, and very significant contributions of [PERSON]. The author would also like to thank to anonymous referees for their criticism and remarks which helped us improving this work. In particular, the author expresses deepest gratitude to the referee suggesting an investigation of PoW stability in terms of optimal switching techniques. Furthermore, the author appreciates helpful communication with the editor of MDPI and thanks [PERSON] and [PERSON] for discussions and Vonida UG (haftungsbeschrankt) for their support. **Conflicts of Interest:** The authors declare no conflicts of interest. ## Appendix A

Let us derive the assertions (6) and (7) from the relation between mining capacities. Proof. : The time, required to complete the next block follows an exponential distribution since the process of mining can be described by repeated attempts to solve a cryptographically puzzle by independent random trials. Indeed, taking into account that the waiting time to first success in a sequence of Bernoulli trials is geometrically distributed and the time spent on each trial is short, the exponential distribution provides an excellent approximation for the time required to complete a next block. For this reason, the block numbers mined in the secret and official branch since their fork-off can be described in physical time \(u\in\mathbb{R}_{+}\) by independent Poisson processes \((N^{S}_{u})_{u\in\mathbb{R}_{+}}\), \((N^{O}_{u})_{u\in\mathbb{R}_{+}}\). Furthermore, the corresponding intensities \(\lambda^{S},\lambda^{O}\in]0,\infty[\) are determined by the mining capacity ratios and the total difficulty (for details, see [1,5]) and are proportional \(\lambda^{S}=\lambda q,\lambda^{O}=\lambda(1-q)\) to the capacity fractions \(q,(1-q)\in]0,1[\) of the miners. Therefore, the factor \(\lambda\in]0,\infty[\) incorporates the difficulty of mining. That is, the probability of having mined \(j\in\mathbb{N}\) secret blocks during a time required for the completion of one official block is given by (the author thanks [PERSON])

\[\mathbb{P}(N^{S}_{t}=j|t\text{ is the first jump time of }(N^{O}_{u})_{u\in\mathbb{R}_{+}} \text{ })=\] \[= \int_{0}^{\infty}\frac{(\lambda^{S}t)^{j}}{j!}e^{-t\lambda^{S}}e^ {-t\lambda^{O}}\lambda^{O}dt\] \[= \lambda^{O}(\lambda^{S})^{j}\int_{0}^{\infty}\frac{t^{j}}{j!}e^{ -t(\lambda^{S}+\lambda^{O})}dt\] \[= \lambda^{O}(\lambda^{S})^{j}\frac{1}{(\lambda^{S}+\lambda^{O})^{j +1}}=\frac{\lambda^{O}}{\lambda^{S}+\lambda^{O}}(\frac{\lambda^{S}}{\lambda^{S }+\lambda^{O}})^{j}=(1-q)q^{j}.\]

The proof of Lemma 1 is given below:

Proof. : 1. To show (32), recall that given \(x\in\mathbb{Z}\), \(n\in\mathbb{N}\) with \(x\geq-n\) and \(x^{\prime}\in\{1,\ldots,x+n+1\}\) the probability \(\mathbb{P}(Z_{n+1}=x^{\prime}\,|\,Z_{0}=x)\) is the sum over probabilities of \[ \begin{array}{c}\text{all trajectories of }(Z_{i})_{i=0}^{n+1}\text{ which}\\ \text{start at }x\text{ and finish at }x^{\prime}.\end{array} \] (A1) Please note that each such trajectory cannot exceed \(x+n+1\) since at each time \(i\), the Markov chain can jump up \(Z_{i+1}=Z_{i}+1\) by one unit at most.