Random number service for casino games — dice, roulette, slots, deck shuffles and provably fair rounds — built on an approved NIST SP 800-90A generator, with every outcome written to a tamper-evident journal.
RustHMAC_DRBG · HMAC-SHA-256NIST SP 800-90A Rev. 1 axumCAVP 720/720PractRand · BigCrush · SP 800-22 · Dieharder
getrandom(2)) plus a per-instance personalization string.[0, 1).POST /api/round/commit creates a server seed for this round only and returns sha256(server_seed) — show it to the player before play. The round can be bound to a player.POST /api/round/reveal returns the seed once; the round is then closed.sha256(server_seed | client_seed | nonce) — first 8 bytes as result_u64, its top 53 bits as result_float. Anyone can recompute it.Open rounds survive a service restart.
Every result is written to an append-only journal before it is returned; if it cannot be written, the request fails.
Each line carries sha256(previous hash || record), so editing, removing or reordering any record breaks the chain.
The verifier checks the chain, recomputes every revealed result and matches each revealed seed to its commitment.
Draw requests can carry a round_id that is stored with the result.
Every endpoint needs Authorization: Bearer <RNG_TOKEN>, compared in constant time.
Without a token /api/health answers only {"ok":true}.
| Battery | Input | Result |
|---|---|---|
| PractRand 0.96 | service output path, from 1 GB upward | no failures |
| PractRand 0.96 | prediction resistance on, 16 GB | no anomalies |
| PractRand 0.96 | provably fair results, 32 GB | no anomalies |
| TestU01 BigCrush | service output path, three independent runs | 2 runs all passed; 1 run with one borderline p (PeriodsInStrings), passed 5 repeats |
| TestU01 BigCrush | bit-reversed output (tests the low bits) | one borderline p (RandomWalk1), passed 5 repeats |
| NIST SP 800-22 (STS 2.1.2) | 2,000 × 1,000,000 bits, all 15 tests | 188 / 188, lowest proportion 1967 (threshold 1966) |
| Dieharder 3.31.1 | full -a, twice | 0 failed |
| Check | Draws | χ² | df | p | Verdict |
|---|---|---|---|---|---|
| Dice 1..6 | 60,000,000 | 8.33 | 5 | 0.139 | PASS |
| Roulette 0..36 | 37,000,000 | 39.70 | 36 | 0.309 | PASS |
| Slot reel 1..1000 | 100,000,000 | 1010.27 | 999 | 0.395 | PASS |
| Modulo-bias probe (thirds of 3·2⁶¹) | 30,000,000 | 0.40 | 2 | 0.820 | PASS |
| Dice serial pairs | 36,000,000 | 38.89 | 35 | 0.299 | PASS |
| 52-card shuffle: card × position | 2,000,000 | 2673.43 | 2652 | 0.381 | PASS |
| 52-card shuffle: top two cards | 2,000,000 | 2508.90 | 2651 | 0.976 | PASS |
| Floats [0,1), 1000 bins | 100,000,000 | 984.01 | 999 | 0.626 | PASS |
| Provably fair result_float | 10,000,000 | 1048.64 | 999 | 0.134 | PASS |
wrk, 4 threads, 10 connections, 15 s, POST /api/range with 1,000 numbers per request, client and service on the same 8-vCPU server.
Statistical tests show the output cannot be told apart from random by these batteries; they are evidence for an accredited test lab, not a certificate.
{"ok":true}. With a token: version, mechanism, reseed policy, per-instance stats, open rounds, journal position.u64.{min,max,count,round_id?} — count integers in [min,max], up to 4,096 per request, unbiased.{count,round_id?} — floats in [0,1).{deck:[…],round_id?} — Fisher–Yates shuffle of the input list.{round_id,player?} — new server seed for this round; returns server_seed_hash. Duplicate round_id → 409.{round_id,player?,client_seed,nonce} — reveals the seed once and returns result_u64, result_float. Unknown or closed round → 404, other player → 403./api/round/*.Every draw response includes journal_seq, the number of its journal record.
curl -s -X POST https://rnd.id5.dev/api/range \
-H "Authorization: Bearer $RNG_TOKEN" \
-H "Content-Type: application/json" \
-d '{"min":0,"max":36,"count":5,"round_id":"table-7:spin-1042"}'
// response will appear here