Despite its educational nature, Korshunov and Foss’s book of problems provides a full range of probabilistic tools necessary for formalizing and solving the hidden number recovery problem in ECDSA. Key sections—the theory of random variables, limit theorems, martingales, and random processes—allow one to:
- construct probabilistic models of nonce distribution and estimate their parameters;
- justify statistical methods for detecting bit bias and leakage;
- analyze the effectiveness of cryptanalysis algorithms (Fourier analysis, lattice attacks) in terms of the probability of success and the required amount of data;
- apply these methods to real Bitcoin blockchain data to recover private keys.
Thus, probability theory is not just an auxiliary discipline, but a fundamental basis for modern ECDSA cryptanalysis, especially in the context of nonce generation flaws.
Content
- 1. Introduction and statement of the problem
- 2. Theoretical basis: sections of the Korshunov-Foss problem book
- 3. Probabilistic nonce model in ECDSA
- 4. Hidden Number Problem
- 5. Methods for recovering a private key
- 6. Practical application to Bitcoin transactions
- 7. Conclusion
- 8. Directions for further research for cryptanalysis based on this area
1. Introduction and statement of the problem
The ECDSA (Elliptic Curve Digital Signature Algorithm) digital signature scheme underpins transaction security on the Bitcoin blockchain. A critical element of ECDSA is a one-time random number (nonce). , unique for each signature. If turns out to be weak—reused, partially leaked, or misplaced—an attacker can recover the long-term private key , signing transactions.
The book by D. A. Korshunov and S. G. Foss, “Collection of Problems and Exercises in Probability Theory” (Novosibirsk, 1997)[reference:0] contains 909 problems on key topics in probability theory and random processes[reference:1]. Although the book is not directly devoted to cryptography, its sections provide the fundamental mathematical apparatus necessary for constructing probabilistic models of attacks on ECDSA.
The purpose of this paper is to show how the sections of the problem book are applied to the formalization of the hidden number recovery problem and, therefore, the private key , and also demonstrate practical algorithms that implement these ideas on real Bitcoin blockchain data.
2. Theoretical basis: sections of the Korshunov-Foss problem book
The structure of the problem book includes the following key parts relevant to ECDSA cryptanalysis[reference:2]:
| Part of the problem book | Content | Application in ECDSA cryptanalysis |
|---|---|---|
| Part I. Probability Space | Operations on events, classical definition of probability, geometric probability | Modeling the space of possible nonces; estimating the probability of repetition or falling within a given interval |
| Part II. Conditional Probabilities and Independence | Conditional probability, independent events, Bernoulli scheme, formula of total probability, Bayes’ formula | Bayesian inference about meaning based on observed signatures; estimating the conditional probability of nonce bit leakage |
| Part III. Random variables and distributions | Distribution functions, joint distribution, moments, characteristic functions, generating functions | Distribution modeling ; calculating the moments (mean, variance) of a biased nonce; characteristic functions for Fourier analysis |
| Part IV. Convergence of random variables | Convergence almost certainly, convergence in probability, weak convergence, convergence of means | Justification of the statistical consistency of the estimates with an increase in the number of signatures |
| Part V. The Law of Large Numbers | Independent identically distributed terms, dependent terms | Estimating the number of signatures required for reliable recovery |
| Part VI. Limit Theorems | Central Limit Theorem, Numerical Exercises | Asymptotic analysis of the error distribution in lattice attacks |
| Part VII. Markov Chains | Transition probabilities, classification of states, ergodicity | Modeling nonce sequences in pseudorandom number generators |
| Part VIII. Conditional Expectation. Martingales | Conditional expectation, martingales | Analysis of “fair games” in bit guessing ; construction of optimal strategies |
| Part IX. Random Processes | General properties, Wiener process, Poisson process, linear theory of random sequences | Nonce time series modeling; autocorrelation estimation |
3. Probabilistic nonce model in ECDSA
In ECDSA signature for a message with a hash calculated using the formulas:
Where — order of the base point , — private key, — nonce, which must be uniformly distributed over the segment .
If has an offset, for example, senior bits are equal to zero, then This means that can be written as With Then the signature equation is transformed to the form:
This is an instance of a hidden numerical problem (HNP), where the unknowns are and small .
From a probability theory perspective, the observed signatures can be viewed as a sample from the joint distribution The task of a cryptanalyst is to evaluate for implementation , using knowledge of the distribution The sections of the problem book devoted to conditional probabilities and Bayes’ formula allow one to formalize the posterior distribution . given the given data.
4. Hidden Number Problem
The HNP introduced by Boneh and Venkatesan is formulated as follows. Given a modulus and a sequence of pairs , Where
with an unknown and small errors . Need to find In the context of ECDSA:
provided that small (shifted).
The Korshunov-Foss problem book provides tools for analyzing statistical properties :
- Moments (§11) allow us to calculate the mathematical expectation and variance , which is directly related to the “quality” of the displacement.
- Characteristic functions (§12) form the basis of Fourier analysis for HNP.
- The law of large numbers (§19–21) justifies the convergence of sample estimates to true values as the number of signatures increases.
5. Methods for recovering a private key
5.1 Nonce Reuse
If there are two messages signed with the same , That:
This case is deterministic and does not require probabilistic methods. However, in real blockchains, such incidents occur due to errors in random number generators [reference:3]. The probability of a coincidence with random generation it is negligible, but when using deterministic schemes (for example, RFC 6979 with errors) it is possible.
5.2 Biased nonces and limit theorems
A more common scenario is nonce offsetting , when is not uniform, but, for example, has zero high-order bits. In this case, a statistical approach is applied.
Let — independent random variables with a known distribution shifted from the uniform one. Then the signature equation can be rewritten as:
Let us denote , . Then:
This is a system of linear comparisons with small errors. To solve it, methods based on the central limit theorem (Section VI of the problem book) are used: with a large number of signatures, the distribution of the sum of errors approaches normal, which allows us to estimate least squares method in modular arithmetic.
Estimating the number of signatures required can be obtained from Chebyshev’s inequality or the law of large numbers. For example, if have zero seniors bits, then the standard deviation proportionally , and to achieve the specified accuracy it is required signatures[reference:4].
5.3. Fourier analysis based on probability estimates
Bleichenbacher’s method uses characteristic functions (Section III, §12) to reconstruct . The idea is as follows. Consider the function
If , then the arguments of the exponents are close to , which are small, and the imaginary part of the sum has an anomalously high absolute value. Thus, the problem is reduced to finding the peak of the Fourier spectrum on the set .
The probabilistic analysis of this method is based on the Bernstein–Hoeffding inequality and the central limit theorem : for large random variable For is distributed asymptotically normally with zero mean, and for has a bias proportional to the probability of hitting into a small interval[reference:5]. This allows one to select the detection threshold and estimate the probability of error.
5.4 Lattice attacks and the role of martingales
Lattice attacks (LLL, BKZ) construct a lattice containing a vector corresponding to the true and small The lattice matrix has the form:
Where — scaling parameter. The desired vector is short if are small. Lattice reduction algorithms find this vector.
Probabilistic analysis of the success of lattice attacks uses martingales (Section VIII of the problem book). The process of finding a short vector can be viewed as a martingale: the conditional mathematical expectation of the “distance” to the true vector at each reduction step is equal to the previous value. This allows one to estimate the probability of success and the required number of signatures. In addition, Markov chains (§24–25) are used to model nonce sequences generated by deterministic algorithms (e.g., RFC 6979), where each subsequent depends on the previous one.
6. Practical application to Bitcoin transactions
Let’s look at a step-by-step algorithm for recovering a private key based on real blockchain data.
Step 1: Data Collection
All transactions containing ECDSA signatures for the same public key (or address) are extracted from the blockchain. For each signature, .
Step 2: Anomaly Detection
Checking for duplicates . If For , then the nonce is reused, and the private key is calculated directly using the formulas in Section 5.1. This analysis reveals hundreds of vulnerable keys in Bitcoin[reference:6].
Step 3. Estimating nonce bias
If there are no repetitions, the statistics are calculated And Then the hypothesis is tested that have a small value. For this purpose, one can use the chi-square goodness-of-fit test (Section VI) or estimate the empirical distribution function under various assumptions about .
Step 4. Applying probabilistic algorithms
Depending on the nature of the displacement, the method is selected:
- Fourier analysis (Section 5.3) is effective when the number of known bits is small (1–2 bits) and the number of signatures is large ().
- Lattice attacks (Section 5.4) – work with larger offsets (4-8 bits) and smaller ones (tens-hundreds of signatures).
- The least squares method in modular arithmetic is used when the bias can be described by a normal distribution (a consequence of the central least squares theory).
Step 5. Verification
Found candidate The key is verified by generating a signature for a known message and comparing it with the original signature from the blockchain. If the signature matches, the key has been recovered correctly.
A practical example. In the paper “Biased Nonce Sense,” the authors analyzed the Bitcoin, Ethereum, and Ripple blockchains and recovered approximately 300 Bitcoin private keys using lattice attacks based on HNP [reference:7]. The total computation time was approximately 40 CPU years, demonstrating the practical feasibility of the approach.
7. Conclusion
Despite its educational nature, Korshunov and Foss’s book of problems provides a full range of probabilistic tools necessary for formalizing and solving the hidden number recovery problem in ECDSA. Key sections—the theory of random variables, limit theorems, martingales, and random processes—allow one to:
- construct probabilistic models of nonce distribution and estimate their parameters;
- justify statistical methods for detecting bit bias and leakage;
- analyze the effectiveness of cryptanalysis algorithms (Fourier analysis, lattice attacks) in terms of the probability of success and the required amount of data;
- apply these methods to real Bitcoin blockchain data to recover private keys.
Thus, probability theory is not just an auxiliary discipline, but a fundamental basis for modern ECDSA cryptanalysis, especially in the context of nonce generation flaws.
8. Directions for further research for cryptanalysis based on this area
- Developing probabilistic models of nonce leakage. The problem set considers classical distributions (normal, Poisson, binomial). In real-world ECDSA implementations, leakage can have a complex structure (e.g., dependence on time or energy consumption). Constructing martingale leakage models will allow for more accurate estimation of the residual nonce entropy.
- Applying Markov chains to nonce generators. Deterministic generators (RFC 6979) produce sequences , which can be modeled as a Markov chain with a known transition probability matrix. Analysis of ergodicity and the rate of convergence to a stationary distribution will help identify hidden biases.
- Bayesian methods for private key estimation. Using Bayes’ formula (Section II) to construct a posterior distribution taking into account a priori knowledge about the distribution This will allow us to move from point estimates to interval estimates and increase the reliability of cryptanalysis.
- Limit theorems for estimating the number of signatures. Exact estimates of the required number of signatures. to achieve a given probability of success under various types of bias. Application of the central limit theorem and concentration inequalities (Chernoff, Hoeffding) to obtain asymptotically tight bounds.
- Analysis of random processes in side-channel attacks. Modeling time series of energy consumption or electromagnetic radiation as random processes (Section IX). This will allow us to develop optimal filters for extracting nonce information from noisy measurements.
- Cryptanalysis Based on Information Theory. Although the book does not cover information theory directly, the sections on characteristic functions and moments are closely related to entropy and mutual information. Estimating the amount of information about , contained in the signatures, will allow us to determine the theoretical limits of attacks.
- Automated detection of vulnerable transactions in the blockchain. Developing algorithms that scan the blockchain in real time, apply probabilistic tests for nonce bias, and automatically launch appropriate attacks. This requires efficient implementation of statistical criteria and lattice reduction methods.
This document is based on an analysis of the problem book by D. A. Korshunov and S. G. Foss (1997) and modern works on ECDSA cryptanalysis. All formulas and statements are provided for educational purposes.
