Application of probability theory from W. Feller’s book: “Introduction to Probability Theory and Its Applications” (Volume 1) to the cryptanalysis of ECDSA in Bitcoin transactions

22.10.2026

Abstract.  This paper presents a systematic study of the applicability of the probabilistic framework outlined in W. Feller’s classic Introduction to Probability Theory and Its Applications (Volume 1, Moscow: Mir, 1984) to the cryptanalysis of an ECDSA signature on the Bitcoin blockchain for private key recovery. This paper examines the theoretical foundations of the statistical heterogeneity of nonce values, the derivation of the Hidden Number Problem (HNP), probabilistic estimates of the stability of lattice and Fourier attacks, and practical implications for assessing the security of cryptocurrency transactions. The analysis demonstrates that  Volume 1 of W. Feller’s Introduction to Probability Theory and Its Applications  is not only a classic textbook but also  a fundamental tool  for a cryptanalyst working with ECDSA on the Bitcoin blockchain.

The main results of applying Feller’s probabilistic apparatus to the problem of ECDSA private key recovery are:

  1. Formalization of nonce bias.  The sample space, conditional probability, and binomial model allow us to rigorously describe the deviation of the nonce distribution from uniformity and quantify its impact on security.
  2. Estimating the required number of signatures.  The normal approximation of the binomial distribution and the law of large numbers provide lower bounds on the sample size for statistically significant detection of bias.
  3. Reduction to HNP.  The key recovery problem is reduced to the likelihood function maximization problem, which is a straightforward application of probabilistic estimation.
  4. Probability bounds on lattice attacks.  Gaussian heuristics and analysis of the distribution of nonce sums and differences allow us to predict the success of lattice reduction depending on the lattice dimension and the magnitude of the offset.
  5. Fourier analysis.  Characteristic functions and Feller generating functions form the basis of the Bleichenbacher algorithm and its modern modifications (LadderLeak, 4-list sum).

Content

  1. Introduction: Statement of the Problem
  2. The theoretical apparatus of Feller’s book
  3. ECDSA Mathematical Model and Nonce Vulnerability
  4. Probabilistic analysis of nonce bias
  5. Reduction to a hidden numerical problem (HNP)
  6. Lattice attacks: probabilistic bounds and estimates
  7. Fourier analysis: the probabilistic nature of Bleichenbacher’s algorithm
  8. Practical aspects and examples from the Bitcoin blockchain
  9. Conclusion
  10. Directions for further research for cryptanalysis based on this area

1. Introduction: Problem Statement

The ECDSA (Elliptic Curve Digital Signature Algorithm) signature underpins the security of Bitcoin and many other cryptocurrencies. A critical element of the scheme is  a one-time secret parameter  —a nonce (usually denoted  k ), which must be uniformly randomly generated and never repeated. Violating this requirement—by misalignment, bit leakage, or reuse—allows an attacker to recover the long-term private key.

The cryptanalytic problem in this context is formulated as follows: given a set of observed signatures  (r i , s i )  and message hashes  H(m i ) , created using the same private key  d , but with  nonuniformly distributed  nonces  k i , recover  d . Probability theory becomes the key tool here   —and it is Volume 1 of Feller’s book that provides the fundamental apparatus that allows us to rigorously describe the bias, estimate the probability of an attack’s success, and derive the necessary bounds.

This document is not a guide to unauthorized access. All methods are discussed solely in an academic context—for assessing the strength of cryptographic implementations and developing countermeasures.

2. Theoretical apparatus of Feller’s book

The first volume of Feller’s work is devoted to discrete distributions and lays a probabilistic foundation that later proves directly applicable to the analysis of ECDSA[reference:0]. Let’s consider the key sections relevant to our problem.

2.1. The space of elementary events and discrete probabilities (Chapter I)

