Bitcoin Forum
November 28, 2026, 09:52:02 PM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [ANN][DIY Hardware/Firmware] Personal TRNG v1.19 — Auditable Entropy Generator  (Read 83 times)
mixoftix (OP)
Full Member
***
Offline

Activity: 147
Merit: 196

[Curiousity Lab]


View Profile WWW
November 12, 2026, 06:37:16 PM
Last edit: November 23, 2026, 06:14:16 PM by mixoftix
 #1


Personal TRNG hardware prototype running in the lab (Single-Sided DIY edition).

Personal TRNG v1.19 — Hardware & Firmware Overview

I am sharing the open-source files and PCB layouts for Personal TRNG, an auditable DIY hardware entropy source built with an ATmega328P and standard logic ICs designed for air-gapped security work.

Key Features
  • Entropy Source by Shutter System & Jitter Capture: Uses four independent 8 MHz crystals with a 74HC04 hex inverter and a 74HC74 dual D flip-flop to sample metastability-based asynchronous jitter into the ATmega328P interrupts.
  • Operating Modes: Features NRNG, TRNG, MRNG, and HRNG (combining hardware jitter with a 2D physics dice simulator: Decent Dice Web Simulator).
  • Design & Output: Offered in single-sided and double-sided PCB editions (USB-C), streaming 115200 baud UART data with local 7-segment status feedback.

Why Hardware TRNG Matters for Sensitive Keys & Crypto Wallets
A 256-bit private key or 24-word BIP-39 mnemonic only offers 256 bits of security if the underlying entropy source is genuinely unpredictable. When software wallets or closed-source devices rely on deterministic PRNGs, uninitialized buffers, or weak system clocks, the effective keyspace collapses—allowing attackers to precompute candidate seeds and sweep funds remotely without ever touching the user's device. Using an external, inspectable hardware TRNG separates entropy generation from general-purpose OS/firmware bugs and lets you verify the randomness pipeline yourself.

-- Wishing everyone peace of mind and concrete, truly unguessable cold-storage wallets after building and using Personal TRNG.

Repositories

Sample UART Telemetry & Audit Log (115200 Baud)
For anyone auditing the firmware pipeline without building the hardware first, here is a live serial capture from the TRNG mode showing the raw timer captures (Block_J2 / Block_J3), 4-bit XOR jitter windows across 8 entropy rounds, and the resulting 32-bit harvested block:

Code:
Begin Random_Truly
Begin Block_Jitter
-> Jitter_Refresh <-
Begin Jitter_Strobe
-> Shutter_Chaos <-
11256~32823~18837~59648~37467~31241~1443~22986~9516~18239~3694~41168~35132~46998~18033~9288~49494~33382~7392~16161~42260~61096~46181~19911~10085~36840~26325~42342~52431~16331~31473~12416~
7088^14867^10999^4754^20529^14913^8485^3499^18673^20477^25693^12848^13674^16973^9745^6618^8488^3076^6436^37975^27159^8493^7235^26374^13657^29418^7009^11802^11184^2695^22173^4318^
End Jitter_Strobe

Begin True_Strobe
Block_J2(18): 33382 | Jitter_Window_2: 00000110
Block_J3(18): 3076  | Jitter_Window_3: 00000100
Jitter_Window (J2 xor J3): 00000010 -> Entropy_Round(1): 0010
End True_Strobe
...
Begin True_Strobe
Block_J2(25): 10085 | Jitter_Window_2: 00000101
Block_J3(25): 13657 | Jitter_Window_3: 00001001
Jitter_Window (J2 xor J3): 00001100 -> Entropy_Round(8): 1100
End True_Strobe

   [_Harvested Block] 00100100011000110101011000011100 <- 610489884
End Block_Jitter
   [_Magnitude Freed] 01001000110001101010110000111000 <- 1220979768
   [_Magnitude Freed] 10010001100011010101100001110000 <- 2441959536
   --------------------
   Truly_ENTROPY: 294475888
   Truly_RANDOM: 0.137126025
   --------------------
End Random_Truly
--------------------
Truly_Rand_Range: 2.194016454
--------------------
T-RNG: 2

