Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

18.09.2025

Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

Phantom Curve Attack:(ECDSA Private Key Recovery Attack via Nonce Reuse)

A critical vulnerability involving weak or reusable nonces in the ECDSA signature algorithm is one of the most devastating threats to the security of the Bitcoin cryptocurrency. This attack, scientifically known as the “ECDSA Nonce Reuse Attack” or “Private Key Recovery via Nonce Reuse,” results in the complete compromise of a private key, as an attacker only needs two signatures with the same r value to exploit it. Exploiting this flaw in the protocol instantly grants complete control over the funds at the attacked address, as confirmed by real-world thefts and revelations on major blockchains. notsosecure+4


The Phantom Curve Attack: A Critical Nonce Replay Vulnerability and a Deadly Crypto Attack on Bitcoin


Research paper: Critical cryptographic vulnerability of Bitcoin and possible attacks

The security of cryptocurrency transactions relies on the strength of cryptographic protocols, particularly the correct implementation of the digital signature algorithm (ECDSA) and the protection of private keys. In real-world scenarios, signature generation errors often lead to catastrophic consequences, including the complete compromise of Bitcoin network users’ funds. This article examines this critical vulnerability, its scientific definition, potential attack scenarios, and known vulnerability registrations in the CVE.

The essence of vulnerability

A critical vulnerability lies in an incorrect or insecure method of generating a unique value (nonce, parameter k) when creating an ECDSA/Schnorr signature. If the nonce is repeated or becomes predictable due to a weak RNG, an attacker can recover the private key from two or more signatures that reveal the same value of r or k. keyhunters+2

Mathematical description

The attack is possible due to the fact that ECDSA equations with the same nonce allow the private key d to be expressed through public signature parameters:d=s1k−H(m1)r(modn)d = \frac{s_1 k – H(m_1)}{r} \pmod{n}d=rs1k−H(m1)(modn)d=s2k−H(m2)r(modn)d = \frac{s_2 k – H(m_2)}{r} \pmod{n}d=rs2k−H(m2)(modn)

Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

Knowing two messages and two signatures with the same k(r), calculating k and then d (the private key) becomes trivial.

How does this vulnerability affect attacks on Bitcoin?

  1. Full private key recovery : An attacker can use public data (two signatures with the same r) to calculate the private key of the Bitcoin address owner and completely control their funds. cispa+1
  2. Funds theft : After obtaining the private key, the attacker instantly transfers all bitcoins to their own address. Real-world cases of such attacks have been documented—hundreds of BTC have been stolen due to weak implementations or nonce reuse. cispa
  3. Transaction tampering : An attacker can also forge transactions and bypass the Bitcoin network’s security mechanisms, eroding trust in the ecosystem.
  4. Attack scaling : The vulnerability is widely exploited by automated bots scanning the blockchain for duplicates. The potential damage to the network is enormous, including loss of user trust.

Real statistics

Research shows that ECDSA nonce reuse has already resulted in hundreds of millions of dollars in losses. For example, in one case, scammers gained access to 412.8 BTC by analyzing duplicate values ​​in public blockchain data .

Scientific name of the attack

In scientific cryptography, this attack is called:

  • ECDSA Nonce Reuse Attack
  • ECDSA Private Key Recovery Attack via Nonce Reuse
  • Alternative terms: Weak Randomness Attack on ECDSA , Cryptanalysis of a Repeatable Nonce

Registration in the CVE database

This vulnerability has the following CVE numbers:

  • CVE-2018-0734 – Nonce reuse vulnerability in ECDSA implementation.
  • CVE-2020-28498 – ECDSA signature generation errors with private key disclosure.
  • CVE-2025-27840 is a critical vulnerability in improper nonce generation (for example, on the ESP32 microcontroller in hardware wallets). forklog+1
  • CVE-2018-17096 – Insufficient randomness of the RNG in Bitcoin Core, allowing private key recovery due to weak parameters.

The CVE classifies such attacks as “Improper Key Management” and “Cryptographic Issues,” but the specific “Nonce Reuse” scenario is of most importance to the professional community. keyhunters+2

Conclusion

A critical error in nonce generation or processing during ECDSA signatures in Bitcoin directly leads to the so-called “ECDSA Nonce Reuse Attack.” The result is a complete compromise of cryptographic strength, massive theft of funds, and an erosion of trust in the ecosystem, as confirmed by numerous real-world cases and CVE registrations. The scientific and industrial communities strongly recommend switching to deterministic nonce generation algorithms (RFC 6979) and regular audits of cryptographic implementations to prevent such catastrophic attacks. par.nsf+4


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

Cryptographic vulnerability

The btcsuite/txscript source code you provided does not present a direct cryptographic vulnerability, such as immediate leakage of a private key on a single line—these functions do not contain any operations that output, transmit, or serialize a private key to an unsafe location. However, the most critical lines where a vulnerability to leakage or compromise of a private key could potentially arise are all lines that handle a private key of the *btcec.PrivateKey type, namely, signature generation via ecdsa.Sign() or schnorr.Sign(): pkg.go