Feller introduces the concept  of a space of elementary events  and defines probability as a finitely additive measure on this space [reference:1]. In the context of ECDSA, an elementary event is the choice of a specific nonce value  k  from the set  Z q  (where  q  is the order of the base point of the elliptic curve). If the nonce generator is perfect, the probability of each value is  1/q . The deviation from uniformity is  the bias , which is formally described as the deviation of the empirical distribution from uniformity.

2.2 Conditional Probability and Independence (Chapter V)

The conditional probability  P(A|B) = P(A∩B)/P(B)  is a central concept in leakage analysis. If the high-order bit of a nonce  k is known  to be zero with probability  p > 1/2 , this means that the conditional distribution  of k  for a given observation differs from the unconditional one. Feller emphasizes that  the stochastic independence  of successive nonce values ​​is a critical assumption [reference:2]; its violation (for example, by using a deterministic generator with a short period) radically simplifies the attack.

2.3 Binomial and Normal Distributions (Chapters VI–VII)

Let each nonce  k i  have probability  p  of falling in a “biased” region (e.g., the upper half of the range). Then the number of “biased” nonces among  n  signatures follows the binomial distribution  B(n, p) . Feller thoroughly explores the normal approximation of the binomial distribution (the Moivre-Laplace theorem) [reference:3], which allows one to estimate how many signatures are needed to statistically significantly detect bias. This  directly determines  the sample size requirements for a cryptanalytic attack.

2.4. Laws of Large Numbers (Chapter X)

The law of large numbers guarantees that as  n → ∞,  the sample mean converges to the expected value. In the context of ECDSA, this means that if nonces are biased, then  sample statistics  (e.g., the mean of the most significant bits) will converge to some value different from that expected for a uniform distribution. This creates  an observable signal , which can be used to recover the key.

2.5. Generating functions and characteristic functions (Chapter XI)

Generating functions allow us to compactly describe the distributions of sums of independent random variables. In the Fourier attack on ECDSA (see Section 7), characteristic functions are used to estimate the probability of success when combining signatures [reference:4]. Feller provides a rigorous justification for why the convolution of distributions corresponds to the product of generating functions—and this directly transfers to the analysis of sums  k i  + k j  in lattice constructions.

The key takeaway from this section is that  Feller’s Volume 1 provides a complete probabilistic toolkit for formally describing nonce bias, estimating the required number of signatures, analyzing the distributions of nonce sums and differences, and rigorously deriving the bounds of attack applicability.

3. ECDSA Mathematical Model and Nonce Vulnerability

3.1 Signature Generation Algorithm

Let  E  be an elliptic curve over a finite field  F p ,  G  be a base point of order  q ,  d  be a private key, and  H  be a cryptographic hash function. To sign a message  m :

1. Choose a random nonce k ∈ Z_q. 2. Calculate the point R = [k]G = (x_R, y_R). 3. r = x_R mod q. 4. s = k⁻¹ · (H(m) + r · d) mod q. 5. Signature: (r, s).

From step 4 follows a linear relationship modulo  q :

s k ≡ H(m) + r d (mod q)

or, equivalently:

k = s⁻¹ · H(m) + s⁻¹ · r · d (mod q)

Let us denote  t = s⁻¹ · r mod q  and  u = s⁻¹ · H(m) mod q . Then:

k ≡ u + t · d (mod q) (1)

This equation is  the fundamental relationship linking the observed quantities  (r, s, H(m))  with the unknowns  k  and  d .

3.2. The nature of vulnerability

If nonce  k  is chosen uniformly at random from  Z q , then equation (1) provides no information about  d : for any  d ,  there is exactly one value of  k satisfying the equation. However, if  k  is not  uniform—for example, if its high-order bits are biased, or if it is generated by a generator with a short period—then the distribution  of k  becomes  nonuniform , and this imposes statistical constraints on the possible values  ​​of d .

Nonce vulnerability classes documented in the literature:

