# Profitable Double-Spending Attacks
## 3 The Attack Probabilities  
We aim to calculate the probability distribution function (PDF) of the DSA time \(T_{DSA}\). Using this, the success probability of DS attack with a given cut-time \(t_{cut}\) can be figured out as the probability that \(T_{DSA}<t_{cut}\). Also, the expectation of attack success time can be calculated. The expected attack success time will be used in Section 4 to estimate the attack profits.  
where \(\delta(t)\) is the Dirac delta function.  
**Proposition 1**.: _The PDF \(f_{T_{DSA}}\) has an analytic expression:_  
\[\begin{split} f_{T_{DSA}}(t)&=\frac{p_{A}\lambda\tau e ^{-\lambda\tau t}t\big{(}\rho_{A}p_{H}(\lambda\tau t)^{2}\big{)}^{N_{BC}}}{(2N_{ BC})!}\cdot\sum\limits_{j=N_{BC}}^{j=2N_{BC}}\left(\begin{array}{c}j-1\\ N_{BC}-1\end{array}\right)_{2}F_{3}\Big{(}\mathbf{a};\mathbf{b};p_{A}p_{H}( \lambda\tau t)^{2}\Big{)}\\ &\quad+\frac{c^{\lambda\tau t}}{t}\frac{(p_{A}\lambda\tau t)^{N_{BC}}}{(N_{ BC}-1)!}\left(\rho_{A}\lambda\tau t-\sum\limits_{i=0}^{N_{BC}}\frac{(p_{A} \lambda\tau t)^{i}}{i!}\right)+(1-\mathbb{P}_{DSA})\delta(t-\infty),\end{split} \tag{20}\]  
_where \({}_{p}F_{q}(\mathbf{a};\mathbf{b};x)\) is the generalized hypergeometric function (See Appendix E for definition) with the parameter vectors_  
\[\mathbf{a}=\left[\begin{array}{c}N_{BC}+1-j/2\\ N_{BC}+1/2-j/2\end{array}\right] \tag{21}\]  
_and_  
\[\mathbf{b}=\left[\begin{array}{c}2N_{BC}+2-j\\ N_{BC}+1\\ N_{BC}+1/2\end{array}\right]. \tag{22}\]  
Proof.: See Appendix C.  
By Definition 2, the probability \(\mathbb{P}_{AS}\) that a DS attack DS\((p_{A},t_{cat};N_{BC})\) succeeds equals  
\[\mathbb{P}_{AS}(t_{cat})=\Pr(T_{DSA}<t_{cat}) \tag{23}\]  
Note that for a special case of \(t_{cat}=\infty\), \(\mathbb{P}_{AS}(t_{cat})=\mathbb{P}_{DSA}\), which coincides with the result in Rosenfeld [6].  
It will be shown to be convenient to define the attack success time \(T_{AS}\) of a DS attack as  
\[T_{AS}:=\begin{cases}T_{DSA},&\text{if }T_{DSA}<t_{cat},\\ \text{not defined},&\text{otherwise}.\end{cases} \tag{24}\]  
A random variable for \(T_{DSA}>t_{cat}\) does not need to be defined since it is not useful. The PDF \(f_{T_{AS}}\) of \(T_{AS}\) is just a scaled version of \(f_{T_{DSA}}(t)\) for \(0<t<t_{cat}\), which is given in Equation (20), with a scaling factor of \(\mathbb{P}_{AS}{}^{-1}\). Formally, the PDF \(f_{T_{AS}}(t)\) equals  
\[f_{T_{AS}}(t)=\begin{cases}\frac{f_{T_{DSA}}(t)}{\mathbb{P}_{AS}},&\text{for }0 \leq t<t_{cat},\\ 0,&\text{for }t\geq t_{cat}.\end{cases} \tag{25}\]  
The expectation of attack success time is computed as  
\[\mathbb{E}_{T_{AS}}(t_{cat})=\frac{\int_{0}^{t_{cat}}tf_{T_{DSA}}(t)dt}{ \mathbb{P}_{AS}(t_{cat})}. \tag{26}\]  
The following Proposition 2 gives an explicit formula of \(\mathbb{E}_{T_{AS}}\) for the special case when \(t_{cat}=\infty\).  
**Proposition 2**.: _Let \(p_{M}:=\max(p_{A},p_{H}),p_{m}:=\min(p_{A},p_{H})\). If \(t_{cat}=\infty\), the expectation \(\mathbb{E}_{T_{AS}}(t_{cat})\) has a closed-form expression:_  
\[\lim_{t_{cat}\rightarrow\infty}\mathbb{E}_{T_{AS}}(t_{cat})=\frac{\lambda\tau \mathrm{-}\mathrm{I}\mathrm{I}\left(\sum\limits_{j=N_{BC}}^{2N_{BC}}\left( \begin{array}{c}j-1\\ N_{BC}-1\end{array}\right)\mathbb{Z}_{j}+\frac{N_{BC}}{p_{H}}\right)}{\mathbb{ P}_{DSA}}, \tag{27}\]where  
\[Z_{j}:=p_{A}{p_{m}}^{N_{BC}}{p_{M}}^{-(N_{BC}-j+1)}\bigg{(}\frac{2N_{BC}-2 jp_{m}+1 }{p_{M}-p_{m}}\bigg{)}-jp_{A}{}^{-(N_{BC}-j)}{p_{H}}^{N_{BC}}. \tag{28}\]  
See Appendix B.