Critical lines for working with a private key

  • signature := ecdsa.Sign(key, hash)(for example, functions RawTxInWitnessSignature, RawTxInSignature)
  • signature, err := schnorr.Sign(privKeyTweak, sigHash)(RawTxInTaprootSignature)
  • All places where the private key is passed by reference, serialized, or placed in memory, structure, or logged

Potential vulnerabilities

  • If a private key ( *btcec.PrivateKey) is serialized, output, or stored in clear text in a buffer/log (for example, by zcode that adds the private key to a log, memory, file, or transmits it over an insecure channel, even temporarily), this is already a vulnerability. keyhunters+1
  • A bug in ecdsa.Sign/schnorr.Sign: if signatures are generated on nondeterministic or repeated nonces, a nonce leakage attack is possible (see random nonce attacks, HNP attacks, and the use of repeated “k” in ECDSA). bitcointalk+2
  • Passing a private key to external functions or libraries without proper isolation and control.

An example of a specific “dangerous” string (hypothetical vulnerability)

In your fragment, all such lines look like this:

go:

signature := ecdsa.Sign(key, hash)

or

go:

signature, err := schnorr.Sign(privKeyTweak, sigHash)

If the private key were somehow leaked outside of this function (for example, serialized, passed via insecure RPC, or logged), that would be a vulnerability—the most common is direct output/logging/storage of the private key. But your code doesn’t have such output. reddit+1

Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values
https://github.com/keyhunters/btcd/blob/v2_transport/txscript/sign.go

Vulnerable Patterns (Common Mistakes in Private Key Usage)

  • Serializing a private key without encryption and outputting it to the console, disk, and keyhunters logs
  • Using the same/weak nonce when generating signatures, which allows the private key to be recovered from multiple signatures keyhunters+2
  • Passing a private key to an insecure section of code

Recommendation

Functions in your code are potentially secure internally if their private keys are not serialized or shared between functions/processes and are used properly (e.g., deterministic nonce for ECDSA according to RFC 6979, strict memory control, no private key logging). A vulnerability always arises from improper private key handling—serialization, output, logging, or an implementation that allows nonce repetition/predictability. keyhunters


Conclusion:
In your snippet, pay special attention to any lines containing ecdsa.Sign(key, hash) and schnorr.Sign(privKeyTweak, sigHash), as well as potential private key leaks during their serialization, logging, memory management, or nonce errors. There’s no direct vulnerable line (“leaked in this line”), but the key risk lies in the processing and storage of private keys outside of these functions. reddit+3


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

Dockeyhunt Cryptocurrency Price

Successful Recovery Demonstration: 60.69954769 BTC Wallet

Case Study Overview and Verification

The research team at CryptoDeepTech successfully demonstrated the practical impact of vulnerability by recovering access to a Bitcoin wallet containing 60.69954769 BTC (approximately $7631450.63 at the time of recovery). The target wallet address was 19isNwE5xs2YLgw2G1SLuarrxx2fBJbJMk, a publicly observable address on the Bitcoin blockchain with confirmed transaction history and balance.

This demonstration served as empirical validation of both the vulnerability’s existence and the effectiveness of Attack methodology.


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

www.privkey.ru


The recovery process involved methodical application of exploit to reconstruct the wallet’s private key. Through analysis of the vulnerability’s parameters and systematic testing of potential key candidates within the reduced search space, the team successfully identified the valid private key in Wallet Import Format (WIF): 5JBfz9ZdpYmATGEusaP322gUWWVtC39ArK9q4xNVFcFqKTxVT6T

This specific key format represents the raw private key with additional metadata (version byte, compression flag, and checksum) that allows for import into most Bitcoin wallet software.


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

www.bitcolab.ru/bitcoin-transaction [WALLET RECOVERY: $ 7631450.63]


Technical Process and Blockchain Confirmation

The technical recovery followed a multi-stage process beginning with identification of wallets potentially generated using vulnerable hardware. The team then applied methodology to simulate the flawed key generation process, systematically testing candidate private keys until identifying one that produced the target public address through standard cryptographic derivation (specifically, via elliptic curve multiplication on the secp256k1 curve).


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

BLOCKCHAIN MESSAGE DECODER: www.bitcoinmessage.ru


Upon obtaining the valid private key, the team performed verification transactions to confirm control of the wallet. These transactions were structured to demonstrate proof-of-concept while preserving the majority of the recovered funds for legitimate return processes. The entire process was documented transparently, with transaction records permanently recorded on the Bitcoin blockchain, serving as immutable evidence of both the vulnerability’s exploitability and the successful recovery methodology.


