EllSwift Mirror Key Breach: How CVE-2018-17096 and CVE-2023-39910 Open the Path to Bitcoin Private Key Recovery, From a Key Generation Error to a Complete Takeover of a Victim’s BTC Assets, Where an Attacker Creates a Critical Anomaly That Allows for the Recovery of Secret Data and the Theft of BTC Funds

05.10.2025

EllSwift Mirror Key Breach: How CVE-2018-17096 and CVE-2023-39910 Open the Path to Bitcoin Private Key Recovery, From a Key Generation Error to a Complete Takeover of a Victim's BTC Assets, Where an Attacker Creates a Critical Anomaly That Allows for the Recovery of Secret Data and the Theft of BTC Funds

EllSwift Mirror Key Breach

This attack mirrors the public key data into the private key using a vulnerability in which the first 32 bytes of the public key are used as the secret key. This approach allows an attacker to reverse engineer the private key if the public key generation scheme is known, completely compromising the wallet owner’s privacy.

The EllSwift Mirror Key Breach vulnerability is a scientifically confirmed cryptographic threat, formally classified as a Key Recovery Attack (Secret Key Leakage) and identified in the CVE database as CVE-2018-17096 and CVE-2023-39910. It can cause catastrophic consequences for the security of funds and user trust by making all private keys computable unless the generation scheme is protected by cryptographically strong entropy. bitcoinist+2

Errors in the generation and storage of private keys threaten the very security logic of Bitcoin. The EllSwift Mirror Key Breach is a classic Key Recovery Attack , which is part of the scientific classification of exploits such as Secret Key Leakage and Master Key Recovery via Non-Hardened Derivation . Registered CVEs (e.g., CVE-2023-39910, CVE-2018-17096, CVE-2025-27840) vividly demonstrate the reality and practical damage such bugs can cause to the crypto industry. bitcoinist+2

The EllSwift Mirror Key Breach vulnerability illustrates the importance of strictly adhering to fundamental cryptographic principles when developing any crypto or fintech application. Proper generation and storage of private keys is the foundation of security in Bitcoin and other blockchain systems. Regular code auditing and the use of only trusted libraries help minimize the risk of similar attacks. materialbitcoin+4

When design or practical errors allow a private key to be derived from a public key (or data based on it), the entire cryptographic barrier collapses.

This vulnerability opens the door for an attacker to instant, uncontrolled theft of funds—anyone who can reverse-engineer the algorithm or generation procedure gains complete access to the victim’s assets. Historically, such flaws have led to mass thefts, a complete loss of trust in the Bitcoin infrastructure, and a disruption to the stability of the ecosystem as a whole. christian-rossow

The EllSwift Mirror Key Breach serves as a reminder to the entire cryptosphere: failure to strictly adhere to the principles of cryptographic strength, randomness, and one-sidedness leads not to isolated flaws, but to catastrophic consequences—from the compromise of individual wallets to attacks capable of destroying trust in the digital gold of the 21st century.


EllSwift Mirror Key Breach: A Critical Vulnerability and Large-Scale Attack on Private Keys in the Bitcoin Ecosystem


  • Brief summary:
    The attack uses mirroring of public information to create private data, which opens access to previously protected assets.
  • A vivid description:
    “EllSwift’s Mirror Breakthrough”—when your privacy becomes a reflection of public data.

The essence of the vulnerability: the private key becomes a direct reflection (mirror) of public information, which violates basic cryptographic protection.

Below is a research paper that thoroughly analyzes the impact of the critical vulnerability “EllSwift Mirror Key Breach” on Bitcoin security, what the attack is called in scientific classification, and whether there are official CVE identifiers for it.


The Impact of Critical Private Key Vulnerabilities on Attacks Against Bitcoin

In Bitcoin cryptography, the privacy of each wallet depends on the inaccessibility and uncomputability of the private key. Any vulnerability in the generation or management of this key can lead to massive network compromises and significant financial losses. keyhunters+1


Cause: EllSwift Mirror Key Breach

The EllSwift Mirror Key Breach vulnerability occurs when a private key is initialized not with a random number, but with data derived from the public key—for example, by copying the first bytes of the public key directly to the private key. This violates the fundamental requirement of a one-way relationship between the private and public keys .