Notes
- Treat output as raw entropy requiring offline KDF processing before key derivation.
- Released under an audit-only license.
- Community feedback and statistical testing (ent, Dieharder, NIST STS) are welcome.

#Personal_TRNG for concrete secure wallets..
https://github.com/mixoftix/personal_trng_firmware
BattleDog
Full Member
***
Offline

Activity: 245
Merit: 245


View Profile
November 23, 2026, 08:27:58 AM
 #2

Interesting.... Do you have any idea what happens if one or all the crystals fail or the output just starts repeating itself ? Would the firmware detect that and stop processing or would this device just keep giving you numbers ?

Have you run any statistical tests yet on this and how much time would it take to collect enough entropy for a 24-word seed?
mixoftix (OP)
Full Member
***
Offline

Activity: 147
Merit: 196

[Curiousity Lab]


View Profile WWW
November 23, 2026, 06:09:30 PM
 #3

Interesting.... Do you have any idea what happens if one or all the crystals fail or the output just starts repeating itself ? Would the firmware detect that and stop processing or would this device just keep giving you numbers ?

Have you run any statistical tests yet on this and how much time would it take to collect enough entropy for a 24-word seed?

Great questions, BattleDog. Here is how the hardware and firmware handle fault detection, statistical testing, and collection time:

1. Hardware Fail-Stop Interlock & Health Diagnostics
I designed this TRNG around Secure by Design principles so that a crystal failure results in a hard fail-stop rather than silent degradation:
  • Hardware-Level Halt: The 74HC74 dual D flip-flop requires two independent 8 MHz crystals driving its Data (D1, D2) pins and two driving its Clock (CLK1, CLK2) pins. Both Q outputs must toggle asynchronously to trigger external interrupts INT0 and INT1 on the ATmega328P. If a clock crystal stalls, no rising CLK edges arrive; if a data crystal stalls at a static logic level, the latched output stops toggling—halting interrupt-driven collection immediately.
  • Firmware-Level Verification: To build each 32-bit block, the firmware must capture two fresh 32-sample jitter arrays from INT0 and INT1. In HRNG mode, it also runs a two-layer Kinematic Footprint check in volatile SRAM that rejects stalled timers, repeating trajectories, or stuck oscillator pins before outputting anything. If any base oscillator fails, the pipeline halts instead of outputting stale or predictable data.
  • Pinpoint Fault Mode: There is also a dedicated diagnostic jumper mode (3-jumper configuration) on the board, and the upcoming firmware update will use it to isolate and display the exact failed crystal(s) on the 7-segment readout.

For a deeper breakdown of the fail-stop interlock and trajectory health checks, you can check out the whitepaper here:
https://mixoftix.net/essays/Kinematic_Footprints_for_Auditable_TRNG.pdf

2. Statistical Testing (NIST SP 800-22 & 800-90B)
Raw sequences extracted from this hardware pass the NIST SP 800-22 and SP 800-90B test suites. However, as you likely know, passing statistical p-value batteries only confirms distributional uniformity—it never proves true cryptographic min-entropy on its own, which is why we also rely on physical auditability and online trajectory/health checks rather than black-box post-processing alone.

You can see our diagnostic tool and experiments showing how easily weak sources can pass NIST tests behind naive whitening in this thread:
https://bitcointalk.org/index.php?topic=5600451.0

And for details on the HRNG mode (combining hardware jitter with the embedded 2D rigid-body physics dice simulator):
https://bitcointalk.org/index.php?topic=5599733.0

3. Collection Time for a 24-Word Seed (256 Bits)
  • Raw TRNG Mode: Each harvested block yields 32 bits from two 32-sample INT0/INT1 capture arrays, streaming at 115200 baud—so collecting 256+ bits of raw entropy (plus conservative oversampling margin before offline KDF/BIP-39 derivation) takes well under a second.
  • Auditable HRNG Mode (Physics Engine): Because the ATmega328P integrates multi-bounce rigid-body trajectories step-by-step (~1–2 seconds per validated drop) and oversamples 160–200 drops to guarantee a conservative >350-bit min-entropy margin, a full auditable batch takes roughly 3 to 5 minutes.

#Personal_TRNG for concrete secure wallets..
https://github.com/mixoftix/personal_trng_firmware
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!