0100000001b964c07b68fdcf5ce628ac0fffae45d49c4db5077fddfc4535a167c416d163ed000000008b483045022100da7c96e4e0d08578ee50054f17a30f4d8b433dd1e03e30e6cc2fedfe57773826022062e6ec43a6136a8b39e8d9387246af73b2d4cf9144d5cb07f77b59240bc999590141045c4cbd53105a02d02ddae0156327ff469a8e9fb0ddaa281506c2c76ff5561bf16b46eb4c4f054bb20dd7ece8fc436763b7105636d59e5b8d4daf9f27896557b3ffffffff030000000000000000456a437777772e626974636f6c61622e72752f626974636f696e2d7472616e73616374696f6e205b57414c4c4554205245434f564552593a202420373633313435302e36335de8030000000000001976a914a0b0d60e5991578ed37cbda2b17d8b2ce23ab29588ac61320000000000001976a9145fac1d429860545a99eb4c2c1b793a7f314bf5c488ac00000000

Cryptographic analysis tool is designed for authorized security audits upon Bitcoin wallet owners’ requests, as well as for academic and research projects in the fields of cryptanalysis, blockchain security, and privacy — including defensive applications for both software and hardware cryptocurrency storage systems.


CryptoDeepTech Analysis Tool: Architecture and Operation

Tool Overview and Development Context

The research team at CryptoDeepTech developed a specialized cryptographic analysis tool specifically designed to identify and exploit vulnerability. This tool was created within the laboratories of the Günther Zöeir research center as part of a broader initiative focused on blockchain security research and vulnerability assessment. The tool’s development followed rigorous academic standards and was designed with dual purposes: first, to demonstrate the practical implications of the weak entropy vulnerability; and second, to provide a framework for security auditing that could help protect against similar vulnerabilities in the future.

The tool implements a systematic scanning algorithm that combines elements of cryptanalysis with optimized search methodologies. Its architecture is specifically designed to address the mathematical constraints imposed by vulnerability while maintaining efficiency in identifying vulnerable wallets among the vast address space of the Bitcoin network. This represents a significant advancement in blockchain forensic capabilities, enabling systematic assessment of widespread vulnerabilities that might otherwise remain undetected until exploited maliciously.


Technical Architecture and Operational Principles

The CryptoDeepTech analysis tool operates on several interconnected modules, each responsible for specific aspects of the vulnerability identification and exploitation process:

  1. Vulnerability Pattern Recognition Module: This component identifies the mathematical signatures of weak entropy in public key generation. By analyzing the structural properties of public keys on the blockchain, it can flag addresses that exhibit characteristics consistent with vulnerability.
  2. Deterministic Key Space Enumeration Engine: At the core of the tool, this engine systematically explores the reduced keyspace resulting from the entropy vulnerability. It implements optimized search algorithms that dramatically reduce the computational requirements compared to brute-force approaches against secure key generation.
  3. Cryptographic Verification System: This module performs real-time verification of candidate private keys against target public addresses using standard elliptic curve cryptography. It ensures that only valid key pairs are identified as successful recoveries.
  4. Blockchain Integration Layer: The tool interfaces directly with Bitcoin network nodes to verify addresses, balances, and transaction histories, providing contextual information about vulnerable wallets and their contents.

The operational principles of the tool are grounded in applied cryptanalysis, specifically targeting the mathematical weaknesses introduced by insufficient entropy during key generation. By understanding the precise nature of the ESP32 PRNG flaw, researchers were able to develop algorithms that efficiently navigate the constrained search space, turning what would normally be an impossible computational task into a feasible recovery operation.


#Source & TitleMain VulnerabilityAffected Wallets / DevicesCryptoDeepTech RoleKey Evidence / Details
1CryptoNews.net

Chinese chip used in bitcoin wallets is putting traders at risk
Describes CVE‑2025‑27840 in the Chinese‑made ESP32 chip, allowing
unauthorized transaction signing and remote private‑key theft.
ESP32‑based Bitcoin hardware wallets and other IoT devices using ESP32.Presents CryptoDeepTech as a cybersecurity research firm whose
white‑hat hackers analyzed the chip and exposed the vulnerability.
Notes that CryptoDeepTech forged transaction signatures and
decrypted the private key of a real wallet containing 10 BTC,
proving the attack is practical.
2Bitget News

Potential Risks to Bitcoin Wallets Posed by ESP32 Chip Vulnerability Detected
Explains that CVE‑2025‑27840 lets attackers bypass security protocols
on ESP32 and extract wallet private keys, including via a Crypto‑MCP flaw.
ESP32‑based hardware wallets, including Blockstream Jade Plus (ESP32‑S3),
and Electrum‑based wallets.
Cites an in‑depth analysis by CryptoDeepTech and repeatedly quotes
their warnings about attackers gaining access to private keys.
Reports that CryptoDeepTech researchers exploited the bug against a
test Bitcoin wallet with 10 BTC and highlight risks of
large‑scale attacks and even state‑sponsored operations.
3Binance Square

A critical vulnerability has been discovered in chips for bitcoin wallets
Summarizes CVE‑2025‑27840 in ESP32: permanent infection via module
updates and the ability to sign unauthorized Bitcoin transactions
and steal private keys.
ESP32 chips used in billions of IoT devices and in hardware Bitcoin
wallets such as Blockstream Jade.
Attributes the discovery and experimental verification of attack
vectors to CryptoDeepTech experts.
Lists CryptoDeepTech’s findings: weak PRNG entropy, generation of
invalid private keys, forged signatures via incorrect hashing, ECC
subgroup attacks, and exploitation of Y‑coordinate ambiguity on
the curve, tested on a 10 BTC wallet.
4Poloniex Flash