Vulnerability classDescriptionProbabilistic model
Reusing a nonceThe same k for two different messagesDegenerate distribution (δ-function)
Shift of the most significant bitsThe most significant ℓ bits of k are either zero or onek ∈ [0, 2 n-ℓ ) with probability p ≫ 1/q
Short noncek is generated from a low power subsetk ∈ S, |S| ≪ q
Side-channel leakagePartial information about k (e.g. through energy consumption)Conditional distribution P(k | observation)
Deterministic nonce (RFC 6979)k = f(d, m) is a deterministic functionLack of randomness; vulnerability to compromise f

Even an offset  of less than one bit  (e.g. the most significant bit of k is zero with probability 0.51 instead of 0.5) may be sufficient to recover the key given enough signatures[reference:5].

4. Probabilistic analysis of nonce bias

4.1 Formal definition of bias

Let  k 1 , k 2 , …, k n  be a sequence of nonces used to sign  n  messages. Denote by  K  a random variable uniformly distributed over  Z q . We say that the sequence has  bias if the empirical distribution  of k i  is statistically significantly different from the uniform distribution.

Let’s introduce the indicator function:

X_i = 1 if k_i ∈ B (shifted region), X_i = 0, otherwise.

where  B ⊂ Z q  is some subset corresponding to the vulnerability (for example, the set of values ​​with zero high-order bits). Then  X i  are independent identically distributed Bernoulli random variables with parameter  p = P(K ∈ B) .

4.2 Binomial model and estimation of the number of signatures

The number of “biased” nonces  S n  = X 1  + … + X n  has a binomial distribution  B(n, p) . According to Feller, for large  n :

P(S_n = k) ≈ (1/√(2πnp(1-p))) exp(−(k − np)² / (2np(1-p)))

To detect a bias, the observed number of hits in B must   be statistically significantly greater than  np₀ , where  p₀ = |B|/q  is the probability under a uniform distribution. Using the normal approximation, the required number of signatures  n  to achieve a significance level  of α  and a power of  1−β is:

n ≥ (z_{1−α}√(p₀(1−p₀)) + z_{1−β}√(p(1−p)))² / (p − p₀)²

For example, for  p₀ = 1/2 ,  p = 0.51  (bias 1%),  α = 0.01 ,  β = 0.1 :

n ≥ (2.33 · 0.5 + 1.28 · 0.5)² / (0.01)² ≈ (1.805)² / 0.0001 ≈ 32580

This means that detecting a 1% bias requires approximately 32,000 signatures. This is  the lower bound  for a statistical attack; lattice attacks can work with significantly smaller samples due to the use of a more sophisticated algebraic structure.

4.3. Laws of large numbers and convergence of sample statistics

By the strong law of large numbers (Borel’s theorem, which Feller discusses in Chapter X):

(1/n) Σ_{i=1}^{n} X_i → p almost surely as n → ∞.

This means that in the presence of bias, the sample fraction of “biased” nonces will converge to  p ≠ p₀ , making the bias  asymptotically detectable . However, the rate of convergence is determined by the variance  p(1−p)/n , which sets a lower bound on the required number of observations.

4.4 Distribution of sums and differences of nonce

In lattice attacks,   nonce  differences play a key role: k i  − k j . If  k i  and  k j  are independent and identically distributed, then the distribution of the difference is the convolution of the distribution of  k  with its reflection. Feller provides a framework of generating functions for analyzing such convolutions [reference:6]:

G_{k_i − k_j}(z) = G_{k_i}(z) G_{k_j}(z⁻¹)

If  k i  is biased (e.g., concentrated in the upper half of the range), then the difference  k i  − k j  will have  a double-humped  distribution with maxima near  ±q/4 . This structure is used to construct lattices in which the desired vector  d  is “short”.

5. Reduction to a hidden numerical problem (HNP)

5.1. HNP setting

The problem of recovering a private key  d  from a set of signatures with biased nonces reduces to  the Hidden Number Problem  (HNP), first formulated by Boneh and Venkatesan[reference:7]. Formally:

Given  n  pairs  (t i , a i ) , where  t i  ∈ Z q  are known and  a i  = (k i  − u i ) · t i ⁻¹ mod q  contain information about  d . It is required to find  d  such that:

