Weak RNG Wallet Lab
How one bad random number generator shrinks a 2128 wallet down to a space you can actually search — 65,536 guesses in the teaching mode, 240 / 272 for the real Coldcard flaw. Step 5 sweeps whichever one you pick, for real; only the teaching space is small enough to exhaust while you watch. Everything below runs in your browser — no keys leave this tab. The one exception is the optional balance check in step 5, which sends a single generated address to mempool.space only if you tick it on.
สาธิตเพื่อการศึกษา: ถ้าเครื่องสร้างเลขสุ่มพัง พื้นที่ที่ต้องเดาจะเล็กลงจนไล่เดาได้จริง — โหมดสอนขนาด 65,536 ค่าไล่จนครบได้ในไม่กี่นาที ส่วนของจริงระดับ 2⁴⁰ / 2⁷² ไล่ได้จริงแต่ไม่มีวันจบ
Step 1 — Choose the entropy source
Entropy the way a working hardware wallet produces it. Pinned here to the published BIP-39 all-zeros test vector so the demo never mints a wallet anyone could accidentally fund.
- Search space
- 2¹²⁸ ≈ 3.4 × 10³⁸
- Brute force
- no button — unreachable
The real bug, at its real size. Effective entropy per Coinkite's advisory — not a simplification.
- Search space
- 2⁴⁰ ≈ 1.1 × 10¹²
- In this tab
- runs, never finishes
A PRNG seeded with only 16 bits. Deliberately far weaker than the real flaw — this is a teaching simplification, sized so the sweep actually finishes while you watch.
- Search space
- 2¹⁶ = 65,536
- In this tab
- completes in 1–3 min
Entropy is the only secret in the whole system. Every key, address and signature below is a deterministic function of these 16 bytes — so the security of the wallet is exactly the size of the space those bytes were drawn from, nothing more.
ค่าสุ่ม (entropy) คือความลับเพียงอย่างเดียว ทุกอย่างที่เหลือคำนวณต่อมาแบบตายตัว ดังนั้นความปลอดภัยของกระเป๋าเท่ากับ 'จำนวนค่าที่เป็นไปได้' ของค่าสุ่มนี้เท่านั้น
The real Coldcard bug
As of 3 August 2026 — the investigation is still open.
The 16-bit space is the teaching mode's simplification, chosen so a sweep finishes on one laptop while you watch. The real flaw was ~40-bit (Mk3) / ~72-bit (Mk4, Mk5, Q), per Coinkite's technical backgrounder. Step 5 searches those spaces too, at full width — the difference is that only the 16-bit one is small enough to exhaust; a Coldcard sweep runs genuinely and never finishes. Both remain vastly smaller than the 2¹²⁸ a correct implementation gives you.
พื้นที่ 16 บิตคือการย่อส่วนของ "โหมดสอน" เพื่อให้ไล่เดาจบได้ในเครื่องเดียว ของจริงคือ ~40 บิต (Mk3) และ ~72 บิต (Mk4/Mk5/Q) ซึ่งขั้นตอนที่ 5 ก็ไล่เดาเต็มขนาดจริงเช่นกัน ต่างกันแค่ว่ามีเพียง 16 บิตเท่านั้นที่เล็กพอจะไล่จนครบ ส่วนของจริงไล่ได้แต่ไม่มีวันจบ และทั้งคู่ก็ยังเล็กกว่า 2¹²⁸ ที่ควรจะเป็นอยู่มหาศาล
- Mechanism
- libngu checked whether MICROPY_HW_ENABLE_RNG was *defined* rather than *enabled*. Production config sets it to 0 because Coinkite ships its own hardware-RNG wrapper, so the build succeeded and bound seed generation to MicroPython's Yasmarang PRNG, initialised from the MCU unique ID and timer registers. [Block engineering]
- Entry point
- A March 2021 commit changed seed generation from ckcc.rng_bytes to ngu.random.bytes. [Block engineering]
- Effective entropy
- ~40 bits on Mk3 and ~72 bits on Mk4 / Mk5 / Q, against the 128-bit target. [Coinkite]
- Scope
- Mk2/Mk3 firmware v4.0.1–5.0.3. Coinkite's first advisory called Mk4/Q/Mk5 unaffected; on 1 August 2026 it expanded the advisory to confirm ~72 bits on those models too. [Coinkite]
- Fixed firmware
- Mk2/Mk3 4.2.0+, Mk4/Mk5 5.6.0+, Q 1.5.0Q+. Updating firmware does not repair a seed that was already generated. [Coinkite]
- Outside the issue
- Seeds created with 50 or more private dice rolls. [Coinkite]
Technical sources: Coinkite entropy backgrounder (the ~40 / ~72-bit figures) · Block engineering disclosure (the MICROPY_HW_ENABLE_RNG / Yasmarang mechanism). No loss estimate is quoted here because the reported number moved substantially within days — read the advisory for current figures.