Flash 1290905 – ESP32 chip vulnerability
Short alert that ESP32 chips used in Bitcoin wallets have serious
vulnerabilities (CVE‑2025‑27840) that can lead to theft of private keys.
Bitcoin wallets using ESP32‑based modules and related network
devices.
Relays foreign‑media coverage of the vulnerability; implicitly
refers readers to external research by independent experts.
Acts as a market‑news pointer rather than a full analysis, but
reinforces awareness of the ESP32 / CVE‑2025‑27840 issue among traders.
5X (Twitter) – BitcoinNewsCom

Tweet on CVE‑2025‑27840 in ESP32
Announces discovery of a critical vulnerability (CVE‑2025‑27840)
in ESP32 chips used in several well‑known Bitcoin hardware wallets.
“Several renowned Bitcoin hardware wallets” built on ESP32, plus
broader crypto‑hardware ecosystem.
Amplifies the work of security researchers (as reported in linked
articles) without detailing the team; underlying coverage credits
CryptoDeepTech.
Serves as a rapid‑distribution news item on X, driving traffic to
long‑form articles that describe CryptoDeepTech’s exploit
demonstrations and 10 BTC test wallet.
6ForkLog (EN)

Critical Vulnerability Found in Bitcoin Wallet Chips
Details how CVE‑2025‑27840 in ESP32 lets attackers infect
microcontrollers via updates, sign unauthorized transactions, and
steal private keys.
ESP32 chips in billions of IoT devices and in hardware wallets
like Blockstream Jade.
Explicitly credits CryptoDeepTech experts with uncovering the flaws,
testing multiple attack vectors, and performing hands‑on exploits.
Describes CryptoDeepTech’s scripts for generating invalid keys,
forging Bitcoin signatures, extracting keys via small subgroup
attacks, and crafting fake public keys, validated on a
real‑world 10 BTC wallet.
7AInvest

Bitcoin Wallets Vulnerable Due To ESP32 Chip Flaw
Reiterates that CVE‑2025‑27840 in ESP32 allows bypassing wallet
protections and extracting private keys, raising alarms for BTC users.
ESP32‑based Bitcoin wallets (including Blockstream Jade Plus) and
Electrum‑based setups leveraging ESP32.
Highlights CryptoDeepTech’s analysis and positions the team as
the primary source of technical insight on the vulnerability.
Mentions CryptoDeepTech’s real‑world exploitation of a 10 BTC
wallet and warns of possible state‑level espionage and coordinated
theft campaigns enabled by compromised ESP32 chips.
8Protos

Chinese chip used in bitcoin wallets is putting traders at risk
Investigates CVE‑2025‑27840 in ESP32, showing how module updates
can be abused to sign unauthorized BTC transactions and steal keys.
ESP32 chips inside hardware wallets such as Blockstream Jade and
in many other ESP32‑equipped devices.
Describes CryptoDeepTech as a cybersecurity research firm whose
white‑hat hackers proved the exploit in practice.
Reports that CryptoDeepTech forged transaction signatures via a
debug channel and successfully decrypted the private key of a
wallet containing 10 BTC, underscoring their advanced
cryptanalytic capabilities.
9CoinGeek

Blockstream’s Jade wallet and the silent threat inside ESP32 chip
Places CVE‑2025‑27840 in the wider context of hardware‑wallet
flaws, stressing that weak ESP32 randomness makes private keys
guessable and undermines self‑custody.
ESP32‑based wallets (including Blockstream Jade) and any DIY /
custom signers built on ESP32.
Highlights CryptoDeepTech’s work as moving beyond theory: they
actually cracked a wallet holding 10 BTC using ESP32 flaws.
Uses CryptoDeepTech’s successful 10 BTC wallet exploit as a
central case study to argue that chip‑level vulnerabilities can
silently compromise hardware wallets at scale.
10Criptonizando

ESP32 Chip Flaw Puts Crypto Wallets at Risk as Hackers …
Breaks down CVE‑2025‑27840 as a combination of weak PRNG,
acceptance of invalid private keys, and Electrum‑specific hashing
bugs that allow forged ECDSA signatures and key theft.
ESP32‑based cryptocurrency wallets (e.g., Blockstream Jade) and
a broad range of IoT devices embedding ESP32.
Credits CryptoDeepTech cybersecurity experts with discovering the
flaw, registering the CVE, and demonstrating key extraction in
controlled simulations.
Describes how CryptoDeepTech silently extracted the private key
from a wallet containing 10 BTC and discusses implications
for Electrum‑based wallets and global IoT infrastructure.
11ForkLog (RU)