|k_i − u_i − t_i · d|_q ≤ B for all i,

where  |·| q  denotes the distance modulo  q , and  B  is the bias bound (e.g.,  B = 2 n−ℓ with ℓ  high order bits  leaked  ).

5.2 Probabilistic interpretation

Equation (1) can be rewritten as:

k_i = u_i + t_i d + q z_i, z_i ∈ Z.

The condition  k i  ∈ B  is equivalent to the fact that the quantity  (u i  + t i  · d) mod q  falls into  B . The probability of this event for a given  d  is:

P(B | d) = (1/q) |{ k ∈ Z_q : k = u_i + t_i d mod q, k ∈ B }|

For a true  d,  this probability is  p > p₀ ; for a false  d’  , it is approximately  p₀ . Thus, the problem is reduced to  finding the maximum of the likelihood function :

L(d) = Π_{i=1}^{n} P(k_i ∈ B | d)

or, in logarithmic form, to find  d that maximizes:

Σ_{i=1}^{n} log P(k_i ∈ B | d)

This is  a direct application  of probability theory: the cryptanalysis problem is formulated as a statistical estimation problem.

The reduction of ECDSA to HNP demonstrates the fundamental role of probabilistic analysis: it is the assumption of  non-uniform  distribution of nonce (i.e., deviation from the probabilistic model of an ideal generator) that makes the problem solvable.

6. Lattice attacks: probabilistic bounds and estimates

6.1. Construction of the lattice

The Lattice attack on ECDSA (Howgrave-Graham–Smart, Nguyen–Shparlinski) constructs a lattice of dimension  n+1 :

L = { (x_1, …, x_n, y) ∈ Z^{n+1} : x_i ≡ t_i · y (mod q) for all i, |x_i| ≤ B, |y| ≤q}

The desired vector  (k 1  − u 1 , …, k n  − u n , d)  belongs to this lattice and is “short” — its norm is bounded by  √(nB² + q²) . The problem reduces to finding the shortest vector (SVP) or the nearest vector problem (CVP) in the lattice [reference:8].

6.2. Probabilistic assessment of success

The success of a lattice attack depends on  the ratio  of the displacement bound  B  to the modulus  q  and on the lattice dimension  n . According to the Gauss heuristic, for a lattice of dimension  D = n + 1  with determinant  det(L) ≈ q n ,  the expected length of the shortest vector is:

λ_1(L) ≈ √(D / (2πe)) (det L)^{1/D} ≈ √((n+1)/(2πe)) q^{n/(n+1)}

The attack is successful if the norm of the desired vector  v = (k 1 − u 1 , …, k n − u n , d)  is less than  λ 1 (L) . Since  |k i  − u i | ≤ B  and  |d| < q , we have:

||v|| ≤ √(nB² + q²)

Success condition:

√(nB² + q²) < √((n+1)/(2πe)) q^{n/(n+1)}

For  B ≪ q  (strong bias), this inequality holds already for small  n . For  B ≈ q/2 ℓ ( ℓ  bits   leaked  ) , n ∼ O(ℓ)  signatures are required [reference:9].

6.3 Experimental data and probability thresholds

Modern results (Albrecht–Heninger, Eurocrypt 2021) show that for the 256-bit ECDSA curve:

Leak (bit)Min. number of signaturesProbability of successMethod
4 bits~20> 99%BKZ 2.0
3 bits~40> 95%BKZ 2.0 / G6K
2 bits~100> 90%G6K + predicate screening
1 bit~1000–2000~50–80%Fourier analysis (LadderLeak)
< 1 bit~10 6~1%Fourier + 4-list sum

These data clearly demonstrate  the probabilistic nature  of the attack: the number of required signatures grows exponentially as the leakage decreases, which follows directly from the laws of probability theory (concentration of measure, large deviations).

7. Fourier analysis: the probabilistic nature of Bleichenbacher’s algorithm