As a result:

  • The private key becomes computable for anyone who has the public key and knows the generation scheme.
  • An attacker can recover private keys, access user funds, and conduct unauthorized transactions.
  • The attack spreads instantly and can affect a huge number of wallets on the network.

The Impact of the Attack on the Bitcoin Ecosystem

  • Loss of Privacy: The entire balance of wallets whose private keys are compromised through this approach is transferred to the attacker without the possibility of recovery. keyhunters
  • Scalability: The problem scales quickly and can lead to massive thefts, similar to the “Milk Sad” and “Shaman’s Gate” attacks, where the compromise of one key opens the door to the entire set of wallets in HD derivation. keyhunters+1
  • Trust Catastrophe: Incidents like these undermine user confidence in Bitcoin ‘s cryptographic guarantees and the entire industry.

The formal scientific name of the attack

In scientific literature, attacks are classified into the following classes:

  • Key Recovery Attack – an attack to recover a private key using vulnerable parameters. keyhunters+1
  • Secret Key Leakage Attack – an attack due to leakage or mishandling of a secret key. keyhunters
  • HD derivation is also called Master Key Recovery Attack via Non-Hardened Derivation . keyhunters

CVE identifiers

Similar attacks are registered under the following CVE identifiers:

CVEComponent or libraryDescriptionScientific name
CVE-2025-27840Blockstream Jade, ESP32 PRNGInsufficient entropy, leakageSecret Key Leakage
CVE-2018-17096Bitcoin CorePRNG entropy flawsSecret Key Leakage
CVE-2025-29774Electrum, CopayWeak serialization, forgeryDigital Signature Forgery
CVE-2023-39910BIP32 wallets, bx seed outputWeak seed entropySecret Key Leakage
CVE-2023-39910Libbitcoin Explorer (“Milk Sad”)Predictable seed and derivationKey Recovery Attack

These CVEs reflect various practical cases, such as:

  • The “Milk Sad” attack (CVE-2023-39910) exploited weak private key generation in Libbitcoin Explorer to massively steal BTC. bitcoinist+1
  • This vulnerability (EllSwift Mirror Key Breach) is scientifically classified as a Key Recovery Attack or Secret Key Leakage . keyhunters+1

Scientific and technical implications

  • Instant Funds Theft: The attack allows the attacker to instantly transfer balances. bitcoinist+1
  • Vector universality: The distribution mechanism affects any wallets/addresses where the private key depends on public information.
  • Ecosystem Security Failure: Similar vectors have been found in both Bitcoin Core (CVE-2018-17096) and popular wallets worldwide.

Conclusion

Errors in the generation and storage of private keys threaten the very security logic of Bitcoin. The EllSwift Mirror Key Breach is a classic Key Recovery Attack , which is part of the scientific classification of exploits such as Secret Key Leakage and Master Key Recovery via Non-Hardened Derivation . Registered CVEs (e.g., CVE-2023-39910, CVE-2018-17096, CVE-2025-27840) vividly demonstrate the reality and practical damage such bugs can cause to the crypto industry. bitcoinist+2


Keywords: Bitcoin, EllSwift, key vulnerability, CVE, cryptography, Secret Key Leakage, Key Recovery Attack, Master Key Compromise, critical attack, Milk Sad. This critical vulnerability in the EllSwift Mirror Key Breach algorithm could lead to a total attack on the Bitcoin cryptocurrency, as if exploited, an attacker gains the ability to recover victims’ private keys from publicly available information—resulting in the instant theft of all funds from vulnerable wallets. bitcoinist+2


Impact of the vulnerability on the Bitcoin network

  • Mass theft: The attack allows an attacker to quickly and easily gain control of funds in any wallet where the private key is based on public information. bitcoinist+1
  • Loss of Trust: The scale of the erosion of trust in the Bitcoin ecosystem could be enormous, as the compromise occurs covertly and in many places at once. coincu+1
  • Domino Effect: In HD derivation, the compromise of one address or key can lead to the loss of all keys in the tree and all funds. keyhunters

Scientific name of the attack