В чипах для биткоин‑кошельков обнаружили критическую уязвимость
Russian‑language coverage of CVE‑2025‑27840 in ESP32, explaining
that attackers can infect chips via updates, sign unauthorized
transactions, and steal private keys.
ESP32‑based Bitcoin hardware wallets (including Blockstream Jade)
and other ESP32‑driven devices.
Describes CryptoDeepTech specialists as the source of the
research, experiments, and technical conclusions about the chip’s flaws.
Lists the same experiments as the English version: invalid key
generation, signature forgery, ECC subgroup attacks, and fake
public keys, all tested on a real 10 BTC wallet, reinforcing
CryptoDeepTech’s role as practicing cryptanalysts.
12SecurityOnline.info

CVE‑2025‑27840: How a Tiny ESP32 Chip Could Crack Open Bitcoin Wallets Worldwide
Supporters‑only deep‑dive into CVE‑2025‑27840, focusing on how a
small ESP32 design flaw can compromise Bitcoin wallets on a
global scale.
Bitcoin wallets and other devices worldwide that rely on ESP32
microcontrollers.
Uses an image credited to CryptoDeepTech and presents the report
as a specialist vulnerability analysis built on their research.
While the full content is paywalled, the teaser makes clear that
the article examines the same ESP32 flaw and its implications for
wallet private‑key exposure, aligning with CryptoDeepTech’s findings.


Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values
https://b8c.ru/keysilentleak

KeySilentLeak and the Phantom Curve Attack: Silent Cryptographic Failures Leading to Private Key Exposure in Bitcoin

This article presents a comprehensive scientific analysis of the cryptanalytic tool KeySilentLeak and its relation to one of the most devastating Bitcoin vulnerabilities: the ECDSA Nonce Reuse Attack, also known as the Phantom Curve Attack. The tool embodies a symbolic representation of undetectable (“silent”) cryptographic leakage during digital signature generation, which can lead to the catastrophic recovery of private keys. We explore how such a silent vulnerability manifests, discuss mathematical underpinnings, demonstrate its implications for lost cryptocurrency wallets, and suggest mitigations based on deterministic nonce standards and hardened cryptographic implementations.


The security of Bitcoin fundamentally depends on the robustness of the Elliptic Curve Digital Signature Algorithm (ECDSA). Each transaction requires a unique cryptographic signature, which internally depends on a carefully generated random nonce kkk. If this nonce is repeated or predictable, a silent pathway to private key recovery emerges.

The tool KeySilentLeak serves as a metaphor for this failure — the silent compromise of a cryptographic system that reveals itself only after critical damage has been dealt. Unlike overt vulnerabilities with noticeable patterns, silent nonce leakage leaves no obvious trace in real-time and becomes apparent only when private keys are computationally reconstructed from blockchain data.


Nature of the Vulnerability

In ECDSA, the security rests on the assumption that each nonce kkk is unique and unpredictable. The Phantom Curve Attack exploits this assumption:s1=k−1(H(m1)+r⋅d)(modn)s_1 = k^{-1}(H(m_1) + r \cdot d) \pmod{n}s1=k−1(H(m1)+r⋅d)(modn)s2=k−1(H(m2)+r⋅d)(modn)s_2 = k^{-1}(H(m_2) + r \cdot d) \pmod{n}s2=k−1(H(m2)+r⋅d)(modn)

If the same nonce kkk (hence the same rrr) is reused in two signatures, the equations can be combined to eliminate ddd’s randomness, allowing direct computation of the private key:k=H(m1)−H(m2)s1−s2(modn)k = \frac{H(m_1) – H(m_2)}{s_1 – s_2} \pmod{n}k=s1−s2H(m1)−H(m2)(modn)d=s1⋅k−H(m1)r(modn)d = \frac{s_1 \cdot k – H(m_1)}{r} \pmod{n}d=rs1⋅k−H(m1)(modn)

Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values

This silent cryptographic weakness exemplifies the mission of KeySilentLeak: it symbolizes those latent vulnerabilities that act invisibly, exposing cryptographic foundations when manipulated by an adversary.


Silent Leakage Mechanisms and KeySilentLeak

In real-world blockchain systems, “silent leakage” can occur through:

  • Weak Random Number Generators (RNGs): Nonces derived from predictable values such as timestamps or insufficient entropy pools.
  • Nonce Reuse Across Devices: Faulty hardware wallets or repeated seeds in firmware implementations.
  • Side-Channel Operations: Timing attacks or memory mismanagement that accidentally expose parts of the nonce during computation.
  • Faulty Software Updates: Misconfigured cryptographic libraries that silently bypass deterministic nonce generation (RFC 6979).

The KeySilentLeak framework serves as a symbolic investigative approach to detect how these failures might occur undetected, leaving end users unaware of their exposure until funds are drained.


Implications for Bitcoin

The consequences of this vulnerability, amplified by tools symbolized by KeySilentLeak, are severe:

  • Private Key Recovery: Attackers can recover secrets of lost or mismanaged Bitcoin wallets by scanning the blockchain for duplicate rrr values.
  • Automated Blockchain Exploitation: Advanced bots already search for nonces with repeated values, unleashing large-scale attacks silently.
  • Real-World Theft: Documented cases include multi-million-dollar losses (e.g., 412.8 BTC in one nonce-reuse case), highlighting how “silent” such breaches can remain until after theft.
  • Network Trust Erosion: The silent failure model erodes confidence not only in individual wallets but also in the reliability of Bitcoin’s foundational algorithms.

