Kleptographic ECDSA Leaks in Offline Bitcoin Wallets and Post-Quantum Migration: A Verifiable Study of Nonce Trust

04.11.2026

A research paper explores the paradox that a “perfectly isolated” offline Bitcoin wallet can reveal a private key without using the network and without leaving the usual side-channel traces. The reason is the kleptographic choice of nonce  k in ECDSA. The paper connects this classic risk to the broader topic of quantum migration: post-quantum algorithms eliminate the future Shor threat, but do not eliminate the need for verifiable generation of secret signature parameters. Stefan Verbüchelen’s preprint  “How Perfect Offline Wallets Can Still Leak Bitcoin Private Keys”  (2015) shows that the nondeterministic choice  k in ECDSA allows for a kleptographic attack: a malicious wallet implementation can embed a covert channel in two consecutive signatures such that an outside observer cannot distinguish the signatures from regular ones, and an attacker with the secret key can  k then recover the Bitcoin private key. This paper translates this result into a verifiable research framework: it formulates the central question, hypotheses, and refutation criteria, analyzes the attack mechanism, limitations, and countermeasures, and links the work to issues of post-quantum migration. We demonstrate that the risk of kleptography and future quantum risk are distinct threats; they cannot be confused, but both require a provably verifiable implementation and a fair resource model. The novelty of this synthesis lies in the separation of “cryptographic security of the algorithm” and “trust in the generation of secret parameters”: migration to post-quantum signatures alone does not solve the problem of covert channels in nonces.

Keywords:  ECDSA, Bitcoin, kleptography, SETUP, nonce, RFC 6979, offline wallet, post-quantum cryptography, FIPS 203/204/205, threat model, reproducibility.

Content

⚙️ Detailed research option

  1. Introduction: Why “Offline” Doesn’t Equal “Trusted”
  2. Method: Selected questions and testable hypothesis
  3. Minimal background: ECDSA and Bitcoin
  4. Deep Dive 1501.00447v1: Leak Mechanism
  5. Deterministic k: What it treats and what it doesn’t treat
  6. Countermeasures and their cost
  7. Quantum context: two different threats
  8. Hypotheses, refutation criteria, and replication plan
  9. Table of questions, evidence and statuses
  10. Synthesis: What’s new in the article?
  11. Limitations, Ethics, and Applicability
  12. Conclusions and open questions
  13. Appendix A. Article Worksheet
  14. Appendix B. Pre-Publication Checklist
  15. Sources

1. Introduction: Why “Offline” Doesn’t Equal “Trusted”

⚙️ Detailed research option

A Bitcoin wallet is generally considered secure if the private key is stored on a device that is not connected to the internet. The logic is simple: without a network, malware cannot steal the key; without side-channel attacks, the device does not reveal the secret. A 2015 preprint undermines this simplification. It shows that if the ECDSA implementation is malicious, the secret can be hidden in the choice of nonce itself  k. The signature remains superficially correct; the verifier sees a regular ECDSA signature. But two consecutive signatures created with the same key contain a hidden dependency. An attacker who knows their private key extracts  k, and knowledge  k of one signature immediately yields the private key  d.

The article’s paradox can be formulated as follows:  “How can a perfectly isolated offline wallet remain functionally correct and still leak a private key without a side-channel?”  The answer: the leakage occurs not through physics, time, or electromagnetic radiation, but through  the distribution of the cryptographic algorithm’s output  . This makes the problem particularly inconvenient: standard anti-malware and anti-network security tools are unaware of it.

The second layer of the article is the quantum context. Bitcoin’s ECDSA is considered a future target for Shor’s algorithm, provided a sufficiently large, fault-tolerant quantum computer is available. NIST has already approved the post-quantum FIPS 203, 204, and 205 standards, and NCCoE describes practical migration. However, kleptographic nonce leakage is  a classic  threat that doesn’t require a quantum computer. It shouldn’t be confused with a quantum attack. But both raise the same question: can an implementation that the user can’t fully verify be trusted?

2. Method: selected questions and testable hypothesis

⚙️ Detailed research option

Eighteen general and eight specific questions directly related to the hypothesis were selected from the question builder. This is not an exhaustive questionnaire, but a working set for an analytical article.

TypeQuestion numbersWhy were they chosen?
General1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 43, 44, 45, 48Problem statement, mechanism, history, evidence, reproducibility.
Specialization: cryptography49, 50, 51, 52, 53, 54, 55, 56Cryptographic problem, attacker model, Bitcoin, migration, difference between risk assessment and experiment.

