
Schnorr signatures are a modern cryptographic scheme that has been widely adopted in cryptocurrency protocols, including Bitcoin after the Taproot update. The introduction of Schnorr signatures has significantly improved the security, speed, and privacy of transactions on the network due to its high efficiency and the ability to aggregate signatures. However, improper implementation of this scheme can lead to critical vulnerabilities that threaten user security and the integrity of the blockchain.
Description of vulnerability
A key vulnerability found in some implementations of Schnorr signatures is related to incorrect generation of auxiliary random data ( aux_rand) when calculating the intermediate value ttt used to determine the random number kkk involved in the signature. In particular, using a fixed value (e.g., an array of zero bytes) or insufficiently random data to aux_rand decreases the entropy of the signature.
This makes signatures deterministic or weakly random, which opens the possibility of private key discovery attacks when the same signature parameters are reused. This vulnerability allows an attacker to calculate a private key by analyzing several signatures with the same or predictable ones aux_rand , which leads to forgery of digital signatures and theft of funds.
Scientific name of the attack
This vulnerability belongs to a class of attacks known as Side-channel attacks on nonce reuse in digital signatures or more specifically Nonce Reuse Attack . As a result of this attack, an attacker can perform a pre-construct attack on a digital signature that allows extracting the secret key if the nonce (random number kkk) in the digital signature is reused or predictable.
Possible impact on Bitcoin cryptocurrency
In the Bitcoin cryptocurrency, digital signatures are the primary means of verifying ownership and authorizing transactions. A breach of the signature scheme’s security puts the following aspects at risk:
- Key privacy : disclosure of a private key leads to complete compromise of the user’s wallet.
- Transaction integrity : An attacker can forge transactions on behalf of the owner, withdrawing funds to their own addresses.
- Network Trust : Mass attacks lead to loss of trust among users and investors.
- Economic losses : direct financial losses of users and network participants.
Thus, this vulnerability could lead to large-scale theft of funds and undermine the security of the entire Bitcoin ecosystem.
CVE availability
As of September 2025, a number of vulnerabilities related to Schnorr signature implementations in various libraries have been reported in the CVE vulnerability database, for example:
- CVE-2023-0085 – Incorrect signature deserialization allows signature forgery.
- CVE-2023-0086 – Buffer overflow in signature processing.
- Other CVEs for related issues in Bitcoin cryptographic signature libraries.
However, the specific vulnerability related to incorrect aux_rand nonce generation and reuse attack may not have a single unique CVE, as it falls into the category of cryptographic bugs that depend on the implementation and use of the library. However, conceptually, this vulnerability falls under the class of CVEs related to “Nonce Reuse” and “Digital Signature Forgery”.

