Probability theory, systematized in O. B. Sheinin’s seminal work, provides a powerful conceptual and methodological framework for ECDSA cryptanalysis. Key probabilistic ideas—uniform distribution, bias, limit theorems, and statistical hypothesis testing—underlie both Bleichenbacher’s statistical attack and lattice methods, which reduce the problem to a hidden number problem.
Practical application of these methods to the Bitcoin blockchain has demonstrated their high effectiveness: hundreds of private keys have been recovered through passive analysis of public data. This highlights the critical importance of correct nonce generation and the use of deterministic signature schemes (e.g., RFC 6979), which completely eliminate the possibility of such attacks[reference:20].
Thus, Sheinin’s book turns out to be not just a historical monument, but a living source of ideas directly applicable to solving current problems in cryptanalysis and cybersecurity.
Content
- 1. Introduction
- 2. O. B. Sheinin’s book “Probability Theory. Historical Essay” as a methodological basis
- 3. ECDSA and the role of the hidden number (nonce)
- 4. The probabilistic nature of the hidden number: from uniformity to bias
- 5. Bleichenbacher’s Statistical Attack: A Probabilistic Approach to Key Recovery
- 6. Lattice attacks and the hidden number problem (HNP)
- 7. Practical application to the Bitcoin blockchain
- 8. Conclusion
- 9. Directions for further research for cryptanalysis based on this area
1. Introduction
Cryptanalysis of the Elliptic Curve Digital Signature Algorithm (ECDSA)—one of the most widely used digital signature schemes underlying Bitcoin transactions—is a classic problem in which probabilistic methods play a central role. A hidden number (nonce), typically denoted by k , is generated for each signature and must be uniformly distributed modulo the group order n . However, in practice, ECDSA implementations often exhibit deviations from perfect uniformity—so-called biases—which can be exploited to recover the long-term private key d .
The purpose of this paper is to demonstrate how the fundamental probabilistic concepts systematized in O. B. Sheinin’s book “Probability Theory: A Historical Outline” (Berlin: NG Ferlag, 2005, 329 p.) can be applied to the problem of computing the hidden number in an ECDSA signature and, consequently, to recovering the private key of a Bitcoin transaction.[reference:0] We will consider both statistical and algebraic (lattice) methods based on probabilistic estimates and asymptotic theorems.
2. O. B. Sheinin’s book “Probability Theory. Historical Essay” as a methodological basis
Oscar Borisovich Sheinin’s book is not simply a historical overview, but a profound analysis of the evolution of probabilistic ideas—from the prehistory of probability theory through the works of Pascal, Fermat, Jacob Bernoulli, Laplace, Chebyshev, Markov, and Lyapunov, all the way to Kolmogorov’s axiomatics and Fisher’s statistical methods.[reference:1][reference:2] The following aspects are of particular value to the cryptanalyst:
- The concept of probability and its interpretation. Sheinin devotes considerable attention to various approaches to defining probability, including frequentist, logical, and subjective approaches, which allows for the correct formalization of the concept of nonce “bias” as the deviation of an empirical distribution from a theoretical uniform distribution [reference:3].
- Limit theorems. The law of large numbers and the central limit theorem underlie statistical estimates used in analyzing large signature samples. These theorems form the basis of Bleichenbacher’s statistical attack, which requires processing millions of signatures [reference:4].
- Error theory and the method of least squares. The historical analysis of these methods presented in this book is directly applicable to the problem of reconstructing the parameters of the nonce distribution from observed data [reference:5].
- Random processes and Markov chains. Although in the context of ECDSA, a nonce is typically modeled as an independent random variable, dependency analysis methods can be useful in studying correlations between successive nonces in the case of weak random number generators [reference:6].
Thus, Scheinin’s book provides a conceptual framework for moving from the qualitative statement “the nonce must be uniform” to quantitative estimates: how much the observed distribution deviates from uniform, what is the probability of a random coincidence, and how many signatures are needed for a statistically significant conclusion.
3. ECDSA and the role of the hidden number (nonce)
The ECDSA scheme works as follows. Let E be an elliptic curve over a finite field, G be a base point of order n , d be a private key (an integer modulo n ), and Q = dG be a public key . To sign a message with hash h, the signer chooses a random number k (the nonce), computes kG , and forms a pair (r, s) , where:
r = x(kG) mod n,
s = k⁻¹ (h + d·r) mod n.
Critically important is the fact that knowledge of k for one signature immediately yields the private key:
d = (s·k − h) · r⁻¹ mod n.
Moreover, if the same nonce k is used to sign two different messages h₁ and h₂ , then the equality r₁ = r₂ implies:
k = (h₁ − h₂) · (s₁ − s₂)⁻¹ mod n,
which again leads to the recovery of d [reference:7]. However, in practice, a complete repetition of a nonce is a relatively rare occurrence. Partial offsets are much more common: the nonce can be generated with less entropy than required, or have fixed bits (for example, the most significant bits are zero). It is precisely these “soft” offsets that open the possibility of applying probabilistic and statistical methods.
4. The probabilistic nature of the hidden number: from uniformity to bias
A perfect ECDSA requires that k be uniformly distributed over the set {1, 2, …, n − 1}. However, many implementations—especially embedded, mobile, and early versions of cryptographic libraries—generate the nonce as a random ℓ -bit number, where ℓ may be smaller than the bit length n . This results in the distribution of k having bounded support: k ∈ [0, 2 ℓ − 1], while n ≈ 2256 for the secp256k1 curve used in Bitcoin [reference:8].
From a probabilistic point of view, this means that k is biased: the probability of being in the “short” range [0, 2 ℓ − 1] is 1, and the probability of being in the rest of the range [2 ℓ , n−1] is 0. This distribution is radically different from a uniform one, and it is this bias that is exploited in attacks.
A more subtle case is when the nonce is generated uniformly but with errors: for example, the most significant bit of k can be predictably zero with probability p > 1/2 (the so-called “less than one bit leakage”) [reference:9]. Here, probabilistic analysis allows us to estimate how many signatures are needed to statistically reliably detect this bias and subsequently recover the key.
Probabilistic bias model. Let k be a nonce, and assume that it is generated according to a nonuniform distribution P(k) . Then, for each signature, we observe (r, s, h) , where s = k⁻¹(h + d r) mod n . The cryptanalyst’s task is to reconstruct d from a set of such triplets , using the information that the distribution of k is not uniform.
5. Bleichenbacher’s Statistical Attack: A Probabilistic Approach to Key Recovery
In 2000, Daniel Bleichenbacher proposed a purely statistical attack method against (EC)DSA with biased nonces, which was subsequently formalized and improved in a number of papers[reference:10]. The essence of the method is as follows.
From the equation in the signature, we express k in terms of known and unknown quantities:
k = s⁻¹ (h + d·r) mod n.
For a set of m signatures, we obtain m values k_i , which are generally unknown but are known to be non-uniform. Assuming some hypothesis about d is true, the calculated k_i(d) will exhibit a certain statistical property (for example, the most significant bits will be zero more often). The problem boils down to finding d such that the empirical distribution of k_i(d) deviates most strongly from uniformity, toward the expected bias.
Bleichenbacher’s algorithm uses the discrete Fourier transform (FFT) to efficiently calculate the so-called “likelihood function” or “bias statistic” for each candidate d . The peak of this function indicates the true private key [reference:11]. The key advantage of the method is its ability to work with extremely small biases (less than one bit) and its robustness to data errors (misdetection), making it applicable even in cases where lattice methods fail [reference:12].
From a probabilistic point of view, Bleichenbacher’s attack relies on:
- Law of large numbers: for large m, the empirical distribution of k_i(d) converges to the true distribution of nonce (if d is guessed correctly).
- Central Limit Theorem: The bias statistics are asymptotically normal, allowing one to estimate confidence intervals and false positive rates.
- Spectral analysis methods: FFT is used to quickly enumerate candidates d and identify periodic patterns in the distribution k_i(d) .
However, the price paid for this power is the enormous number of signatures required. Early work suggested that attacking a 160-bit curve with a one-bit offset could require over 8 billion signatures [reference:13]. Only recent theoretical improvements (notably the work of Aranha et al., 2020) have allowed the data complexity to be reduced to a few thousand signatures in a number of scenarios [reference:14].
6. Lattice attacks and the hidden number problem (HNP)
An alternative and often more practical approach to ECDSA key recovery with biased nonces is based on reducing the problem to the Hidden Number Problem (HNP) formulated by Boneh and Venkatesan [reference:15]. In this problem, the following is given:
- secret integer α modulo prime p ;
- a set of pairs (t_i, a_i) such that t_i α − a_i ≡ b_i (mod p) , where |b_i| < B for some bound B < p .
Here, α corresponds to the private key d , t_i are known values derived from r_i, s_i, h_i , and b_i are “errors” associated with the unknown least significant or most significant bits of nonce k_i . The problem is to recover α from m pairs.
The lattice-based method for solving HNP consists of constructing a special lattice L generated by the rows of the matrix M and then searching for a short vector corresponding to the desired secret [reference:16]. The LLL (Lenstra–Lenstra–Lovász) and BKZ (Basis Block-Knockdown) algorithms allow one to efficiently find such vectors if the bias B is small enough (usually requiring B to be a few bits smaller than p ).
Lattice attacks work well with four or more known nonce bits per signature for 256-bit curves. However, they become virtually ineffective with a single-bit offset: the corresponding “hidden” vector is no longer significantly shorter than the other lattice vectors [reference:17]. This is where Bleichenbacher’s statistical approach comes in, which, by contrast, is effective with very small offsets and large data volumes.
| Method | Required offset | Number of signatures | Error tolerance |
|---|---|---|---|
| Lattice (LLL/BKZ) | ≥ 4 bits (256-bit) | ~100–1000 | Low |
| Lattice (LLL/BKZ) | ≥ 2 bits (160-bit) | ~1000 | Low |
| Statistical (Bleichenbacher) | < 1 bit | millions–billions | High |
| Statistical (improved, 2020) | < 1 bit | thousands–hundreds of thousands | High |
7. Practical application to the Bitcoin blockchain
The Bitcoin blockchain is an ideal platform for implementing the described methods for several reasons:
- Public data availability. All transactions, including signatures (r, s) and message hashes h , are recorded in an open distributed ledger. Any researcher can collect millions of signatures without any active effort.
- Historical diversity of implementations. Over the years, Bitcoin has been used with a wide variety of wallets and libraries, from early versions of Bitcoin Core to mobile apps and hardware wallets. Many of these wallets contained bugs in nonce generation.
- Financial incentive. Recovering a private key means gaining control over the funds at the corresponding address, which creates a strong incentive to find vulnerabilities.
Breitner and Heninger (2019) analyzed approximately 230 signatures in the Bitcoin blockchain and successfully recovered approximately 300 private keys used with nonces of 64, 110, 128, and 160 bits instead of the expected 256 bits.[reference:18][reference:19] They also found keys whose nonces shared common prefixes or suffixes, which further enabled the application of lattice methods.
From a probabilistic analysis perspective, each of these vulnerabilities corresponds to a specific deviation of the distribution k from uniformity. For example, if a nonce is generated as a 64-bit number, the probability of it falling in the range [0, 2 64 − 1] is 1, and the probability of it falling in the rest of [0, n − 1] is 0. This extreme bias is easily detected by statistical tests and exploited by lattice algorithms.
Important: All described attacks are passive and do not require network intervention. However, using them on someone else’s keys without the owner’s express permission is illegal. This material is provided for educational and research purposes only.
8. Conclusion
Probability theory, systematized in O. B. Sheinin’s seminal work, provides a powerful conceptual and methodological framework for ECDSA cryptanalysis. Key probabilistic ideas—uniform distribution, bias, limit theorems, and statistical hypothesis testing—underlie both Bleichenbacher’s statistical attack and lattice methods, which reduce the problem to a hidden number problem.
Practical application of these methods to the Bitcoin blockchain has demonstrated their high effectiveness: hundreds of private keys have been recovered through passive analysis of public data. This highlights the critical importance of correct nonce generation and the use of deterministic signature schemes (e.g., RFC 6979), which completely eliminate the possibility of such attacks[reference:20].
Thus, Sheinin’s book turns out to be not just a historical monument, but a living source of ideas directly applicable to solving current problems in cryptanalysis and cybersecurity.
9. Directions for further research for cryptanalysis based on this area
The development of probabilistic and statistical methods for ECDSA cryptanalysis opens up several promising directions:
- Adaptive statistical attacks with learning. Using machine learning methods to automatically identify hidden patterns in the nonce distribution without a priori knowledge of the bias type. Neural networks and Bayesian methods can detect complex, multivariate biases that are undetectable by classical statistics.
- Hybrid statistical-lattice methods. Combining statistical estimation (for pre-selection of candidates d and bounds estimation B ) with lattice algorithms (for accurate reconstruction). This can reduce both data requirements and computational complexity.
- Analysis of correlations between consecutive nonces. If a random number generator has hidden dependencies (e.g., a linear congruential generator with poor parameters), probabilistic Markov chain and time series models can exploit these dependencies even in the absence of obvious bias in the marginal distribution.
- Application of large deviation theory. Estimating the probabilities of rare events (for example, the occurrence of a nonce with an extremely small value) can provide new criteria for detecting vulnerable keys in large data sets.
- Quantum-resistant cryptanalysis of ECDSA. Although quantum computing itself poses a threat to ECDSA via Shor’s algorithm, probabilistic methods can be used to analyze transition periods when quantum computers are not yet capable of solving the discrete logarithm problem but can provide partial information about the nonce.
- Extension to Schnorr and MuSig signatures. The Schnorr scheme used in Bitcoin’s Taproot protocol is also sensitive to nonce bias. Probabilistic methods developed for ECDSA can be adapted to Schnorr and multisig signatures, where nonces are generated aggregately.
- Statistical analysis of side-channel leaks. Probabilistic models can be used to interpret data obtained through side channels (execution time, power consumption, electromagnetic radiation), allowing one to estimate the probability of a successful attack and the required number of measurements.
These areas are at the intersection of probability theory, algebra, number theory, and practical cryptography, and their development will contribute to both deepening fundamental knowledge and improving the security of real cryptosystems.