The central question

⚙️ Detailed research option

Can an offline Bitcoin wallet without the usual side-channel leaks reveal a private key through kleptographic nonce selection in ECDSA, and what are some verifiable countermeasures that mitigate this risk without creating new backdoor channels?

Hypothesis H1

⚙️ Detailed research option

If an ECDSA implementation uses a kleptographic SETUP with the attacker’s public key and two successive signatures with the same key, then the attacker recovers  k₂, and then the private key  d; the signatures remain computationally indistinguishable to everyone except the attacker.

H1 refutation criterion

⚙️ Detailed research option

H1 is considered refuted if, in a correct implementation of the described scheme, recovery  k₂ fails for all valid parameters, or if a verifier without the attacker’s secret can distinguish kleptographic signatures from ordinary ones with a practically significant probability.

Hypothesis H2

⚙️ Detailed research option

Deterministic selection  k according to RFC 6979 without external verification reduces the attack surface, but does not eliminate trust in the device: the user cannot verify that the device actually follows the specification without revealing the private key.

Criterion of refutation of H2

⚙️ Detailed research option

H2 is refutable if there is a practical protocol that allows the user to verify the correctness  k without disclosure  d and without creating a new leak channel.

Hypothesis H3

⚙️ Detailed research option

k Supervised  interactive generation  and one-time addresses reduce the risk of leakage through k, but come at a cost: interaction, list storage, residual risk of leakage through selection  tᵢ , and limitations in practical use.

3. Minimal Background: ECDSA and Bitcoin

⚙️ Detailed research option

In ECDSA over an elliptic curve  E with a generator  G of order  n , the private key is a number  d < n, and the public key is a point  Q = dG. For a message  m and a hash function,  H the signature is created as follows:

1) choose a random k < n;
2) R = (r₁, r₂) = kG;
3) r = r₁ mod n;
4) s = k⁻¹(H(m) + dr) mod n;
5) output σ = (r, s).

Verification uses  R′ = s⁻¹H(m)G + s⁻¹rQ comparison  r = r₁′ mod n. It is critical that  k it be secret: if  k known, the private key is calculated as

d = (H(m) − sk) r⁻¹ mod n.

In Bitcoin, the public key is hashed twice with SHA-256 for an address; the transaction references previous outputs and is signed with private keys. If two inputs in a single transaction are linked to the same address, more than one signature with the same key may appear in a single transaction. This is what makes the scenario from the preprint practically relevant.

4. Deep Dive 1501.00447v1: Leak Mechanism

⚙️ Detailed research option

4.1. What is SETUP in this work?

⚙️ Detailed research option

The work relies on the Young–Yung attack class:  Secretly Embedded Trapdoor with Universal Protection . The preprint lists the following properties: a malicious implementation  C′ conforms to a public input/output specification, efficiently computes the embedded function, uses the attacker’s public encryption key  E, and the secret decryption function  D is known only to the attacker. The output contains published bits of the secret key, which the attacker can easily extract; for all other attacks  C ,  the outputs C′ are polynomially indistinguishable. Once the scheme is revealed, users cannot determine past or future keys.

4.2 Kleptogram for elliptic curves

⚙️ Detailed research option

Let be  G the order point  n,  d be the attacker’s private key,  Q = dG and be their public key.  R Let be a cryptographically secure PRNG with a hidden seed. The constants  α, β, ω are fixed and  ω odd. A malicious implementation generates two consecutive choices  c₁, c₂.

First round

⚙️ Detailed research option

c₁ < n — random;
M₁ = c₁G;
c₁ is stored in non-volatile memory;
M₁ is output.

Second round

⚙️ Detailed research option

t ∈ {0,1} is a random bit;
Z = (c₁ − ωt)G + (−αc₁ − β)Q;
c₂ = R(Z);
M₂ = c₂G;
M₂ is output.

4.3 How the attacker restores c₂

⚙️ Detailed research option

The attacker also knows  M₁, M₂ his private key  d. He calculates:

R = αM₁ + βG;
Z₁ = M₁ − dR;
if M₂ = R(Z₁)G, then c₂ = R(Z₁);
Z₂ = Z₁ − ωG;
if M₂ = R(Z₂)G, then c₂ = R(Z₂).

