In light of the catastrophic low-entropy bug in Coldcard hardware wallets, linked to publicly observed thefts beginning on July 30, Bitcoin holders have started to re-evaluate the trust assumptions in their hardware wallet setups.
How Coldcard’s entropy flaw worked
The Coldcard devices were equipped with apparently functional STM32 “true random number generators” (TRNGs) that rely on physical processes to produce an unguessable seed phrase.
However, after Coldcard creator NVK decided to initiate a firmware rewrite to switch from a GPL-licensed free software model to a read-only model, a serious vulnerability appears to have been introduced.
Starting with firmware version 4.0.1, released in March 2021, the device used MicroPython’s Yasmarang PRNG instead of properly using the STM32 hardware RNG.
Random number generation is an unsolvable problem in computer science, which is why the generation of secure, unguessable private keys always has to rely on external physical processes to a degree.
The use of the Yasmarang PRNG was widely characterized by analysts in the space as a pre-programmed fallback. However, Coinkite has now disputed this characterization in a recent X post:
The conjecture that Coldcards were programmed to default to an obviously insecure method of seed generation has also sparked speculation on X about whether this was a deliberately placed backdoor.
Investigative Bitcoin journalist Hodlnaut speculated that the bug stemmed from careless development practices and efforts to suppress errors through random changes.
Coinkite estimated that Mk2 and Mk3 devices generated seeds with 40 bits of entropy, while the Mk4, Mk5 and Q achieved around 70 bits. Both are well short of the 128 bits required for a secure 12-word seed phrase.
Ever since then, attackers have been successfully brute-forcing private keys, stealing over $100 million worth of BTC. How likely a wallet is to be found depends on whether or not additional dice entropy was added, or a BIP-39 passphrase and non-standard path were used.
Related: Coldcard hackers transfer 64 BTC and 200 ETH to cryptocurrency mixers
Since then, James O’Beirne has set up a website with honeypot addresses, titled cktripwire, in order to estimate which types of wallets attackers are effectively sweeping.
Honeypots tracked by cktripwire. Source: cktripwire.com
How physical entropy saved some wallets
The Coldcard exploit has once again painfully driven home one of the community’s core principles: Don’t trust, verify.
Those users who did not rely on an opaque piece of engineering to generate entropy for the most security critical part of the process, but used a sufficient number of dice throws, saved their coins from the exploit.
Rolling dice is a simple, visibly transparent process an ordinary user can audit themselves and understand intuitively. Verifying the TRNG, on the other hand, would require detailed physical inspection of the electronics and examination of the firmware.
While some have used recent events as a pretext to declare the end of self-custody, following this best practice leaves very few options for a remote attacker.
If the seedphrase is generated through physical entropy without relying on the security of the hardware wallet, the only true single point of failure in wallet generation is removed.
The xpub and receiving addresses derived from the seed can be cross-checked by importing it into other devices.
Nonce exfiltration through an airgap can also be caught by checking if two devices generate the same RFC 6979-compliant signature when given an identical unsigned transaction.
Secure entropy generation is thus the absolute prerequisite for a secure wallet. Various methods and proposals for generating it have been making the rounds on X since the Coldcard exploit was made public.
The most popular method is to cross-check the device’s ability to correctly convert die faces into a BIP-39 seedphrase by applying a SHA-265 hash. Using upwards of 100 dice throws then suffices to generate entropy for a 24-word seed.
Simple paper methods, such as the table published by Bitbox, partition the space of BIP-39 seed words so that a combination of six dice rolls and a coinflip can directly be assigned a seed word without using electronics.
More sophisticated templates such as the codex32 dice de-biasing worksheet use a van Neumann extractor that can be computed by hand to generate a secure seed phrase even with biased dice.
An alternative to throwing dice is to print out the BIP-39 seed words, cut them up into equally sized small pieces of paper, shuffle them thoroughly and then draw random 24 words. Products such as Seedsticks or Entropia make this more convenient and robust.
Specialised hardware such as Frostsnap attempts to verifiably distribute entropy generation across devices.
Some users have taken to designing their own physical entropy devices that can generate a seedphrase nearly as quickly as a piece of electronic hardware.
Magazine: Do the Coldcard attacks mean all hardware wallets are now insecure?
Read the full article here