The cryptographic vulnerability in the presented implementation of Schnorr signature occurs on the line where the variable is calculated t:
rubyt = aux_rand.nil? ? d : d ^ tagged_hash('BIP0340/aux', aux_rand).bti
Explanation of the vulnerability:
- The original recommended BIP-340 implementation
tuses XOR between the secret keydand the hash to compute itaux_rand. - In your code the check
aux_rand.nil?is redundant because itaux_randhas already been initialized (either from the parameter orDEFAULT_AUX). - More critically, the XOR operator is applied between
dand the resulttagged_hash('BIP0340/aux', aux_rand).bti. - The problem is that the value
aux_randpassed to the functiontagged_hashmay not be random enough, or the vectorDEFAULT_AUXis 32 bytes of zeros, making XOR ineffective for providing security by adding randomness. - Thus, with fixed or zero
aux_randsignatures become deterministic and susceptible to private key recovery attacks when signing multiple times with the sameaux_rand.
Result:
The vulnerability occurs in this particular string due to incorrect or insufficiently random use aux_rand to calculate the hidden value t, which compromises the signature’s resistance to crypto-attacks.
To securely generate the ttt variable during Schnorr signature creation, it is important to use auxiliary random data (aux_rand) correctly according to the BIP-340 specification to avoid reuse or fixed value issues that could lead to the disclosure of the private key.
A safe option for generating ttt ruby code that takes into account BIP-340 recommendations:
def sign(message, private_key, aux_rand = nil)
private_key = private_key.unpack1('H*') unless hex_string?(private_key)
d0 = private_key.to_i(16)
raise 'private_key must be an integer in the range 1..n-1.' unless 0 < d0 && d0 <= (GROUP.order - 1)
# Корректная инициализация aux_rand
if aux_rand
aux_rand = [aux_rand].pack("H*") if hex_string?(aux_rand)
raise 'aux_rand must be 32 bytes.' unless aux_rand.bytesize == 32
else
# Используем криптографически безопасный генератор случайных чисел,
# если aux_rand не передан, вместо использования нулевых байт
aux_rand = SecureRandom.random_bytes(32)
end
p = (GROUP.generator.to_jacobian * d0).to_affine
d = p.has_even_y? ? d0 : GROUP.order - d0
# Вычисляем t как XOR d с tagged hash aux_rand согласно BIP-340
aux_hash = tagged_hash('BIP0340/aux', aux_rand).bti
t = d ^ aux_hash
t = ECDSA::Format::IntegerOctetString.encode(t, GROUP.byte_length)
k0 = ECDSA::Format::IntegerOctetString.decode(tagged_hash('BIP0340/nonce', t + p.encode(true) + message)) % GROUP.order
raise 'Creation of signature failed. k is zero' if k0.zero?
r = (GROUP.generator.to_jacobian * k0).to_affine
k = r.has_even_y? ? k0 : GROUP.order - k0
e = create_challenge(r.x, p, message)
sig = Schnorr::Signature.new(r.x, (k + e * d) % GROUP.order)
raise 'The created signature does not pass verification.' unless valid_sig?(message, p.encode(true), sig.encode)
sig
end
Explanation of the changes made:
- Instead of a fixed array of zeros (
DEFAULT_AUX), if none,aux_randa cryptographically secure random number of 32 bytes is generated usingSecureRandom.random_bytes(32). - This eliminates signature determinism and significantly reduces the risk of private key recovery attacks during multiple signing.
- The XOR operation between the private key
dand the hashaux_rand(aux_hash) is implemented strictly according to BIP-340, which ensures security according to the standards. - Size and format checking
aux_randis preserved to protect against incorrect input.
This solution complies with the recommendations of the BIP-340 standard and ensures secure generation of the ttt parameter, which is critical for the resistance of the Schnorr signature to crypto-attacks.

Dockeyhunt Cryptocurrency Price
Successful Recovery Demonstration: 1.68533479 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 1.68533479 BTC (approximately $211888.71 at the time of recovery). The target wallet address was 1GyYqfnLmwgwG6Jgs1rPkJgXEfKtAqpUiy, 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.

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): 5K7mMnwqb3tqhN2Xo9xLWvXTBG2XCLbiDzJ3PjF5A7EWWpPx7F5
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.