The idea is that the attacker “removes” the contribution of their public key and checks two possible values ​​corresponding to the bit  t. To an outside observer,  M₂ it looks like an ordinary dot  c₂G. To the attacker, it contains a hidden, verifiable structure.

4.4 Why is it indistinguishable to others?

⚙️ Detailed research option

In the first round,  c₁ the selection is random. In the second round, a seeded PRNG is used to ensure the distribution  c₂ = R(Z) is as close to uniform as possible. The author requires that the points

G₁ = (−dβ − ω)G, G₂ = (−dβ)G, G₃ = (1 − dα)G

have as high an order as possible, ideally  n. Then  Z, and hence  c₂, can take on  n values ​​up to . If the PRNG output is polynomially indistinguishable from uniform, only an attacker can detect a kleptographic signature by applying the recovery procedure.

4.5 Application to ECDSA and Bitcoin

⚙️ Detailed research option

In ECDSA, the values  kᵢ, kᵢ₊₁ ​​in two consecutive signatures can be replaced by  c₁, c₂. Then  r₁, r₂ plays a role  M₁, M₂. The attacker extracts  kᵢ₊₁ = c₂ and calculates , one signature at a time  d. In Bitcoin, the signatures in a transaction are regular ECDSA signatures, so kleptographic SETUP is directly applicable. If a single transaction has two inputs with the same address, a single transaction is sufficient. No one except the attacker can distinguish such a transaction from a normal one.

4.6. Limitations

⚙️ Detailed research option

  • An attacker must know the curve and generator in advance. In classical Diffie–Hellman, this was a serious limitation, but in ECC, curves are standardized; Bitcoin uses only  secp256k1.
  • What is needed is two signatures with the same key in a controlled order, or two signatures where the implementation can link successive calls.
  • The attack does not require a side-channel, but does require a malicious implementation: firmware, hardware module, compiler, or supply chain.
  • This isn’t a quantum attack. It’s a classic kleptographic leak via nonce selection.

5. Deterministic k: what it treats and what it doesn’t treat

⚙️ Detailed research option

The preprint reminds us that if two values  k₁, k₂ ​​are related by a known linear relationship  k₂ = a k₁ + b, a private key can be derived from two signatures without knowing them  k. This is why proposals for deterministic selection emerged  k: RFC 6979 and the EdDSA specification. In RFC 6979,  k a private key is derived from a message and a private key; the same message and key produce the same signature.

This reduces the risk of reuse  k and linear relationships, but doesn’t completely solve the trust problem. First, verifying that the signature  k is actually derived according to the specification requires knowledge of the private key. Second, an offline wallet is designed to ensure that the private key never leaves the device; the user can’t verify the signature on a second computer without revealing the key. Third, a malicious implementation could claim to use RFC 6979 but do otherwise.

Deterministic signatures do have some useful benefits  k : they limit freedom of choice when re-signing the same document and allow for verification of historical signatures when transferring the key to another computer after the key expires. However, this does not replace a verifiable implementation.

6. Countermeasures and their cost

⚙️ Detailed research option

6.1 Zero-knowledge proof of correctness k

⚙️ Detailed research option

One idea is for the device to generate  k deterministically according to RFC 6979 and additionally produce a zero-knowledge proof that it  k was actually generated according to the specification. Such proofs exist for any NP-statement. However, a new problem arises: the proof itself becomes an additional output of the device and a potential leakage channel. The proof protocol must be chosen with extreme care, otherwise the “cure” will create a new covert channel.

6.2. Disposable addresses

⚙️ Detailed research option

If an address is used only once, it’s harder for an attacker to obtain two signatures with the same key in the correct order. This is already recommended for privacy. However, there are scenarios where single-use is inconvenient: a public donation address for a charitable foundation that is used multiple times. A signature is required for each incoming payment, and the risk returns.

6.3 Interactive k-generation with supervision

⚙️ Detailed research option

The idea: the signer doesn’t choose  k alone. The supervisor and signer jointly generate  k so that neither party can force the outcome. In the protocol from the preprint, the signer chooses  t < n, computes  T = tG and hash  h_T, and sends the hash to the supervisor. The supervisor chooses  u < n, sends  (m, u). The signer computes  k = u t mod n, creates a signature  σ = (r, s), and sends  (σ, T). The supervisor verifies  R′ = uT and  r = r₁′ mod n, as well as the hash  T. If the verification is successful, the signature is published; otherwise, the protocol is abandoned and the user receives a warning.