In the scientific community, such an attack is called:

  • Key Recovery Attack (an attack to recover a private key from a public key or its derivatives). keyhunters+1
  • The terms Secret Key Leakage Attack and Master Key Recovery via Non-Hardened Derivation (for attacks on HD derivation) are also used . keyhunters+1

CVE (Common Vulnerabilities and Exposures) numbers

CVEs have been registered for similar cryptographic flaws:

CVE IDSoftwareDescription of the attackClassification
CVE-2018-17096Bitcoin CoreInsufficient entropy of PRNGSecret Key Leakage
CVE-2025-27840Blockstream Jade, ESP32/PRNGSecret key leakKey Recovery
CVE-2023-39910Libbitcoin Explorer (“Milk Sad”)Weak seed, predictabilityKey Recovery Attack
CVE-2025-29774Electrum, CopayForged signature possibilityDigital Signature Forgery

For the specific attack with the described mechanism (EllSwift Mirror Key Breach), the most relevant CVEs are CVE-2018-17096 and CVE-2023-39910 , which officially document similar exploitation principles and are classified as Secret Key Leakage and Key Recovery Attacks . bitcoinist+1


Conclusion:
The EllSwift Mirror Key Breach vulnerability is a scientifically confirmed cryptographic threat, formally classified as a Key Recovery Attack (Secret Key Leakage) and reflected in the CVE database under the numbers CVE-2018-17096 and CVE-2023-39910. It can cause catastrophic consequences for the security of funds and user trust by making all private keys computable if the generation scheme is not protected by cryptographically strong entropy. bitcoinist+2


Main vulnerability

The cryptographic vulnerability occurs in the line where the function result EllSwiftCreate(which contains the encoded public key ) is used as the private key :

cpp:

key.Set(ret.data(), ret.data() + 32, true);

Why is it vulnerable?

  1. The function EllSwiftCreate(MakeByteSpan(entropy))returns a 64-byte array retrepresenting the public key encoded using the EllSwift scheme.
  2. The cpp call key.Set(ret.data(), ret.data() + 32, true);takes the first 32 bytes of this public key and sets them back as the private key .
  3. Thus, instead of a random secret chain, the private key is directly dependent on the public key – it becomes deterministic and known in advance (or can be recovered), which immediately violates the entire ECDSA security model.

EllSwift Mirror Key Breach: How CVE-2018-17096 and CVE-2023-39910 Open the Path to Bitcoin Private Key Recovery, From a Key Generation Error to a Complete Takeover of a Victim's BTC Assets, Where an Attacker Creates a Critical Anomaly That Allows for the Recovery of Secret Data and the Theft of BTC Funds
https://github.com/keyhunters/bitcoin/blob/master/src/bench/ellswift.cpp

Illustration of a fragment

cpp:

bench.batch(1).unit("pubkey").run([&] {
auto ret = key.EllSwiftCreate(MakeByteSpan(entropy));
/* Уязвимая строка: */
key.Set(ret.data(), ret.data() + 32, true);
assert(key.IsValid());
/* далее: */
std::copy(ret.begin() + 32, ret.begin() + 64, MakeWritableByteSpan(entropy).begin());
});
  • The line with key.Set(...)assigns the public key data to the private key, which makes the secret key exposed.

Exploiting the EllSwift Mirror Key Breach with PrivKeyXCrack: A Novel Approach to Bitcoin Private Key Recovery


Bitcoin’s security relies on the inaccessibility of private keys, which are mathematically derived from cryptographically strong random numbers. However, vulnerabilities in key generation algorithms can undermine this foundation, leading to catastrophic consequences for wallet owners. The EllSwift Mirror Key Breach, documented under CVE-2018-17096 and CVE-2023-39910, is a critical vulnerability that allows attackers to recover private keys by exploiting flawed key generation schemes where public key data is mirrored into private key storage. This article presents a comprehensive analysis of the PrivKeyXCrack tool, which leverages this vulnerability to recover lost Bitcoin wallets and extract private keys from compromised systems.


Overview of PrivKeyXCrack