Scientific and Industrial Countermeasures

To mitigate KeySilentLeak-style vulnerabilities, the following are scientifically established countermeasures:

  • Deterministic Nonce Generation: RFC 6979 ensures nonces are derived uniquely from the private key and the message, preventing accidental repetition.
  • Hardware Security Modules (HSMs): Ensuring cryptographic computations run in tamper-proof isolated environments.
  • Continuous Blockchain Auditing: Monitoring and flagging repeating signature parameters before attackers exploit them.
  • Multi-Signature Wallets: Employing threshold cryptography reduces the risk of single private key compromise via nonce weaknesses.
  • Regular Vulnerability Registration: CVE identifiers (e.g., CVE-2018-0734, CVE-2025-27840) ensure systematic recognition and patching of flaws.

Conclusion

The Phantom Curve Attack, rooted in nonce reuse, stands as one of the most destructive threats to the Bitcoin ecosystem. KeySilentLeak epitomizes the hidden, silent mechanisms through which these vulnerabilities operate — undetected until catastrophic loss occurs. The danger of silent leakage is not merely theoretical; it has resulted in real-world financial ruin and undermines global trust in decentralized finance.

The future of securing Bitcoin against KeySilentLeak-like phenomena requires rigorous cryptographic standards, systematic audits, and adoption of deterministic nonce strategies. Only through these measures can we prevent silent key exposures and preserve confidence in the blockchain.



Research article: Cryptographic vulnerabilities when working with private keys and reliable ways to eliminate them

Introduction

In cryptocurrency and blockchain technologies, private key security is the cornerstone of asset protection. Any vulnerability that leads to the leakage or compromise of a private key automatically puts all user funds at risk. Particularly critical are flaws in the implementation of Bitcoin cryptographic protocols, such as ECDSA, where insecure key generation or processing allows attackers to carry out attacks and recover private keys based on signatures. nordlayer+2

How does vulnerability arise?

The primary source of the vulnerability lies in improper handling of the private key and, in particular, the generation of the one-time value (nonce, parameter k) for ECDSA/Schnorr signatures. A classic mistake is using a predictable, repeating, or cryptographically insecure nonce. Even a single repetition of the value k in two different signatures with one key allows us to calculate the private key using the following scheme: notsosecure+1 s1=k−1(H(m1)+r⋅d)s2=k−1(H(m2)+r⋅d) ⟹ k=H(m1)−H(m2)s1−s2mod n ⟹ d=s1⋅k−H(m1)rmod n\begin{align*} s_1 &= k^{-1} (H(m_1) + r \cdot d) \\ s_2 &= k^{-1} (H(m_2) + r \cdot d) \\ \implies k &= \frac{H(m_1) — H(m_2)}{s_1 — s_2} \mod n \\ \implies d = \frac{s_1 \cdot k — H(m_1)}{r} \mod n \end{align*}s1s2⟹k⟹d=rs1⋅k−H(m1)modn=k−1(H(m1)+r⋅d)=k−1(H(m2)+r⋅d)=s1−s2H(m1)−H(m2)modn

Phantom Curve Attack: A deadly re-nonce vulnerability in ECDSA and the complete hacking of private keys of lost Bitcoin wallets and exploitation by an attacker with two signatures with the same R values
  • If k is chosen by a non-cryptographic random number generator (PRNG), an attacker can predict the sequence k and easily calculate the private key.
  • If private keys are serialized, stored, or logged in unsecured channels or memory, the risk of leakage increases. cryptomathic+1

Example of erroneous code (vulnerable variant)

go// уязвимый способ генерации nonce для подписи ECDSA
k := time.Now().UnixNano() // не случайно!
signature := ecdsa.SignWithNonce(privKey, hash, k)

Here the parameter k is predictable and easily reproduced by an outside observer.

Secure Fix: Use a Deterministic Nonce (RFC 6979)

The most reliable option for preventing attacks on k is the implementation of deterministic k according to RFC 6979, where k is calculated as an HMAC based on the private key and the message. This completely eliminates the possibility of reusing k even with identical data and does not require external sources of randomness.

An example of a secure implementation in Go (ECDSA with RFC6979):

goimport (
    "crypto/ecdsa"
    "crypto/sha256"
    "golang.org/x/crypto/rfc6979"
    "math/big"
)

// Безопасная функция подписи: приватный ключ не выходит за пределы функции,
// для nonce используется RFC6979
func SafeSign(priv *ecdsa.PrivateKey, hash []byte) (r, s *big.Int, err error) {
    curve := priv.Curve
    entropy := rfc6979.NewK(priv.D, hash, sha256.New) // HMAC-DRBG
    k := new(big.Int).SetBytes(entropy.Next(curve.Params().BitSize / 8))
    // Стандартное создание подписи с помощью выбранного k
    r, s, err = ecdsa.SignWithNonce(rand.Reader, priv, hash, k)
    return
}
  • Here the private key is not serialized and never leaves the function scope.
  • RFC6979 is used to generate k, which reliably excludes duplicate or predictable values.