There’s a practical improvement: pre-agreeding. The signer selects a list in advance  t₁,…,t_ℓ, calculates  T_i = t_iG and hashes  h_{T_i}, and transmits the hashes to the supervisor. When signing, the supervisor sends  u, the signer uses the next  t_i, and the supervisor verifies  uT_i and hash. This reduces interactivity.

But subtleties remain: even if neither the signer nor the supervisor can manipulate the published data  k/r, the signer can leak information through selection  t_i. The supervisor does not store critical data in non-volatile memory, which changes the security properties. If at least one of the parties is operating correctly, leakage through  k is impossible; however, this is not an absolute guarantee against all channels.

7. Quantum context: two different threats

⚙️ Detailed research option

An important distinction.  Preprint 1501.00447v1 does not describe a quantum attack on Bitcoin. It describes a classic kleptographic leak via the ECDSA nonce. The quantum threat to ECDSA is related to Shor’s algorithm and requires a sufficiently large, fault-tolerant quantum computer. These risks must be considered separately, otherwise the article becomes a mixture of proven and predictable.

Nevertheless, there is a connection, and it’s methodological. In August 2024, NIST approved FIPS 203, 204, and 205—standards for post-quantum key establishment and digital signatures. NCCoE describes practical migration to post-quantum cryptography. For Bitcoin, this raises the question: how to transition from ECDSA/secp256k1 to quantum-resistant schemes without breaking compatibility or creating new classes of leaks.

The kleptographic lesson here is this:  post-quantum migration doesn’t eliminate the problem of trust in secret parameter generation . Any signature scheme that includes secret randomness or a deterministic nonce output requires a verifiable implementation. If a device is malicious, it may attempt to embed a covert channel into the new scheme—the exact mechanism will depend on the algorithm, but the principle of “the output must be indistinguishable, and the secret must be extractable only by the attacker” remains. Therefore, the correct statement is not “PQC solves everything,” but “PQC eliminates one class of threats, but requires separate analysis of leakage channels and the supply chain.”

8. Hypotheses, refutation criteria, and replication plan

⚙️ Detailed research option

This article is analytical: we haven’t conducted a real attack on Bitcoin. However, we have proposed a reproducible design that can be implemented in an isolated lab on a test curve or in  secp256k1 a training environment without real funds.

8.1 Experiment A: Reconstruction of k and d

⚙️ Detailed research option

  1. Generate  d, Q = dG attacker and victim keys.
  2. Choose  α, β, ω so that  G₁, G₂, G₃ they have a high order.
  3. Generate  c₁, calculate  M₁ = c₁G.
  4. Randomly select  t ∈ {0,1}, calculate  Z,  c₂ = R(Z),  M₂ = c₂G.
  5. Generate two ECDSA signatures with  k₁ = c₁,  k₂ = c₂.
  6. Apply the recovery procedure from section 4.3; verify that  c₂ and  d are recovered.
  7. Control: Replace  c₂ with an independent random value; recovery should fail.

8.2 Experiment B: Deterministic k

⚙️ Detailed research option

Implement RFC 6979 for test messages. Verify that the same message and key yield the same  k. Then simulate a malicious implementation that claims RFC 6979 but uses a different output. Show that without external verification, the user cannot distinguish one from the other without revealing  d.

8.3 Experiment C: Supervised Protocol

⚙️ Detailed research option

Simulate pre-negotiation and interactive generation  k. Measure the number of rounds, the memory size of the list  h_{T_i}, the verification time, and the behavior when one party fails. Verify that a single signer cannot choose  k voluntarily, but can influence the choice  t_i.

8.4. Metrics

⚙️ Detailed research option

MetricsWhat are we measuring?Expectation
Success of restorationThe share of runs where  c₂ they  d were restoredClose to 100% with correct parameters
False positive testTriggering recovery on random controlNegligibly small
Number of roundsProtocol interactivity with supervisorHigher than a regular signature
MemoryStoring a list h_{T_i}Grows with the number of signatures
TimeFull cost of signature and verificationIt’s growing

9. Table of questions, evidence and statuses

⚙️ Detailed research option