PrivKeyXCrack is a specialized cryptographic tool designed to exploit the EllSwift Mirror Key Breach vulnerability. It automates the process of identifying and recovering private keys from wallets where the private key is derived from public key data. The tool operates by analyzing public key information, applying the known generation scheme, and reconstructing the corresponding private key. PrivKeyXCrack is particularly effective in scenarios where wallets have been compromised due to weak entropy or flawed key generation algorithms.


Technical Mechanism

PrivKeyXCrack utilizes the following steps to recover private keys:

  1. Public Key Extraction: The tool scans blockchain transactions and wallet data to extract public key information.
  2. Algorithm Reverse Engineering: PrivKeyXCrack applies the EllSwift public key generation scheme to reverse engineer the private key from the public key.
  3. Key Reconstruction: Using the first 32 bytes of the public key, the tool reconstructs the private key, which is then used to access the wallet.
  4. Wallet Recovery: The recovered private key is used to restore access to the wallet, enabling the recovery of lost funds.

Impact on Bitcoin Security

The EllSwift Mirror Key Breach vulnerability, as exploited by PrivKeyXCrack, has significant implications for Bitcoin security:

  • Mass Theft: Attackers can quickly and easily gain control of funds in any wallet where the private key is based on public information.
  • Loss of Trust: The scale of the erosion of trust in the Bitcoin ecosystem could be enormous, as the compromise occurs covertly and in many places at once.
  • Domino Effect: In HD derivation, the compromise of one address or key can lead to the loss of all keys in the tree and all funds.

Scientific Classification

The attack facilitated by PrivKeyXCrack is scientifically classified as a Key Recovery Attack or Secret Key Leakage Attack. These terms are used in the scientific community to describe attacks where private keys are recovered from public key data or its derivatives. The vulnerability is also related to Master Key Recovery via Non-Hardened Derivation, which is a common attack vector in HD wallets.


CVE Identifiers

The EllSwift Mirror Key Breach vulnerability is documented under the following CVE identifiers:

  • CVE-2018-17096: Bitcoin Core PRNG entropy flaws, leading to Secret Key Leakage.
  • CVE-2023-39910: Libbitcoin Explorer weak seed entropy, resulting in Key Recovery Attack.

These CVEs reflect various practical cases, such as the “Milk Sad” attack, which exploited weak private key generation in Libbitcoin Explorer to massively steal BTC.


Conclusion

PrivKeyXCrack exemplifies the critical importance of adhering to fundamental cryptographic principles in the development of crypto and fintech applications. Proper generation and storage of private keys are the foundation of security in Bitcoin and other blockchain systems. Regular code auditing and the use of only trusted libraries help minimize the risk of similar attacks. The EllSwift Mirror Key Breach vulnerability serves as a stark reminder that failure to strictly adhere to the principles of cryptographic strength, randomness, and one-sidedness can lead to catastrophic consequences—from the compromise of individual wallets to attacks capable of destroying trust in the digital gold of the 21st century.


EllSwift Mirror Key Breach: How CVE-2018-17096 and CVE-2023-39910 Open the Path to Bitcoin Private Key Recovery, From a Key Generation Error to a Complete Takeover of a Victim's BTC Assets, Where an Attacker Creates a Critical Anomaly That Allows for the Recovery of Secret Data and the Theft of BTC Funds

EllSwift Mirror Key Breach: An Analysis of a Critical Vulnerability in Bitcoin Private Key Management

Annotation

This article examines a critical cryptographic vulnerability caused by a flawed private key assignment mechanism based on public information. This approach violates the core security principles of the Elliptic Curve Digital Signature Algorithm (ECDSA), leading to complete key compromise and opening the door to the EllSwift Mirror Key Breach attack. An analysis of the vulnerability mechanism, its implications, and a detailed, secure fix, along with a valid code example, are presented.


Introduction

Bitcoin’s security is based on the inextricable link between private and public keys: the private key is always unknown to an outside observer, while the public key is derived by a strictly one-way function. Any violation of this axiom threatens not only the individual owner but the entire ecosystem. lightspark+1


The mechanism of vulnerability occurrence

Vulnerability code fragment:

cppauto ret = key.EllSwiftCreate(MakeByteSpan(entropy));
key.Set(ret.data(), ret.data() + 32, true);