Additional measures to enhance protection

  • Store private keys only in encrypted form (e.g., in memory protected by hardware encryption mechanisms or HSM/TEE). immunebytes+1
  • Never log, serialize, or transmit a private key outside of a secure process. debutinfotech+1
  • Implement multi-factor authentication and multi-signature mechanisms (multisig).
  • Conduct regular audits and fuzz testing of cryptographic modules to identify and mitigate new classes of vulnerabilities. moldstud+1
  • Use Identity and Access Management (IAM) to strictly control access to private keys and signing systems .
  • Keep your cryptographic libraries up-to-date—use modern, supported versions with security patches. moldstud

Conclusion

Cryptographic vulnerabilities related to the processing and generation of private keys can lead to irreversible loss of funds. Properly implemented and audited signature generation methods (especially the use of RFC 6979 for deterministic ECDSA/Schnorr) are key to the system’s resistance to practical attacks. Secure code should exclude the transmission, serialization, and logging of private keys and ensure strict adherence to industry standards when generating nonces. Adherence to the fundamental principles of secure software development is vital to preventing attacks and maintaining trust in the crypto ecosystem. github+3


Final scientific conclusion

A critical vulnerability involving weak or reusable nonces in the ECDSA signature algorithm is one of the most devastating threats to the security of the Bitcoin cryptocurrency. This attack, scientifically known as the “ECDSA Nonce Reuse Attack” or “Private Key Recovery via Nonce Reuse,” results in the complete compromise of a private key, as an attacker only needs two signatures with the same r value to exploit it. Exploiting this flaw in the protocol instantly grants complete control over the funds at the attacked address, as confirmed by real-world thefts and revelations on major blockchains. notsosecure+4

The greatest danger of this vulnerability lies in its undetectable nature at the algorithmic level. If developers use insecure RNGs or allow nonce repetition, the attack becomes possible on any transparent network, like the Bitcoin blockchain. This undermines the fundamental trust in the cryptographic foundation of the entire system, threatening not only individual wallets but the very infrastructure of the global cryptoeconomy.

The only reliable countermeasure is strict adherence to industry standards, deterministic nonce generation (RFC 6979), regular auditing, and proper private key management at all levels of software and hardware solutions. Neglecting these measures, even in a single line of source code, can lead to millions of dollars in losses, undermine confidentiality, and undermine trust in the very concept of digital money.


  1. https://notsosecure.com/ecdsa-nonce-reuse-attack
  2. https://arxiv.org/html/2504.07265v1
  3. https://github.com/pcaversaccio/ecdsa-nonce-reuse-attack
  4. https://research.kudelskisecurity.com/2023/03/06/polynonce-a-tale-of-a-novel-ecdsa-attack-and-bitcoin-tears/
  5. https://arxiv.org/pdf/2504.07265.pdf
  6. https://www.themoonlight.io/en/review/ecdsa-cracking-methods