7.1. Fourier attack idea

An alternative to the lattice approach is  Fourier analysis , proposed by Bleichenbacher and developed by Aranha et al. (LadderLeak, CCS 2020)[reference:10]. The idea is to use  the characteristic functions  of the nonce distribution.

Let  φ(t) = E[e 2πi tk / q ]  be the characteristic distribution function of the nonce. If  k  is uniformly distributed over  Z q , then  φ(t) = 0  for all  t ≠ 0 . In the presence of bias,  φ(t) ≠ 0  for some  t , and these “nonzero frequencies” carry information about  d .

7.2 Algorithm and probability estimates

Bleichenbacher’s algorithm constructs estimates of the form:

S(t) = Σ_{i=1}^{n} exp(2πi t (u_i + t_i d) / q)

For a true   d  , |S(t)|  tends to be maximum at certain  t . The problem reduces to finding  d that maximizes the sum:

Σ_{t ∈ T} |S(t)|²

A probabilistic analysis of this algorithm requires estimating the distribution of the sum of independent complex random variables, which again refers us to the central limit theorem and Feller generating functions[reference:11].

7.3. Decrease in the number of signatures

Recent results (SAC 2024) show that using  the 4-list sum algorithm  the number of required signatures can be reduced:

  • by 1/2 for 1 bit leakage;
  • by 1/4 for leakage of 2 or more bits[reference:12].

This is achieved by taking into account more accurately  the actual distribution  of nonce sums, which is a direct application of combinatorial analysis and probability theory.

8. Practical aspects and examples from the Bitcoin blockchain

8.1. Real attacks

In Breitner and Heninger’s (2019) paper “Biased Nonce Sense,” approximately 300 Bitcoin private keys were recovered   using lattice attacks on biased nonce signatures.[reference:13] The vulnerabilities discovered included:

  • nonces generated using  short  values ​​(e.g. 64-bit instead of 256-bit);
  • nonce with zero high-order bits due to errors in the generator implementation;
  • nonce reuse in earlier versions of wallets (e.g. due to a library bug  libsecp256k1 or Android SecureRandom).

8.2. Probabilistic risk assessment

To assess the risk of a specific transaction it is necessary:

  1. Collect  n  signatures created by one key.
  2. Compute the sample statistics of the distribution  (u i  + t i  · d) mod q  for test values  ​​d .
  3. Apply the chi-square test or the Kolmogorov–Smirnov test to test the hypothesis of uniformity.
  4. Estimate the probability  p  of falling into the shifted region and the required number of signatures to recover the key.

8.3. Countermeasures and their probabilistic assessment

CountermeasureProbability effect
RFC 6979 (deterministic nonce)Eliminates randomness; vulnerability only occurs when the hash function or key is compromised
Double hashing nonceIncreases entropy; reduces the probability of displacement
Checking nonce for a rangeCuts off degenerate values; reduces  p  to  p₀
Using hardware RNG with certificationGuarantees uniformity with high probability

Even when using RFC 6979, there remains a risk of side-channel leaks that could reveal partial information about  k . A probabilistic analysis of LadderLeak shows that leaking  less than one bit  (the most significant bit with a probability of 0.51) may be sufficient to recover the key given ~10 6  signatures [reference:14].

Conclusion

The analysis conducted demonstrates that  Volume 1 of W. Feller’s book “Introduction to Probability Theory and Its Applications”  is not only a classic textbook, but also  a fundamental tool  for a cryptanalyst working with ECDSA in the Bitcoin blockchain.

