The post explains the background behind the recently discovered random number generator bug in a COLDCARD bitcoin hardware wallet.

What mistakes were made, when, and why.

TLDR:

After a competitor has introduced a “clone” of a COLDCARD, Coinkite, the maker of COLDCARD has overreacted by dropping all the GPL licensed code from its codebase, including a certain cryptographic library.

Coinkite managed to replace it with another publicly available library (libngu), allegedly written by unaffiliated anonymous author, who was later identified as a sockpuppet of the Coinkte’s own CTO.

After a mistake has been introduced into the code and a faulty check did not detect it at compile time, the knowingly bad software RNG fallback by the libngu, instead of the hardware RNG, have been combined with the software random number generator included in the MicroPython interpreter, producing bitcoin wallet keys with low enough entropy to be guessed by the attacker.

Lessons learned:

  1. Do not make rush decisions when dealing with cryptography.
  2. Avoid creating a sock-puppet accounts when you’re already a public figure, unless you want to look like a criminal when the shit hits the fan.

Archive link, because I feel like the shit has not hit the biggest fan yet : https://archive.is/JvlLf