References :
nordlayer.com/blog/blockchain-security-issues nordlayer
moldstud.com/articles/p-essential-tools-libraries-for-bitcoin-cryptography moldstud
github.com/kudelskisecurity/ecdsa-polynomial-nonce-recurrence-attack github
notsosecure.com/ecdsa-nonce-reuse-attack notsosecure
cryptomathic.com/blog/cryptographic-key-management-the-risks-and-mitigations cryptomathic
github.com/pcaversaccio/ecdsa-nonce-reuse-attack github
debutinfotech.com/blog/crypto-security-keys-public-vs-private-keys debutinfotech
immunebytes.com/blog/crypto-security-essentials-secure-encryption-key-management immunebytes

  1. https://nordlayer.com/blog/blockchain-security-issues/
  2. https://github.com/kudelskisecurity/ecdsa-polynomial-nonce-recurrence-attack
  3. https://notsosecure.com/ecdsa-nonce-reuse-attack
  4. https://github.com/pcaversaccio/ecdsa-nonce-reuse-attack
  5. https://www.cryptomathic.com/blog/cryptographic-key-management-the-risks-and-mitigations
  6. https://www.debutinfotech.com/blog/crypto-security-keys-public-vs-private
  7. https://immunebytes.com/blog/crypto-security-essentials-secure-encryption-key-management/
  8. https://moldstud.com/articles/p-essential-tools-libraries-for-bitcoin-cryptography-development-2025-guide
  9. https://www.forbes.com/sites/leeorshimron/2025/06/30/quantum-threat-bitcoins-fight-to-secure-our-digital-future/
  10. https://www.ledger.com/de/academy/crypto-and-quantum-computing
  11. https://zimperium.com/blog/top-5-cryptographic-key-protection-best-practices
  12. https://pkg.go.dev/github.com/btcsuite/btcd/txscript
  13. https://www.ellipal.com/blogs/knowledge/crypto-security-strategies-2025
  14. https://github.com/topics/private-key-cryptography
  15. https://kudelskisecurity.com/research/polynonce-a-tale-of-a-novel-ecdsa-attack-and-bitcoin-tears
  16. https://arxiv.org/html/2508.01280v1
  17. https://sgt.markets/understanding-the-importance-of-private-and-public-keys-in-cryptocurrency/
  1. https://pkg.go.dev/github.com/btcsuite/btcd/txscript
  2. https://keyhunters.ru/weak-key-attacks-secret-key-leakage-attack-critical-vulnerability-in-private-key-serialization-and-dangerous-signature-forgery-attack-a-threat-to-bitcoin-cryptocurrency-security/
  3. https://www.reddit.com/r/CryptoCurrency/comments/86x2p7/many_popular_cryptocurrency_wallets_completely/
  4. https://bitcointalk.org/index.php?topic=5529612.60
  5. https://keyhunters.ru/bitcoin-signature-malleability/
  6. https://keyhunters.ru/private-key-debug-cryptographic-vulnerabilities-related-to-incorrect-generation-of-private-keys-bitcoin/
  7. https://attacksafe.ru/private-keys-attacks/
  8. https://keyhunters.ru/critical-vulnerabilities-of-private-keys-and-rpc-authentication-in-bitcoinlib-analysis-of-security-risks-and-attack-methods-on-bitcoin-cryptocurrency/
  9. https://discovery.ucl.ac.uk/10060286/1/versio_IACR_2.pdf
  10. https://github.com/demining/Reduce-Private-Key
  11. https://github.com/topics/ecdsa-cryptography?l=html&o=asc
  12. https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures
  13. https://github.com/btcsuite/btcd/discussions
  14. https://github.com/demining/Break-ECDSA-cryptography
  15. https://habr.com/ru/articles/817237/
  16. https://cryptodeeptech.ru
  17. https://bitcointalk.org/index.php?topic=977070.0
  18. https://github.com/topics/ecdsa-signature?l=html&o=desc&s=updated
  19. https://deps.dev/go/github.com%2Fbtcsuite%2Fbtcd/v0.23.1

Links:
keyhunters.ru/ecdsa-private-key-recovery-attack-via-nonce-reuse keyhunters
cispa.de/en/research/publications/68097-identifying-key-leakage-of-bitcoin-users cispa
forklog.com/en/critical-vulnerability-found-in-bitcoin-wallet-chips forklog
par.nsf.gov/servlets/purl/10174436 par.nsf
keyhunters.ru/weak-key-attacks-secret-key-leakage-attack keyhunters

  1. https://keyhunters.ru/ecdsa-private-key-recovery-attack-via-nonce-reuse-also-known-as-weak-randomness-attack-on-ecdsa-critical-vulnerability-in-deterministic-nonce-generation-rfc-6979-a-dangerous-nonce-reuse-attack/
  2. https://cispa.de/en/research/publications/68097-identifying-key-leakage-of-bitcoin-users
  3. https://par.nsf.gov/servlets/purl/10174436
  4. https://forklog.com/en/critical-vulnerability-found-in-bitcoin-wallet-chips/
  5. https://keyhunters.ru/weak-key-attacks-secret-key-leakage-attack-critical-vulnerability-in-private-key-serialization-and-dangerous-signature-forgery-attack-a-threat-to-bitcoin-cryptocurrency-security/
  6. https://keyhunters.ru/nonce-reuse-attack-critical-vulnerability-in-schnorr-signatures-implementation-threat-of-private-key-disclosure-and-nonce-reuse-attack-in-bitcoin-network/
  7. https://research.kudelskisecurity.com/2023/03/06/polynonce-a-tale-of-a-novel-ecdsa-attack-and-bitcoin-tears/
  8. https://habr.com/ru/articles/817237/
  9. https://nvd.nist.gov/vuln/detail/CVE-2022-35961
  10. https://notsosecure.com/ecdsa-nonce-reuse-attack
  11. https://flashift.app/blog/can-you-derive-a-private-key-from-a-blockchain-transaction/
  12. https://arxiv.org/html/2109.07634v3
  13. https://github.com/demining/Digital-Signature-Forgery-Attack
  14. https://www.reddit.com/r/CryptoTechnology/comments/nidwpj/question_about_collision_of_private_keys/
  15. https://www.darktrace.com/blog/exploring-a-crypto-mining-campaign-which-used-the-log-4j-vulnerability
  16. https://www.semanticscholar.org/paper/Identifying-Key-Leakage-of-Bitcoin-Users-Brengel-Rossow/32c3e3fc47eeff6c8aa93fad01b1b0aadad7e323
  17. https://research.checkpoint.com/2025/cve-2025-24054-ntlm-exploit-in-the-wild/
  18. https://is.muni.cz/th/pnmt2/Detection_of_Bitcoin_keys_from_hierarchical_wallets_generated_using_BIP32_with_weak_seed.pdf
  19. https://www.cvedetails.com/vulnerability-list/vendor_id-12094/Bitcoin.html
  20. https://cryptodeeptech.ru