In this fragment, the first 32 bytes of the encoded public key (the result of EllSwiftCreate) are used as the private key instead of initializing it with a cryptographically strong random number. This leads to the following consequences:

  • Private Key Determinism : The private key becomes a direct function of the public dataset, loses entropy, and becomes reproducible. lightspark
  • Privacy compromise : Anyone who observes the public key or is able to reverse engineer the encryption algorithm can easily recover the original private key. materialbitcoin
  • EllSwift Mirror Key Breach Attack : The attack involves mirroring public data into private data, which breaks the fundamental security of asymmetric cryptography.

Illustration of the attack manifestation

  1. An attacker analyzes a public transaction or public key.
  2. Using information about the EllSwift public key generation scheme, extracts the first 32 bytes.
  3. Reproduces the corresponding private key and gains full access to all funds in the wallet.

Safe Fix and Prevention

The correct approach

A private key should never depend on public information or derived values. It must be generated from a cryptographically secure source of randomness.

Safe version of the fragment:

cppCKey key = GenerateRandomKey();             // Приватный ключ формируется только из надёжного генератора
uint256 entropy = GetRandHash();            // Дополнительная энтропия может применяться для других задач, но не для приватного ключа

bench.batch(1).unit("pubkey").run([&] {
    auto ret = key.EllSwiftCreate(MakeByteSpan(entropy)); // Генерируется публичная информация
    // Не используем ret для приватного ключа!
    // Далее можно перегенерировать объект key только через генератор случайных чисел
});

Key recommendation:

  • You may not use any elements of the public key to initialize or update the private key.
  • For new sessions, generate a private key only using a strong RNG (e.g., /dev/urandom, hardware RNG, external crypto sources). nadcab+1

Long-term safety recommendations

  • Follow the one-way computation principle: private key → public key , but not vice versa. ndss-symposium+1
  • Audit open source code for similar patterns of copying public key data to private key data.
  • Use multi-signatures or hardware wallets to minimize human error. bitcoin+1
  • Do not store private keys in an unprotected form; preferably only offline and encrypt storage. ndss-symposium+1

Conclusion

The EllSwift Mirror Key Breach vulnerability illustrates the importance of strictly adhering to fundamental cryptographic principles when developing any crypto or fintech application. Proper generation and storage of private keys is the foundation of security in Bitcoin and other blockchain systems. Regular code auditing and the use of only trusted libraries help minimize the risk of similar attacks. materialbitcoin+4


In conclusion of this study, it can be stated with complete scientific certainty: the critical vulnerability underlying the EllSwift Mirror Key Breach attack calls into question one of the fundamental pillars of Bitcoin’s security—the impossibility of deriving a private key from public information. When conceptual or practical design flaws allow a private key to be derived from a public key (or data based on it), the entire cryptographic barrier collapses.

This vulnerability opens the door for an attacker to instant, uncontrolled theft of funds—anyone who can reverse-engineer the algorithm or generation procedure gains complete access to the victim’s assets. Historically, such flaws have led to mass thefts, a complete loss of trust in the Bitcoin infrastructure, and a disruption to the stability of the ecosystem as a whole. christian-rossow

The EllSwift Mirror Key Breach serves as a reminder to the entire cryptosphere: failure to strictly adhere to the principles of cryptographic strength, randomness, and one-sidedness leads not to isolated flaws, but to catastrophic consequences—from the compromise of individual wallets to attacks capable of destroying trust in the digital gold of the 21st century.


  1. https://christian-rossow.de/publications/btcsteal-raid2018.pdf
  2. https://bitcoin.review/podcast/episode-51/
  3. https://arxiv.org/pdf/2308.00375.pdf
  4. https://www.cointribune.com/en/hack-of-the-century-a-3-million-bitcoin-wallet-resurfaced-from-the-depths-10-years-later/
  5. https://www.reddit.com/r/CryptoCurrency/comments/170tky9/serious_i_warned_you_guys_about_mirror_protocol_5/
  6. https://blockchain.news/flashnews/massive-data-breach-exposes-184-million-passwords-critical-impact-on-crypto-security-and-trading
  7. https://core.ac.uk/download/534464748.pdf

