# Profitable Double-Spending Attacks
## Appendix B Proof of Corollary 1. Taking infinite summations of \(p_{DSA,i}\) for all indices \(i\) results in \(\mathbb{P}_{DSA}\):  
\[\mathbb{P}_{DSA}=\sum\limits_{i=2N_{BC}+1}^{\infty}p_{DSA,i} \tag{11}\]  
By substituting \(p_{DSA,i}\) in Lemma 1 into Equation (11), the probability \(\mathbb{P}_{DSA}\) becomes  
\[\mathbb{P}_{DSA}=\sum\limits_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array} \right)p_{A}\sum\limits_{i=2N_{BC}+1}^{\infty}C_{\frac{i-1} {2}-N_{BC}2N_{BC}-j}(p_{A}p_{H})^{\frac{i-1}{2}}+\left(\frac{p_{H}}{p_{A}} \right)^{N_{BC}}\sum\limits_{i=2N_{BC}+1}^{\infty}\left( \begin{array}{c}i-1\\ N_{BC}-1\end{array} \right)p_{A}{}^{i}. \tag{12}\]  
By rearranging the indices \(i\) in the summations, we can obtain  
\[ \begin{array}{ll}\mathbb{P}_{DSA}&=\sum\limits_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array}\right)p_{A}\sum\limits_{i=0}^{\infty}C_{i,2N_{BC}-j}(p_{A}p _{H})^{i+N_{BC}}\\ &+\left(\frac{p_{H}}{p_{A}}\right)^{N_{BC}}\left(\begin{array}{c}i-1\\ N_{BC}-1\end{array}\right)p_{A}{}^{i}-\sum\limits_{i=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}i-1\\ N_{BC}-1\end{array}\right)p_{A}{}^{i}\right).\end{array}  \tag{13}\]  
We define two generating functions as  
\[M_{k}(x):=\sum\limits_{i=0}^{\infty}C_{i,k}x^{i}, \tag{14}\]  
and  
\[G_{k}(x):=\sum\limits_{i=k}^{\infty}\left( \begin{array}{c}i\\ k\end{array} \right)x^{i}. \tag{15}\]  
By substituting \(M_{k}\) and \(G_{k}\) into Equation (13), we can write  
\[ \begin{array}{ll}\mathbb{P}_{DSA}&=\sum\limits_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array}\right)p_{A}(p_{A}p_{H})^{N_{BC}}M_{2N_{BC}-j}(p_{A}p_{H})\\ &+\left(\frac{p_{H}}{p_{A}}\right)^{N_{BC}}\left(p_{A}G_{N_{BC}-1}(p_{A})- \sum\limits_{i=N_{BC}}^{2N_{BC}}\left(\begin{array}{c}i-1\\ N_{BC}-1\end{array}\right)p_{A}{}^{i}\right)\end{array}  \tag{16}\]  
The function \(M_{k}(x)\) is a generating function of the ballot numbers \(C_{i,k}\), for which the algebraic expression given in [26] is  
\[M_{k}(x)=\left(\frac{2}{1+\sqrt{1-4x}}\right)^{k+1}. \tag{17}\]  
Putting \(x=p_{A}p_{H}\) into \(M_{k}(x)\) results in  
\[ \begin{array}{ll}M_{k}(p_{A}p_{H})&=\left(\frac{2}{1+\sqrt{1-4p_{A}p_{H}}} \right)^{k+1}\\ &=\left\{\begin{array}{ll}\left(\frac{2}{1+\sqrt{1-4p_{A}(1-p_{A})}} \right)^{k+1},&\mbox{if $p_{A}<p_{H}$},\\ \left(\frac{2}{1+\sqrt{1-4(1-p_{H})p_{H}}}\right)^{k+1},&\mbox{if $p_{A}\geq p_{H}$} \end{array}\right.\\ &=\left(\frac{1}{p_{H}}\right)^{k+1},\end{array}  \tag{18}\]where \(p_{M}:=\max(p_{H},p_{A})\). The function \(G_{k}(x)\) is a generating function of binomial coefficients, and the algebraic expression for it is given in [27]:  
\[G_{k}(x)=\frac{x^{k}}{\left(1-x\right)^{k+1}}. \tag{111}\]  
Putting \(x=p_{A}\) into \(G_{k}(x)\) results in  
\[G_{k}(p_{A})=p_{H}{}^{-1}\left(\frac{p_{A}}{p_{H}}\right)^{k}. \tag{112}\]  
Substituting Equation (110) and Equation (112) into Equation (111) provides  
\[\mathbb{P}_{DSA}=\sum_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array} \right)p_{A}(p_{A}p_{H})^{N_{BC}}p_{M}{}^{-(2N_{BC}-j+1)}+1- \left(\frac{p_{H}}{p_{A}}\right)^{N_{BC}}\sum_{i=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}i-1\\ N_{BC}-1\end{array} \right)p_{A}{}^{i}. \tag{113}\]  
We define \(p_{m}:=\min(p_{A},p_{H})\), then the relationship \(p_{A}p_{H}=p_{m}p_{M}\) holds. By rearranging the order of operands, we can obtain  
\[\mathbb{P}_{DSA}=1-\sum_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array} \right)\left(\left(\frac{p_{H}}{p_{A}}\right)^{N_{BC}}p_{A}{ }^{j}-\frac{p_{A}}{p_{M}}\left(\frac{p_{m}}{p_{M}}\right)^{N_{BC}}p_{M}{}^{j}\right), \tag{114}\]  
which is equal to Equation (17). \(\Box\)  
**Proof of Proposition 2. ** From Equations (19) and (26), when \(t_{cut}=\infty\), we obtain  
\[ \begin{array}{rl}\mathbb{E}_{T_{AS}}&=\frac{\lim\limits_{t_{cut}\to\infty} \int_{-\infty}^{t_{cut}}t_{f_{DSA}(t)dt}}{\mathbb{P}_{AS}(t_{cut})}=\frac{ \sum\limits_{i=2N_{BC}+1}^{\infty}\mathbb{E}[T_{i}]p_{DSA,i}}{\mathbb{P}_{DSA}} \\ &=\frac{i-2N_{BC}+1}{\frac{i}{\Omega T}p_{DSA,i}},\end{array}