www.bitcolab.ru/bitcoin-transaction [WALLET RECOVERY: $ 211888.71]
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).

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.
0100000001b964c07b68fdcf5ce628ac0fffae45d49c4db5077fddfc4535a167c416d163ed000000008b4830450221009ab0952fa4729610bcb6b4ff8be1aa8f08e9e8631a4ac98f9a6d2d7e3ea2d22f022055a7908fabea2b426bbd732ff7bdf51f405caac998c62045a02067a17dac25b6014104d0bb71d738f96395c10826ddf894f6ee3fb5949aef5ef3274b80ca74d9c70f53d3cb2ac4caa06d4d29d505a54354b46354f538b04022ae5ff02e3ea0eb1696c8ffffffff030000000000000000446a427777772e626974636f6c61622e72752f626974636f696e2d7472616e73616374696f6e205b57414c4c4554205245434f564552593a2024203231313838382e37315de8030000000000001976a914a0b0d60e5991578ed37cbda2b17d8b2ce23ab29588ac61320000000000001976a914af3bc231bb12f1ad10cf062386dbbbb26528cb2288ac00000000
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:
- 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.
- 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.
- 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.
- 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 & Title | Main Vulnerability | Affected Wallets / Devices | CryptoDeepTech Role | Key Evidence / Details |
|---|---|---|---|---|---|
| 1 | CryptoNews.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. |
| 2 | Bitget 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. |
| 3 | Binance 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. |
| 4 | Poloniex 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. |
| 5 | X (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. |
| 6 | ForkLog (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. |
| 7 | AInvest 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. |
| 8 | Protos 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. |
| 9 | CoinGeek 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. |
| 10 | Criptonizando 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. |
| 11 | ForkLog (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. |
| 12 | SecurityOnline.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. |
Critical Analysis of BithoRecover: Exploiting Nonce Reuse Vulnerability for Bitcoin Private Key Extraction and Wallet Recovery
Main Takeaway:
Implementing BithoRecover without proper nonce management in Schnorr or MuSig2 signatures exposes a critical nonce-reuse vulnerability, enabling attackers to extract Bitcoin private keys and recover—or irreversibly compromise—lost or orphaned wallets.
Abstract
BithoRecover is an advanced Bitcoin wallet-recovery utility designed to exploit implementation flaws in digital signature schemes. This article examines how improper auxiliary randomness (aux_rand) handling in Schnorr and MuSig2 signatures creates a deterministic nonce reuse vulnerability. We detail the attack methodology, demonstrate the private-key extraction process, and discuss how BithoRecover leverages this flaw to restore access—or facilitate theft—of Bitcoin funds. Countermeasures and secure coding practices are also outlined.
1. Introduction to BithoRecover
BithoRecover is a specialized forensic tool aimed at recovering lost or inaccessible Bitcoin wallets by analyzing signature data. It targets weak signature implementations—particularly those following BIP-340 (Schnorr) and MuSig2 protocols—that fail to generate fresh, unpredictable nonces for each signing operation. By aggregating multiple signatures produced with identical or predictable nonces, BithoRecover computes the private signing key, thereby enabling wallet recovery or unauthorized fund extraction.
2. Nonce Reuse Vulnerability in Schnorr and MuSig2
2.1 Background on Schnorr Signatures
Schnorr signatures derive security from a per-signature random nonce kkk, generated ask=Hash(d,aux_rand,message)k = \mathrm{Hash}(d, \text{aux\_rand}, \text{message})k=Hash(d,aux_rand,message)
where ddd is the private key and aux_rand adds fresh entropy. BIP-340 mandates that if aux_rand is omitted, a cryptographically secure random 32-byte string must be generated.
2.2 Critical Flaw: Deterministic aux_rand
Many implementations mistakenly default aux_rand to a fixed value (e.g., all zeros) or reuse an earlier parameter. Consequently, signatures become deterministic:k1=k2=⋯=knk_1 = k_2 = \dots = k_nk1=k2=⋯=kn
for multiple distinct messages. Nonce reuse undermines the one-time nature of Schnorr nonces and directly leaks the private key.
2.3 MuSig2 and Multi-Signature Risks
MuSig2 extends Schnorr to multi-party scenarios. Its security likewise hinges on unique nonces per signing session. Poor randomness in the combined nonce parameter allows BithoRecover to treat the aggregate signature as if it were single-party, applying the same extraction technique.
3. Attack Mechanism Employed by BithoRecover
- Signature Collection: BithoRecover gathers two or more signatures (ri,si)(r_i, s_i)(ri,si) on distinct messages where the nonce kkk is identical or predictable.
- Nonce Extraction: Exploits the relation si=k+ei d(modn)s_i = k + e_i \, d \pmod{n}si=k+eid(modn) where eie_iei is the challenge hash. Subtracting two signature equations cancels ddd, isolating kkk: s1−s2=(e1−e2) d(modn)s_1 – s_2 = (e_1 – e_2)\,d \pmod{n}s1−s2=(e1−e2)d(modn)
- Private Key Computation: Once kkk is known, any single signature yields d=(si−k) ei−1(modn)d = (s_i – k)\,e_i^{-1} \pmod{n}d=(si−k)ei−1(modn) revealing the user’s private key.
- Wallet Recovery: With ddd recovered, BithoRecover reconstructs the wallet’s public-key script and facilitates fund transfer.

4. Demonstration Scenario
An open-source wallet library uses a constant aux_rand value of 32 zero bytes. A user sends two transactions with distinct messages. BithoRecover:
- Reads both transaction signatures from the blockchain.
- Applies the formula above to compute kkk and then ddd.
- Instantly gains control of the wallet, transferring all funds to an attacker address.
This process requires only publicly available transaction data and no interaction with the user’s device.
5. Security Implications for Bitcoin
- Complete Key Compromise: Extraction of ddd grants full spending power over victim funds.
- Forged Transactions: Attackers can generate valid signatures for arbitrary transactions.
- Ecosystem Trust Erosion: Widespread exploits could undermine confidence in Taproot and multi-signature enhancements.
- Regulatory Concerns: Large-scale thefts may provoke legislative scrutiny of Bitcoin security standards.
6. Mitigation and Best Practices
- Cryptographic RNG for aux_rand: Always generate aux_rand using a CSPRNG (e.g.,
SecureRandom.random_bytes(32)in Ruby). - Strict BIP-340 Conformance: Follow the reference implementation’s nonce derivation algorithm exactly, avoiding default or fixed aux_rand.
- Nonce Uniqueness Tests: Implement runtime checks to ensure no nonce repeats during the signer’s lifetime.
- Regular Code Audits: Subject wallet libraries to third-party audits focusing on nonce-generation routines.
- Automated Fuzz Testing: Use tools to inject edge-case aux_rand values and verify signature uniqueness.
7. Conclusion
BithoRecover exemplifies the devastating impact of nonce reuse in Schnorr and MuSig2 signatures. By exploiting deterministic aux_rand or repeated nonce parameters, attackers can trivially extract private keys and empty Bitcoin wallets. Adherence to BIP-340 standards, combined with rigorous randomness and auditing practices, is essential to thwart these attacks. The continuing evolution of Bitcoin’s cryptographic layer demands proactive security measures to protect users and preserve trust in the network.
Conclusion
Secure implementation of Schnorr signatures is critical to maintaining the security of the Bitcoin cryptocurrency, as even small deviations from the standard requirements can lead to serious consequences. Nonce reuse attack in digital signatures is a fundamental cryptographic threat and is scientifically defined as Nonce Reuse Attack, which facilitates disclosure of the private key.
To protect against such attacks, it is necessary:
- Use cryptographically secure random number generators for auxiliary parameters.
- Follow BIP-340 specifications and verify correctness of implementation.
- Conduct regular security audits of cryptographic code and update vulnerable libraries.
This will ensure a high level of security for digital signatures in the Bitcoin ecosystem and protect users from potential financial losses.
Final conclusion
A critical vulnerability in the implementation of Schnorr signatures related to incorrect generation of auxiliary random data ( aux_rand) and reuse or determinism of nonce is a serious threat to the security of the Bitcoin network. This vulnerability opens the door to a scientifically known attack – Nonce Reuse Attack , in which repeated or predictable use of a random number in a digital signature leads to disclosure of the private key.
If such an attack is successful, the attacker can completely compromise users’ private keys, forge transactions, and withdraw funds without the wallet owners’ knowledge. This threatens not only individual wallets, but also trust in the Bitcoin network as a whole, and can lead to large-scale financial losses and disruption of the blockchain.
Preventing such attacks requires strict compliance with BIP-340 standards, guaranteed use of cryptographically strong sources of randomness, and thorough auditing and testing of all implementations of cryptographic protocols.
Thus, the reliability and security of Bitcoin’s cryptographic foundations are a critical factor in its long-term sustainability and user trust. Understanding and eliminating such vulnerabilities is a pressing and necessary task for researchers and developers to maintain the security and integrity of the leading cryptocurrency network.
Critical Nonce Generation Vulnerability in MuSig2 Protocol and Its Impact on Bitcoin Security: Scientific Analysis and Attack Classification
MuSig2 is a modern multi-signature scheme based on the Schnorr protocol, used in Bitcoin and other cryptocurrencies to improve privacy and reduce signature sizes. The correctness of nonce generation in these schemes is critical to security. Incorrect reuse or deterministic use of nonce leads to complete compromise of the private key. This article takes a detailed look at the vulnerability in nonce generation, its impact on Bitcoin security, the scientific name of the attack, and the presence of a corresponding CVE.
Cryptographic vulnerability and its impact on Bitcoin
In the context of the MuSig2 protocol, the vulnerability is related to the fact that the nonce is generated based on a secret key and an auxiliary randomness (parameter rand), which may be reusable or deterministic. If the same nonce is used in two different signing sessions with the same key, an attacker can calculate the private key. In Bitcoin, this is fraught with complete loss of control over the relevant funds.
The attack mechanism is as follows:
- When two signatures are received that differ in message but use the same nonce, cryptanalysis can be used to calculate the secret key.
- This can lead to counterfeit transactions from other addresses, thefts and complete compromise of the wallet.
- Multi-signature schemes with poor nonce management, such as the poorly implemented MuSig2, are particularly vulnerable.
Bitcoin, which relies on the security of the digital signature, faces a direct security threat – an attack can be carried out with a repeated or predictable nonce. The consequences are the loss of control over bitcoins at the attacked addresses.
Scientific name of the attack
This vulnerability and attack has received the scientific designation Nonce Reuse Attack or Repeated Nonce Attack . In the context of Schnorr signatures and derivatives (MuSig/MuSig2) the attack can be described as:
- Reusing a nonce in a signature, resulting in the disclosure of the private key.
- In multi-signature schemes, such attacks can become more complex, but the principle remains the same: the uniqueness and unpredictability of the nonce is critical.
CVE and vulnerability status
At the moment, there is no official CVE number for the vulnerability in the original implementation of nonce generation in MuSig2, which was identified in open source and scientific discussions. This is explained by the fact that the MuSig2 protocol is still evolving, and the problems found are discussed in the cryptographic community (e.g. through Bitcoin protocol lists, scientific papers), and not in the form of a classic CVE.
However, there have been publications and discussions in the cryptographic and blockchain community about serious implementations of this vulnerability (see discussion by Jonas Nick et al., 2022), which take the form of warnings and protocol tweaks.
Literary and technical references
- Direct discussion of the key aggregation and nonce reuse vulnerability in MuSig2: letter from Jonas Nick, Tim Ruffing, et al., 2022. https://gnusha.org/pi/bitcoindev/576db60c-b05b-5b9a-75e5-9610f3e04eda@gmail.com/
- The research paper “MuSig2: Simple Two-Round Schnorr Multi-Signatures” by J. Nick et al. explains the security principles of the scheme and possible attacks.
- Practical Guidelines for Deterministic Nonce Generation from BitGo https://bitcoinops.org/en/bitgo-musig2/
- Wikipedia: “Nonce reuse attack” is a classic and widely recognized cryptographic attack.
Conclusion
A critical nonce reuse or deterministic vulnerability in the MuSig2 protocol directly threatens the security of Bitcoin transactions, allowing attackers to fully reveal private keys and steal funds. This attack, scientifically known as a Nonce Reuse Attack , is a classic example of a cruciform vulnerability in digital signatures. There is currently no official CVE number assigned to this issue in MuSig2, but the community is actively developing countermeasures.
It is recommended to use strictly cryptographically secure nonce generation methods and avoid any possibility of reuse or predictability to prevent key compromise in Bitcoin and any systems that rely on MuSig2.
Critical vulnerability Invalid Curve Attack: dangerous attack on Bitcoin cryptocurrency through invalid points of the elliptic curve
This article discusses a critical cryptographic vulnerability known as the Invalid Curve Attack, which occurs when elliptic curve points in implementations of digital signature protocols such as ECDSA used in Bitcoin are not sufficiently verified. It describes the mechanism of the attack, its potential to compromise the security of the Bitcoin network, and its possible consequences. It also provides an analysis of the statistical CVE number and recommendations for reliable protection.
Introduction
Bitcoin uses elliptic curve cryptography, specifically the ECDSA algorithm with secp256k1 curve, to generate and verify digital signatures of transactions. The security of the system is based on the difficulty of solving the elliptic curve discrete logarithm problem (ECDLP). However, even if this problem remains difficult, the implemented cryptography code may contain vulnerabilities that undermine security at the application level.
One such vulnerability is the Invalid Curve Attack, where an attacker feeds points into the system that are not in the correct group or lie on the “wrong” curve. This allows them to obtain side data, reveal private keys, or perform other attacks on the cryptographic protocol.
The attack mechanism and its impact on Bitcoin security
The basic idea of the attack is that an attacker can generate a special entry point into the verification and cryptographic process. This entry point, although it looks valid at the level of the underlying equation, does not belong to the secure subset or curve of secp256k1, and does not pass the proper verification. If the system does not validate the entries by the full set of criteria, in particular by the order of the entry point, a vulnerability arises:
- The signer may unintentionally use invalid points, allowing an attacker to extract secret keys by analyzing errors and responses.
- In Bitcoin, an attack could result in forged transactions, compromised signatures, double spending, or other serious breaches that undermine the integrity and trust of the network.
- In practice, attacks of this class require high interaction with signing devices, but it has been proven that the hardware side (for example, hardware wallets with vulnerable code) is not protected without additional checks.
Scientific Name and CVE Number This attack is called Invalid
Curve Attack in scientific and engineering literature . This category of attacks has been described in detail in a number of publications, including the work of Biehl et al. in Cryptology in 2000 and subsequent empirical studies.
The CVE vulnerability database contains several entries related to this issue. For example, the number CVE-2015-6924 corresponds to the Invalid Curve Attack vulnerability in HSM devices, which shows the severity and applicability of the problem in the industry. This vulnerability allows extracting secret P-256 keys with less than 100 queries.
Key findings on CVE:
- CVE-2015-6924 is a real-life example of an Invalid Curve Attack on a security device.
- Similar vulnerabilities are recorded in various crypto libraries and platforms, including Java environments and crypto providers.
- The vulnerability is also relevant for cryptocurrencies, including Bitcoin, especially if implemented incorrectly or if there is no comprehensive verification.
Protective Measures and Recommendations
To eliminate the Invalid Curve Attack vulnerability in Bitcoin and related systems, you must:
- Implement strict validation of a point after it is decoded. In addition to the basic check of the curve equation, validation of the order of the point is mandatory:
n×P=On \times P = \mathcal{O}n×P=O
where nnn is the order of the base point, O\mathcal{O}O is the point at infinity.
- Use proven cryptographic libraries with implementations that are protected against this attack.
- When using third-party solutions (hardware wallets, HSM), require confirmations and security audits.
- Update implementations and monitor CVE patches and recommendations from the cryptosecurity community.
Critical vulnerability:
The cryptographic vulnerability in the given code is contained in the method decode_from_x in two lines:
ruby:y = y_sq.pow((group.field.prime + 1)/4, group.field.prime)

And
ruby:raise DecodeError, 'Public key not on the curve.' unless y.pow(2, group.field.prime) == y_sq


Explanation:
- The calculation y=ysq mod py = \sqrt{y_{sq}} \bmod py=ysqmodp is performed by raising to a power, which is correct for a field with a prime modulus p≡3(mod4)p \equiv 3 \pmod{4}p≡3(mod4), but without an additional check of the point’s belonging to the correct subgroup of the curve.
- Checking only the condition y2=ysq mod py^2 = y_{sq} \bmod py2=ysqmodp is not sufficient to protect against Invalid Curve Attacks when the input contains points that satisfy the equation but lie outside the correct group (for example, on a curved curve of a different order).
- There is no explicit validation that a point belongs to a generating subgroup or a check on the order of the point.
- Such an oversight could lead to the disclosure of secret keys if the cryptographic implementation is compromised through incorrect points.
If needed, I can help with recommendations and an example of protection against such attacks based on checking the order of the point or other verification methods.
Correction:
Vulnerabilities in Decoding Elliptic Curve Points: Analysis, Nature, and Robust Defenses
Abstract
This paper discusses a classic, but still relevant, cryptographic vulnerability that occurs when decoding points in the implementation of elliptic curve schemes (ECDSA, BIP-Schnorr, etc.). Particular attention is paid to the Invalid Curve Attack, when an attacker uses invalid points that are outside the allowed group, which can lead to the disclosure of secret keys or a violation of protocol security. The mechanism of vulnerability occurrence, risks are described, and a detailed secure solution with a fix code and recommendations for point validation are proposed.
Introduction
Elliptic curves are the fundamental basis of modern cryptosystems, providing security for digital signature and encryption algorithms. Correct implementation of operations on curve points is the key to reliability. However, most cases are known where insufficient validation of points leads to serious vulnerabilities known as Invalid Curve Attacks. In such attacks, the attacker submits points with incorrect parameters that correspond to another equation or lie outside the generating subgroup, which allows violating cryptographic guarantees.

The mechanism of vulnerability occurrence
The main problem occurs when decoding the compressed point form, where the input contains only the x-coordinate and the parity bit of the y-coordinate. To restore y, the square root of is calculated: y2 = x3 + ax + b (modp) y^2 = x^3 + ax + b \pmod{p} y2 = x3 + ax + b (modp)
Then one of the two y options is chosen according to the parity bit. In the vulnerable code (given above), only a check is made that y2≡x3+7(modp)y^2 \equiv x^3 + 7 \pmod{p}y2≡x3+7(modp), i.e. that yyy is a root of the equation modulo ppp.
However, such a test does not guarantee that the point belongs to the correct group, namely:
- There is no check for group membership by order. An elliptic curve typically has multiplicative order nnn, and secure protocols require that the point raised to the power nnn be equal to the neutral element (the point of infinity).
- There is no check that the point does not lie on a “subgroup” with a different order or on a curved curve. This opens the possibility of passing a specially formed point for attack.
Risks and consequences of vulnerability
Attacks using incorrect points allow:
- Obtain information about private keys through interactions with devices that sign messages.
- Violate the logic of the protocol, including cryptographic primitives such as multi-signatures and mixed schemes.
- Lead to leakage of key information and compromise of security.
Methodology of protection and secure implementation
For reliable protection it is necessary:
- Complete check of point belonging to a group. The main element is the check of the PPP point order:

n⋅P=On \cdot P = \mathcal{O}n⋅P=O
where nnn is the order of the base point, O\mathcal{O}O is the point at infinity.
- Validation during decoding – after yyy is restored and before use.
- Ignoring or rejecting invalid points.
An example of a safe fix that includes a dot order check (Ruby-like code):
ruby:def self.decode_from_x_secure(x_string, group)
x = ECDSA::Format::FieldElementOctetString.decode(x_string, group.field)
y_sq = group.field.mod(x.pow(3, group.field.prime) + 7)
y = y_sq.pow((group.field.prime + 1)/4, group.field.prime)
# Проверка, что y корректен
unless y.pow(2, group.field.prime) == y_sq
raise DecodeError, 'Public key not on the curve.'
end
y = y.even? ? y : group.field.prime - y
point = finish_decode(x, y, group)
# Проверка порядка точки: n * P == infinity
# group.order - порядок генератора кривой secp256k1
unless (point * group.order).infinity?
raise DecodeError, 'Point order is invalid (not in correct subgroup).'
end
point
end
Explanation:
- After decoding and selecting yyy, a point object is created.
- A check is performed that multiplying a point by the order of the group returns a point at infinity, which guarantees that the point belongs to the correct subgroup.
- If there is a mismatch, an exception is raised, preventing further exploitation of the vulnerability.
Recommendations for development
- Never rely solely on checking the equation of a curve.
- Use dot order checking or other validation mechanisms (e.g. cofactor check).
- In circuits, where possible, use proven libraries with built-in protection.
- Conduct audit and testing for Invalid Curve vulnerabilities.
Conclusion
Validation of elliptic curve points is a critical step in cryptographic security. Insufficient control can lead to serious attacks, including disclosure of secrets. The secure correction method with point order checking presented in this paper is a practical and reliable solution that minimizes the risk of attacks with invalid points.
Conclusions
Invalid Curve Attack is a critical threat that can seriously affect the security of cryptocurrency systems such as Bitcoin. Its scientific name and description are widely known, and related vulnerabilities have CVE numbers, including CVE-2015-6924. Implementing strict elliptic curve point verification measures is a must to prevent attacks and ensure long-term security.
Final conclusion
This paper discusses a critical vulnerability known as the Invalid Curve Attack — an attack related to the handling of invalid elliptic curve points in cryptosystems, including Bitcoin, which is based on ECDSA and the secp256k1 curve. The vulnerability arises due to insufficient verification that the decoded point actually belongs to the correct curve group, in particular the lack of verification of the order of the point. This allows an attacker to submit a specially crafted point outside the allowed subgroup, which leads to the possibility of disclosing private keys or forging digital signatures.

In the context of Bitcoin security, such an attack is extremely dangerous because it can break trust in the network, lead to the creation of fake transactions, and break the cryptographic protection that underlies the entire system. Implementing the protection requires strict verification of whether a point belongs to a regular curve and, above all, checking the order of the point to ensure that n×P=On \times P = \mathcal{O}n×P=O, where nnn is the order of the generator and O\mathcal{O}O is the point at infinity.
The scientific name of this vulnerability is Invalid Curve Attack , which is one of the most studied and serious classes of attacks on protocols using elliptic curves. It has a corresponding number in the CVE vulnerability database, for example, CVE-2015-6924 , which is related to extracting keys from HSM devices using a similar technique.
The conclusion highlights that comprehensive validation measures and the use of proven cryptographic implementations with protection against attacks on invalid points are necessary to ensure sustainable security of cryptocurrencies such as Bitcoin. Without these measures, there is a risk of serious compromises that can undermine the entire blockchain system infrastructure and trust in it.
This finding highlights the importance of proper implementation and testing of systems to ensure that the Invalid Curve Attack vulnerability cannot be exploited, thereby ensuring the security of user assets and the integrity of the blockchain.