No.QuestionAnswer / proofStatus
1What problem does the technology solve?Protecting Bitcoin private keys in an offline wallet; detecting a covert channel in ECDSA.Analysis
2What paradox is being tested?An offline wallet without a side-channel can extract the key via a nonce.Proven in preprint
3What is being researched?ECDSA algorithm, Bitcoin protocol, wallet implementation.Definitely
4Hypothesis and refutationH1–H3; criteria in section 2.Formulated
5BordersNo real wallets considered; no quantum attack; only ECDSA/secp256k1.Limitation
6What would change the perception?Practical testing  k without disclosure  d and without a new channel.Open question
7Physical mechanismNo physical side-channel; leakage in output distribution.Proven
10Minimal exampleTwo signatures,  c₁ → M₁,  c₂ → M₂, restoration  Z.Example
11Model assumptionsMalicious implementation; curve and generator are known; attacker knows his  d.Obviously
12What is being measured?Recovery success, rounds, memory, time.Plan
13Original workYoung–Yung, Kleptographic attacks on DL schemes.Story
14A turning pointPreprint 1501.00447v1: port to ECDSA/Bitcoin.Source
17Agreement/DiscussionThe mechanism is recognized; the question is in practical testing and the supply chain.Discussion
18Connection with previous onesDeveloped by Young–Yung and complemented by RFC 6979.Synthesis
43Basis for conclusionMathematical description and proof of recovery in the preprint.Proof
44Control experimentsRandom  c₂, fair implementation, failure checking.Plan
45StatisticsNumber of runs and confidence intervals.Plan
48ReproducibilityCode, curve parameters, library versions, instructions.Requirement
49Cryptographic problemRecovery  k from  d ECDSA signatures.Definitely
50Quantum algorithmNot applicable in this paper; quantum risk is considered separately.Distinction
51ResourcesTwo signatures, knowledge  d of the attacker, curve parameters.Model
52Attacker’s dataPublic  r, s,  M₁, M₂; secret  d attacker.Threat model
53QKD vs. PQCQKD — key distribution; PQC — algorithms. Signature migration is important for Bitcoin.Context
54Bitcoin MechanismECDSA transaction signatures; the public key is available upon spending.Definitely
55MigrationFIPS 203/204/205, NCCoE; cost and compatibility.Grade
56Risk vs. ExperimentKleptography is a proven classical risk; quantum attack is an assessment of the future.Delimited

10. Synthesis: what new does the article provide?

⚙️ Detailed research option

The article links three layers that are usually discussed separately:

  1. ECDSA algorithmic security.  The scheme itself may be correct, but its nondeterministic nature  k creates a surface for kleptography.
  2. Implementation chain of trust.  An offline wallet protects against the network, but not against malicious firmware, compiler, or hardware. “Perfect offline” does not equal “trusted.”
  3. Post-quantum migration.  PQC reduces the future risk of Shor’s algorithm, but does not eliminate the need for verifiable secret generation and protection against covert channels.

A new, verifiable conclusion:  nonce trust is a security layer in its own right . It cannot be reduced to either curve hardness or the existence of a post-quantum standard. In practice, this means that wallet design should include not only algorithm selection but also generation specifications  k, firmware verifiability, reproducible builds, and, where possible, trust-sharing protocols.

11. Limitations, Ethics, and Applicability

⚙️ Detailed research option

  • The 2015 preprint is a theoretical work; it does not prove that specific wallets contain such a backdoor.
  • The attack requires a malicious implementation and knowledge of the curve/generator; for Bitcoin this is made easier by  secp256k1, but not automatic.
  • We did not conduct the experiment on real media; the replication plan is intended for an isolated learning environment.
  • The quantum part is the context of migration, not a statement about the existence of a practical attack today.
  • This article does not constitute financial or investment advice.
  • The publication must not contain ready-made exploits for real wallets; test parameters and protective measures are allowed.

12. Conclusions and open questions

⚙️ Detailed research option

An offline Bitcoin wallet can be functionally correct, have no network access, and not issue a key via conventional side-channels—and still extract a private key through kleptographic nonce selection. Preprint 1501.00447v1 demonstrates the mathematical mechanism: two signatures, hidden dependency, recovery  k , and computation  d. Deterministic encryption  k according to RFC 6979 is useful, but without external verification, it doesn’t eliminate trust in the device. Supervised interactive generation and one-time addresses reduce risk, but come at a cost and residual channels.

The quantum context strengthens motivation, but does not replace analysis. Post-quantum NIST standards and the NCCoE migration are important for the future security of Bitcoin, but they do not eliminate the question: how can a user verify that a device generates secret parameters honestly? Open questions: practical verification  k without disclosure  d; formal protocol verification with supervision; the resistance of post-quantum schemes to kleptographic backdoors; reproducible implementations for embedded wallets; and cost-of-security metrics.