A five-year-old build flag left inside COLDCARD hardware wallet firmware has been tied to a $116 million bitcoin drain, after a misconfigured compile-time setting quietly weakened the randomness used to generate user seeds. The hardware wallet drain build flag turned a dormant configuration choice into one of the largest self-custody thefts of 2026.
Block Engineering said the affected COLDCARD firmware defined the macro MICROPY_HW_ENABLE_RNG as zero, while the libngu library checked only whether the macro existed rather than its value, causing a fallback to MicroPython’s deterministic Yasmarang generator. That path produces predictable output, undermining the entropy a hardware wallet is supposed to guarantee. For related coverage, see Coinbase Launches 24/5 Trading for Nearly 4,000 U.S. Stocks in the UK.
How the five-year-old build flag became central to the $116 million wallet drain
A build flag is a compile-time switch that tells software which features to turn on when it is assembled into a shipped binary. In this case, the flag was meant to enable a true hardware random number generator; instead it was set to zero, and the downstream check never caught it. For related coverage, see Russia Crypto Exchange Law Signed by Putin.
Because the flag governed how private keys were seeded, its failure was not cosmetic. Seeds are the master secret behind every address a wallet controls, so predictable randomness at generation time means the resulting keys can be reconstructed by an attacker who understands the flaw.
TRM Labs said attackers drained 1,816 BTC, worth about $116 million, from more than 5,200 addresses across four waves.
The breadth of the campaign is as notable as its size. TRM Labs said more than 5,200 addresses were swept, indicating the weakness touched a wide population of devices rather than a handful of unlucky users.
Block Engineering said active exploitation was already under way when it published its analysis on July 30, 2026, and pointed readers to issuer Coinkite for the definitive report.
What failed between development, release review and wallet security controls
A flag surviving for years implies it passed through multiple release cycles without detection. Hardware wallet trust rests on strict signing, reproducible builds and verification discipline, precisely the checkpoints where a zero-valued RNG macro should have been flagged.
Coinkite quantified the damage to entropy directly. It said seeds generated on Mk4, Q and Mk5 devices before the fixed firmware had about 72 bits of entropy instead of the expected 128 bits, a gap that makes brute-force reconstruction feasible.
Coinkite said funds generated on affected firmware are at risk unless the seed included at least 50 independent, private dice rolls, or the wallet is protected by a strong, unique BIP-39 passphrase. The remediation is also fragmented, split across five release tracks rather than a single universal patch.
The distinction between checking a macro’s existence and checking its value is the kind of subtle logic gap that automated integrity checks and code review exist to catch. Hardware wallet users expect stronger safeguards than standard apps precisely because a seed cannot be rotated as easily as a password.
Why the incident matters for hardware wallet users and the wider sector
A nine-figure loss strikes at the core marketing promise of cold storage. CoinDesk reported on July 31, 2026 that the exploit had already stolen nearly 600 BTC, worth roughly $38 million at the time, and that analysts viewed it as a potential tailwind for regulated custodians and spot bitcoin ETFs.
Sentiment reflected the shock. The Fear & Greed Index sat at 25, or Extreme Fear, as bitcoin traded near $64,766. The debate echoes other governance and trust flashpoints in the sector, from a crypto project pulling a filing tied to a 10 trillion-token plan to the steady institutional pull of deals like Circle’s renewed USDC arrangement with Coinbase.
For affected users, the open questions are practical: which firmware track applies to their device, whether their seed met the dice-roll or passphrase exemption, and how quickly funds can be migrated. As of August 6, 2026, Coinkite had not published its own cumulative loss total or an attacker-address list, leaving TRM Labs’ tally as the working figure.
The broader lesson is that legacy build settings are not harmless. A single compile-time value, left unexamined across release cycles, translated directly into systemic risk for a product line sold on the strength of its security, a reminder that operational rigor at build time is inseparable from custody trust, much like the compliance scrutiny now shaping regulated crypto trading rules for retail investors in Russia.
Disclaimer: This article is for informational purposes only and does not constitute financial or investment advice. Cryptocurrency and digital asset markets carry significant risk. Always do your own research before making decisions.