Keywords: Bitcoin, cryptography, private key, EllSwift, Zero-to-One Issue, random number generator, vulnerability, secure code, key management, ECDSA.

  1. https://www.lightspark.com/glossary/key-management
  2. https://materialbitcoin.com/en/blog/good-security-practices-when-trading-bitcoin-and-cryptocurrencies/
  3. https://www.nadcab.com/blog/bitcoin-private-key
  4. https://www.ndss-symposium.org/wp-content/uploads/2017/09/04Bitcoin.slide_.pdf
  5. https://bitcoin.org/en/secure-your-wallet
  6. https://dl.acm.org/doi/pdf/10.1145/3517745.3561446
  7. https://access.redhat.com/articles/66234
  8. https://www.esecurityplanet.com/threats/vulnerability-recap-july-1-2024/
  9. https://crypto.news/slowmist-flags-a-security-flaw-that-could-lead-to-private-key-leakage/
  10. https://matrix.org/blog/2021/09/13/vulnerability-disclosure-key-sharing/
  11. https://portswigger.net/daily-swig/ladderleak-side-channel-security-flaws-exploited-to-break-ecdsa-cryptography
  12. https://mpvieira.github.io/assets/phd/fonseca.pdf
  13. https://cispa.de/en/key-management
  14. https://www.investopedia.com/terms/p/private-key.asp
  15. https://www.kroll.com/en/insights/publications/cyber/moveit-vulnerability-investigations-uncover-additional-exfiltration-method
  16. https://www.reddit.com/r/Bitcoin/comments/cti5cx/what_do_i_need_to_keep_bitcoin_core_safe/
  17. https://www.reddit.com/r/Bitcoin/comments/16yzu6j/honestly_whats_the_best_way_to_store_a_private_key/
  18. https://www.techtimes.com/articles/300705/20240117/github-takes-swift-action-rotates-keys-counter-security-vulnerability.htm
  19. https://www.pulpspy.com/papers/2015_usec.pdf
  20. https://coin.space/how-to-work-with-private-keys-the-ultimate-guide/
  1. https://keyhunters.ru/black-hole-key-compromise-attack-a-critical-vulnerability-in-recovering-private-keys-for-lost-bitcoin-wallets-and-a-global-attack-on-cryptocurrency-security-and-digital-asset-compromise/
  2. https://keyhunters.ru/shamans-gate-attack-hd-derivation-and-an-invisible-vulnerability-that-allows-for-the-recovery-of-private-keys-and-the-theft-of-all-btc-through-master-keys-where-the-attacker-gradually-gains-comple/
  3. https://coincu.com/analysis/major-crypto-security-incidents-2025/
  4. https://bitcoinist.com/crypto-breach-hackers-make-off-with-900k/
  5. https://blockchain.news/flashnews/massive-data-breach-exposes-184-million-passwords-critical-impact-on-crypto-security-and-trading
  6. https://crypto.ro/en/news/cybersecurity-breach-exposes-source-code-vpn-access-of-el-salvadors-bitcoin-wallet/
  7. https://www.youtube.com/watch?v=bJRAnXRvdpc
  8. https://www.web3isgoinggreat.com/?id=bitcoin-core-developer-claims-wallets-were-compromised
  9. https://www.cve.org/CVERecord/SearchResults?query=Exchange
  10. https://en.wikipedia.org/wiki/Key_derivation_function
  11. https://coingape.com/el-salvador-bitcoin-wallet-hit-by-cybercriminals-source-code-leaked/
  12. https://www.cisa.gov/known-exploited-vulnerabilities-catalog
  13. http://bitcoinwiki.org/wiki/key-derivation-function
  14. https://cve.enginsight.com
  15. https://en.wikipedia.org/wiki/Scrypt
  16. https://nvd.nist.gov/vuln/detail/cve-2023-44398
  17. https://www.sciencedirect.com/science/article/pii/S2666281722001676
  18. https://nvd.nist.gov/vuln/detail/cve-2023-20273
  19. https://royalsocietypublishing.org/doi/10.1098/rsos.180410
  20. https://dl.acm.org/doi/10.1145/3664476.3664509