# Resilience Analysis for Double Spending via Sequential Decision Optimization
## 7 Attack Planning as an Optimal Switching Problem
### Numerical Illustration of Optimal Switching
For the same reason, each trajectory (A1) also cannot go below \(-n\) since otherwise it would not reach \(x^{\prime}\in\{1\ldots x+n+1\}\), i.e., the dynamics \((Z_{i})_{i=0}^{n+1}\) can be equivalently replaced by \((Z_{i}^{(l,u)})_{i=0}^{n+1}\) in (A1) if \((l,u)\) satisfies \(l\leq-n\) and \(x+n+1\leq u\). The transition probables of \((Z_{i}^{(l,u)})_{i=0}^{n+1}\) over \(n+1\) steps can be obtained fromthe entries of the power \(p^{(l,\mu)\ n+1}\) of its transition matrix \(p^{(l,\mu)}\), which shows (32). Next, in order to determine (31), we use (32) to observe that \[\mathbb{P}(Z_{n+1}\leq 0\,|\,Z_{0}=x) = 1-\sum_{x^{\prime}=1}^{x+n+1}\mathbb{P}(Z_{n+1}=x^{\prime}\,|\,Z_{ 0}=x)\] \[= 1-\sum_{x^{\prime}=1}^{x+n+1}(p^{(l,\mu)})_{x,x^{\prime}}^{n+1}= \sum_{y=l-1}^{0}(p^{(l,\mu)})_{x,y}^{n+1}.\]
2. Consider \(\mathbb{P}(\min_{i=0}^{k}Z_{i}\leq 0\,|\,Z_{0}=x^{\prime})\) as the sum over probabilities of all sample paths of \((Z_{i})_{i=0}^{k}\) which start at \(x^{\prime}\geq 1\) and enter the set of non-positive states. With the same arguments as in the proof of a), the process \((Z_{i})_{i=0}^{k}\) can replaced in (A1) by a truncated dynamic \((Z_{i}^{(l,\mu)})_{i=0}^{k}\) with \((l,\mu)\) satisfying \(l=1\) and \(x^{\prime}+k\leq u\), which gives \[\mathbb{P}(\min_{i=0}^{k}Z_{i}\leq 0\,|\,Z_{0}=x^{\prime})=\mathbb{P}(\min_{i=0 }^{k}Z_{i}^{(l,\mu)}\leq 0\,|\,Z_{0}^{(l,\mu)}=x^{\prime})\] and finishes the proof. ## References

* [1] [PERSON] _Mastering Bitcoin: Programming the Open Blockchain_, 2 nd ed; O'Reilly Media, Inc.: Sebastopol, CA, USA, 2017. * [2] [PERSON] A Peer-to-Peer Electronic Cash System. Available online: [[https://git.dhimmel.com/bitcoin-whitepaper/](https://git.dhimmel.com/bitcoin-whitepaper/)]([https://git.dhimmel.com/bitcoin-whitepaper/](https://git.dhimmel.com/bitcoin-whitepaper/)) (accessed on 16 January 2020). * [3] [PERSON] Analysis of Hashrate-Based Double Spending. _arXiv_**2014**, arXiv:1402.20092014. * [4] [PERSON]; [PERSON] [PERSON] Double Spend Races. _arXiv_**2017**, arXiv:1702.02867. * [5] [PERSON]; [PERSON]; [PERSON]; [PERSON] Bitcoin blockchain dynamics: The selfish-mine strategy in the presence of propagation delay. _Perform. Eval._**2016**, _104_, 23-41. [CrossRef]
* [6] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] On the security and performance of proof of work blockchains. In Proceedings of the 2016 ACM SIGSAC, Vienna, Austria, 24-28 October 2016; pp. 3-16. * [7] [PERSON]; [PERSON] [PERSON]; [PERSON] Optimal selfish mining strategies in bitcoin. In Proceedings of the International Conference on Financial Cryptography and Data Security, Christ Church, Barbados, 22-26 February 2016; pp. 515-532. * [8] [PERSON]; [PERSON] Bitcoin's security model revisited. _arXiv_**2016**, arXiv:1605.09193. * [9] [PERSON]; [PERSON] A survey about consensus algorithms used in blockchain. _J. Inf. Process. Syst._**2018**, _14_, 101-128. * [10] A probabilistic analysis of the Nxt forging algorithm. A survey about consensus algorithms used in blockchain. _Ledger_**2016**, \(1\), 69-83. * [11] [PERSON], [PERSON]; [PERSON], [PERSON]; [PERSON], [PERSON]; [PERSON]; [PERSON] Markov processes in blockchain systems. _Comput. Soc. Netw._**2019**, \(6\), 5. [CrossRef]
* [12] [PERSON]; [PERSON] Transaction-confirmation time for bitcoin: A queueing analytical approach to blockchain mechanism. In Proceeding of the QTNA, Qinhuangdao, China, 21-23 August 2017. * [13] [PERSON], [PERSON]; [PERSON], [PERSON]; [PERSON] A survey about consensus algorithms used in blockchain. _Lect. Notes Comput. Sci._**2018**, _11_, 25-40. * [14] [PERSON]; [PERSON] Majority is not enough: bitcoin mining is vulnerable. _Commun. ACM_**2018**, _61_. [CrossRef]
* [15] [PERSON]; [PERSON]; [PERSON]; [PERSON] Stubborn mining: generalizing selfish mining and combining with an eclipse attack. In Proceedings of the IEEE European Symposium on Security and Privacy, Saarbrucken, Germany, 21-24 March 2016; pp. 305-320. * [16] [PERSON] Fraud Risk Assessment Within Blockchain Transactions. 2019, in press.