The main results of applying Feller’s probabilistic apparatus to the problem of ECDSA private key recovery are:

  1. Formalization of nonce bias.  The sample space, conditional probability, and binomial model allow us to rigorously describe the deviation of the nonce distribution from uniformity and quantify its impact on security.
  2. Estimating the required number of signatures.  The normal approximation of the binomial distribution and the law of large numbers provide lower bounds on the sample size for statistically significant detection of bias.
  3. Reduction to HNP.  The key recovery problem is reduced to the likelihood function maximization problem, which is a straightforward application of probabilistic estimation.
  4. Probability bounds on lattice attacks.  Gaussian heuristics and analysis of the distribution of nonce sums and differences allow us to predict the success of lattice reduction depending on the lattice dimension and the magnitude of the offset.
  5. Fourier analysis.  Characteristic functions and Feller generating functions form the basis of the Bleichenbacher algorithm and its modern modifications (LadderLeak, 4-list sum).

The practical significance of this approach is confirmed by real-world attacks on the Bitcoin blockchain: hundreds of private keys were recovered using probabilistic analysis of nonce biases. This underscores the critical importance  of  uniform nonce generation and the need for probabilistic auditing of cryptographic implementations.

Thus, Feller’s probability theory is an integral part of the modern cryptanalyst’s arsenal, and its application to ECDSA demonstrates the deep connection between classical mathematics and the practical security of cryptocurrency systems.

Directions for further research for cryptanalysis based on this area

  1. Bayesian Key Recovery Methods.  Developing a Bayesian approach to HNP using posterior distributions on the private key space. This will allow for the integration of heterogeneous information sources (different types of bias, side-channel data, partial leaks from different transactions) into a single probabilistic model.
  2. Rare Event Analysis and Large Deviation Theory.  Applying Large Deviation Theory to estimating the success rate of attacks with extremely small offsets (less than 0.1 bits). This requires developing asymptotic estimates that go beyond the central limit theorem discussed by Feller.
  3. Markov Models of Nonce Generators.  A study of pseudorandom number generators (PRNGs) from the perspective of Markov chains (Chapter XV of Volume 1 by Feller). Many real-world PRNGs have hidden Markov dependencies that can create  correlated  biases in successive nonces. Probabilistic analysis of such correlations opens new attack vectors.
  4. Multivariate distributions and copulas.  Generalizing the analysis to the case where the bias affects not a single bit, but the joint distribution of several nonce bits. Using copulas and multivariate characteristic functions to describe complex dependencies between bits.
  5. Adaptive learning attacks. Developing adaptive algorithms that learn from observed data  during signature collection   and refine the probabilistic bias model. This combines cryptanalysis with machine learning and statistical inference techniques.
  6. Probabilistic Analysis of Quantum Threats.  Assessing how quantum algorithms (Shor’s algorithm, Grover’s algorithm) change the probabilistic boundaries of attacks on ECDSA. This requires reconsidering classical probabilistic models in the context of quantum computing.
  7. Application to other cryptosystems.  Transferring Feller’s probabilistic framework to bias analysis in Schnorr and EdDSA schemes, as well as in protocols with partial secret leakage (e.g., TLS 1.3, Signal, and post-quantum lattice schemes).
  8. Statistical tests for auditing cryptographic libraries.  Developing a set of probabilistic tests (based on chi-square, Kolmogorov–Smirnov, and entropy tests) that can automatically detect anomalies in nonce generation at early stages, before vulnerability exploitation.
  9. Information-theoretic bounds.  Using information theory (Shannon entropy, mutual information) in combination with Feller’s probabilistic methods to derive  lower bounds  on the amount of information about a key required to recover it. This will allow us to rigorously determine the minimum offset that is considered “safe.”
  10. Chain reaction analysis in blockchain.  A study of how a single key vulnerability (due to nonce drift) can lead to cascading compromises in smart contracts, multi-signature systems, and decentralized finance (DeFi). Probabilistic modeling of such cascades is a new field at the intersection of probability theory and blockchain security.

The document was prepared based on the analysis of the book: Feller V. Introduction to Probability Theory and Its Applications: in 2 volumes. Vol. 1. – Moscow: Mir, 1984. – 527 p.
As well as modern works on ECDSA cryptanalysis (Breitner–Heninger, 2019; Aranha et al., 2020; Albrecht–Heninger, 2021; Osaki–Kunihiro, 2024).