Skip to main content
Audits
Duel.com/Castle Roulette
Duel: Castle Roulette Audit

Castle Roulette

Certified · Active

Independent verification, backed by open-source code.

PF-2026-DL07Audited April 2026 · Updated October 2026Apr 2026 · Updated Oct 2026Framework 1.1Release v1.2.1Original audit e57da3e, 4 June 2026, 4 Jun 2026
AUDIT RESULTPassedPROVABLY FAIR — Full Pass19 / 19 steps passed0 flags · 0 hard fails
PROVABLY FAIR — Full Pass19 / 19 steps passed · 0 flags · 0 hard fails
Live Bets Verified
1,350
Parity Rate
100%
Simulated RoundsSimulated RTP 100.007%
5M
Simulated RTP 100.007%
Proven RTP · base tier
100.0%
Base stake tier · settlement edge 0
19 / 19Verification steps passed

Verification pipeline

Real bets. Independently reproduced.

Placed anonymously at Duel.com. We rebuilt the game logic from scratch and matched all 1,350 recorded outcomes.

DUEL CASTLE ROULETTE$0.01 · Bet on 2×
48×GREEN · Position 0
Round #538992drand 28012039 · Phase A
50 real rounds · Phase ARound 1 of 50
✓ Exact match
Green · 48×

The casino result, reproduced.

Casino outcome
Green · Position 0
Our reproduction
Green · Position 0
Recorded payout
$0.0000
Open source

Run this audit yourself

Open GitHub ↗

The repo is the credential. Every scored step ships as code. Check out v1.2.1, run npm ci, then npm test: 24 unit tests, 19 scored steps, all 1,350 live rounds re-verified offline and compared field by field with the committed results.

npm test
Needs git and Node.js 22View reproduction commands ↓
Castle Roulette Audit Overview

Duel.com Castle Roulette is provably fair: Full Pass under Framework 1.1. We captured 1,350 real rounds in April 2026 and reproduced every wheel position from the revealed server seed and the public drand beacon, with our own position code rebuilt from a written specification. All 19 scored steps pass, with no flags. The wheel and paytable return 100% by construction, and every captured win was credited the full multiplier.

Results at a glance

Audit Verdict

CheckResultEvidence
Overall StatusPassPROVABLY FAIR — Full Pass · 19 of 19 scored steps pass · 0 flags · 0 hard fails · Framework 1.1, release v1.2.1
RTP VerifiedPassProven RTP 100.0%: the wheel and paytable return 100% on every color tier (count × multiplier = 48), and all 473 captured wins were credited the full multiplier, a settlement edge of 0 · RTP claim rule: NOTED, Duel’s Zero Edge line is recorded, not tested · 100.007% simulated over 5M rounds
Live ↔︎ Verifier ParityPass100% — 1,350 / 1,350 wheel positions reproduced, 0 mismatches
Commit-Reveal SystemPass1,350 / 1,350 revealed seeds hash to their commitments; one fresh seed per round. Consistency checks: when each hash was first shown is not in the capture
drand BeaconPass1,350 / 1,350 beacon values equal drand.cloudflare.com’s for their rounds; every bet timestamped before its beacon on Duel’s clock (min 14.763 s); round IDs strictly increase
Client SeedN/ANo client seed: the unpredictable input is the public drand beacon, published after betting closes
RNG AnalysisPassOur position code, rebuilt from a written specification, reproduces every round; Duel’s own Verify-tab code, run unmodified as a second check, agrees on 1,350 / 1,350; plain uint32 % 48, bias 1.55 × 10⁻¹⁰ per position
Payout LogicPass0 payout errors on all 1,350 rounds; the served multiplier equals the table at the recomputed position on every round
Settlement EdgeInfo0 at the captured stakes ($0.01 and $1.00). Above Duel’s Zero Edge allowance, Duel’s settings and client code give a 0.1%–5% edge; no captured stake reached it, and server settlement there was not observed
Anti-CircularityPassTier probabilities counted from the uint32 % 48 mapping, with no casino-supplied probability: P × multiplier = 1 within 1.12 × 10⁻⁸ on all 6 tiers; a corrupted table is rejected on every tier
Fairness IntegrityPass15 standard fairness integrity tests — 14 pass, 1 N/A (player-action invariance — global outcome model) — results recorded in S5 matrix
DeterminismPassSame server seed and beacon, same position: 1,350 / 1,350, at $0.01 and $1.00 alike
Overall StatusPass
PROVABLY FAIR — Full Pass · 19 of 19 scored steps pass · 0 flags · 0 hard fails · Framework 1.1, release v1.2.1
RTP VerifiedPass
Proven RTP 100.0%: the wheel and paytable return 100% on every color tier (count × multiplier = 48), and all 473 captured wins were credited the full multiplier, a settlement edge of 0 · RTP claim rule: NOTED, Duel’s Zero Edge line is recorded, not tested · 100.007% simulated over 5M rounds
Live ↔︎ Verifier ParityPass
100% — 1,350 / 1,350 wheel positions reproduced, 0 mismatches
Commit-Reveal SystemPass
1,350 / 1,350 revealed seeds hash to their commitments; one fresh seed per round. Consistency checks: when each hash was first shown is not in the capture
drand BeaconPass
1,350 / 1,350 beacon values equal drand.cloudflare.com’s for their rounds; every bet timestamped before its beacon on Duel’s clock (min 14.763 s); round IDs strictly increase
Client SeedN/A
No client seed: the unpredictable input is the public drand beacon, published after betting closes
RNG AnalysisPass
Our position code, rebuilt from a written specification, reproduces every round; Duel’s own Verify-tab code, run unmodified as a second check, agrees on 1,350 / 1,350; plain uint32 % 48, bias 1.55 × 10⁻¹⁰ per position
Payout LogicPass
0 payout errors on all 1,350 rounds; the served multiplier equals the table at the recomputed position on every round
Settlement EdgeInfo
0 at the captured stakes ($0.01 and $1.00). Above Duel’s Zero Edge allowance, Duel’s settings and client code give a 0.1%–5% edge; no captured stake reached it, and server settlement there was not observed
Anti-CircularityPass
Tier probabilities counted from the uint32 % 48 mapping, with no casino-supplied probability: P × multiplier = 1 within 1.12 × 10⁻⁸ on all 6 tiers; a corrupted table is rejected on every tier
Fairness IntegrityPass
15 standard fairness integrity tests — 14 pass, 1 N/A (player-action invariance — global outcome model) — results recorded in S5 matrix
DeterminismPass
Same server seed and beacon, same position: 1,350 / 1,350, at $0.01 and $1.00 alike
Audit scope & reference

What Was Audited

✓ Audited

  • Wheel positions reproduce from the revealed server seed and the drand beacon: 1,350 / 1,350 live rounds
  • Every revealed server seed hashes to its commitment, with one fresh seed per round (a consistency check)
  • Every beacon value equals the public quicknet chain’s value for its round, and every publication time follows the chain formula
  • Every bet was timestamped before its beacon was published, on Duel’s own transactions-API clock
  • Our position code, rebuilt from a written specification, matches every live position; Duel’s own Verify-tab code agrees as a second check
  • Payouts, win flags and served multipliers are exact on every captured round, at both stakes
  • Baseline RTP from first principles on all 6 color tiers: count × multiplier = 48, 100.0% before any settlement edge
  • Every captured win was credited stake × table multiplier exactly: a settlement edge of 0 at $0.01 and $1.00
  • Bet size does not move the wheel: $1.00 rounds recompute exactly like $0.01 rounds
  • 5M simulated rounds and the casino-seed screen find no sign of positional bias or of seeds selected by outcome

What Audit Excludes

  • Settlement edge above Duel’s Zero Edge allowance (0.1%–5%) — explained from the config in S4.7
  • Stakes above $1.00 and more than one bet per round — not captured
  • Max win
  • Zero Edge ceilings and promotions — the $1,000 and $50,000 limits are Duel’s statement; no rakeback applies to this game
  • Cross-account sampling
  • Duel’s server code and seed generation — outcomes are verified from the captured rounds, their commitments and the public drand beacon
  • Infrastructure or server security
  • Wallet, payments, or operational systems outside game logic
What Audit Covers
2 columns
AreaDescription
Commit-Reveal SystemSHA-256 commitments of the hex-decoded server seed, one per round, revealed after the roll (consistency); commitment timing as a premise
drand BeaconQuicknet values matched against drand.cloudflare.com, publication times from the chain formula, bet-before-beacon margins on Duel’s clock, round ordering
RNG AnalysisSpec-built HMAC-SHA256 position code, draw-bias bound of the plain % 48, Duel’s Verify-tab code as a second check
Live ParityAll 1,350 rounds recomputed; the ProvablyFair.org verifier and Duel’s Verify-tab code run on the same rounds
Payout LogicWin condition from the recomputed tier, served multipliers against the table, credits at 18 dp, $1.00 vs $0.01
RTP ValidationBaseline RTP from position counts, the RTP claim rule (Duel’s Zero Edge line, noted), the settlement edge from the config, 5M-round simulation, casino-seed screen
Fairness IntegrityStandard integrity matrix — 15 tests across seed integrity, bet timing, determinism, isolation, payout and wheel-position distribution
What Audit Guarantees
  • Outcomes reproduce from the recorded inputs: 1,350 / 1,350 captured rounds, at $0.01 and $1.00
  • Every revealed server seed hashes to the commitment stored with its round
  • Every beacon value is the public quicknet chain’s value for its round
  • Every bet was timestamped before its beacon was published, by Duel’s clock
  • Our spec-built position code and Duel’s own Verify-tab code return the served position on every captured round
  • Payouts equal stake × the table multiplier on every captured round
  • Baseline RTP is 100% on every color tier, from the wheel and paytable alone, without casino-supplied probabilities; the draw bias moves it by at most 7.45 × 10⁻⁹
  • Every captured win was credited the full multiplier: a settlement edge of 0 at $0.01 and $1.00
  • All 15 standard fairness integrity tests addressed at audit time — 14 pass, 1 N/A (player actions cannot influence the wheel position — global outcome model) — no hard failures

References

Castle Roulette — Game Rules7 sections▶

Castle Roulette is a multiplayer wheel game with 48 positions and 6 color tiers. Each round, Duel broadcasts the hash of a fresh server seed, players bet on a color, and after betting closes a drand beacon and the server seed fix one wheel position (0–47) for everyone. If the position belongs to your color tier, you win stake × the tier’s multiplier. The tiers are sized so that count × multiplier = 48 in every case, so every color returns 100% in expectation before any settlement edge.

How to Play

1. Place your bet — Enter a stake and choose one of the 6 color tiers: Green (48×), Red (24×), Purple (16×), Blue (8×), Grey (4×) or Dark Blue (2×). Other players can bet on the same round.
2. Round opens — Duel broadcasts the round ID and the SHA-256 hash of the round’s server seed. Save the hash if you want to check the round later.
3. Betting closes — No more bets are accepted for this round.
4. drand beacon publishes — The server waits for a drand quicknet beacon published after betting closes. The server seed and the beacon value together fix the wheel position.
5. Wheel resolves — The position is computed and shown on the wheel. It belongs to exactly one color tier.
6. Outcome — If the position’s tier matches your bet, you win stake × multiplier. If not, you lose the stake.
7. Verify — After the round, take the revealed server seed and the beacon value (any drand relay serves it by round number) and recompute the position yourself.

The position is fixed by the server seed and the beacon value; the wheel animation is cosmetic. Every player in a round shares the same position, because every bet in the round resolves against the same server seed and beacon.
Win Conditions

A Castle Roulette bet wins if the resolved wheel position (0-47) belongs to the player's chosen color tier. The payout is stake × multiplier, where the multiplier is fixed per tier. There are no partial wins — the outcome is binary per bet.

3 columns
OutcomeConditionExample (stake $1, Dark Blue 2× bet)
WinPosition belongs to chosen color tierPosition = 27 (Dark Blue range 24-47) → payout = $1 × 2 = $2.00
LossPosition belongs to a different color tierPosition = 5 (Purple, not Dark Blue) → payout = $0 (stake lost)
Every round lands on exactly one of the 48 positions, in exactly one of the 6 color tiers, so every bet resolves to a win or a loss.
Risk vs Reward

Risk is set by the color you choose. Rarer colors win less often and pay larger multipliers, and the six tiers are sized to the same expected value.

  • Dark Blue (2×) wins half the time — 24 of 48 positions are Dark Blue, so P(win) = 50.00%: frequent small wins, the lowest variance.
  • Green (48×) wins about once in 48 spins — only position 0 is Green, so P(win) = 2.08%: rare large wins, the highest variance.
  • Expected value is the same on every tier — every color returns 1.000 per unit staked in expectation, a baseline RTP of 100% before any settlement edge.
  • Variance grows as the win chance falls — short runs on rare tiers can return far more or far less than 100% (see S4).
Parameters
3 columns
ParameterValueNotes
Wheel Positions48 (0–47)Fixed wheel, fixed position-to-color mapping
Color Tiers6Green, Red, Purple, Blue, Grey, Dark Blue
Multiplier Range2× to 48×Fixed per tier
Settlement Edge0 at the base tierInside Duel’s Zero Edge allowance; beyond it 0.1% to 5%, from Duel’s settings and client code (not tested)
Baseline RTP100.0000%From count × multiplier = 48 on every tier
RNG AlgorithmHMAC-SHA256Key: the hex-decoded server seed. Message: the beacon bytes read as UTF-8, plus ":0"
External Entropy Sourcedrand quicknet3-second period; chain 52db9ba7…4e971
Round StructureMultiplayer shared outcomeAll players in a round share one server seed and one beacon
Seed Formats

Every Castle Roulette round uses two inputs: a server seed committed by Duel and a beacon from the public drand chain. There is no player-contributed client seed; the beacon is the input Duel cannot set.

4 columns
Seed TypeFormatExample (round 538493)Purpose
Server Seed64-char hex (32 bytes)adace83dfe4957273…2420eb26Duel’s secret input, revealed after the round
Server Seed Hash64-char hex SHA-256ae7a5f98e2f47850…d18baaaaBroadcast when the round opens: Duel’s commitment to the seed
drand Round IDInteger28007049The quicknet beacon the round used, named after betting closes
drand Randomness96-char hex (BLS signature)8d59f6f2c17c6c3a…cd6621dPublic beacon value, served by any drand relay
The server seed is hex-decoded to 32 bytes for the HMAC key. The drand randomness is hex-decoded to 48 bytes, read as UTF-8 (each invalid byte run becomes U+FFFD) and re-encoded, with ":0" appended, to form the HMAC message. All 1,350 captured rounds reproduce from these encodings.
Multiplier Formula & Payout

Every wheel position maps to one of 6 color tiers, each with a fixed multiplier. The position comes from a single HMAC-SHA256, and the payout is stake × multiplier when the position’s color matches the bet.

u        = first 4 bytes of HMAC-SHA256(key = serverSeed bytes,
           message = UTF-8(drand bytes) + ":0"), big-endian
position = u % 48                          (0 to 47, no rejection)
color, multiplier = PAYOUT_TABLE[position] (6 tiers)

If color matches the player’s bet:   amount_won = stake × multiplier
Otherwise:                            amount_won = 0
7 columns
ColorPositionsCountMultiplierP(win)Payout / $1RTP
Green0148×2.08%$48.00100.0%
Red1-2224×4.17%$24.00100.0%
Purple3-5316×6.25%$16.00100.0%
Blue6-1168×12.50%$8.00100.0%
Grey12-23124×25.00%$4.00100.0%
Dark Blue24-47242×50.00%$2.00100.0%
Every tier returns 100% because count × multiplier = 48 on all six: P(color) × multiplier = 1.000 before any settlement edge. The plain % 48 reduction gives positions 0–15 one extra value each out of 2³², a bias of 1.55 × 10⁻¹⁰ per position and at most 7.45 × 10⁻⁹ on a tier’s expected return.
Multiplayer Model

Castle Roulette’s randomness is global to the round, not per player.

  • One server seed per round — a fresh seed, its hash broadcast when the round opens
  • One drand beacon per round — published after betting closes, on the chain’s fixed 3-second schedule
  • One wheel position per round — computed once and shared by every player in the round
  • Per-player outcomes — each player’s win or loss depends only on the color they backed
Why Provably Fair Matters▶

Traditional online casinos require players to trust that games are fair. Provably fair systems eliminate this trust requirement by allowing players to mathematically verify that outcomes were not manipulated. In a Provably Fair system:

  • The casino commits to its server seed before you bet: save the hash, and a seed revealed later either matches it or it does not.
  • A source of randomness the casino cannot set: the drand beacon, published by an independent network after betting closes.
  • Anyone can verify the outcome after the fact, from the revealed seed and the public beacon.
High-Level Overview7 sections▶
Checklist Reference

Based on the ProvablyFair.org Audit Execution Checklist, here are the tests covered under this audit document.

Commit-Reveal & Seeds

2 columns
CheckWhat it shows
SHA-256 of the revealed seed matches its commitmentThe revealed seed is the one behind that hash
One fresh seed per roundNo seed is reused: 1,350 distinct seeds and hashes
Commitment recorded before the beaconA premise: the capture kept no timed record of when each hash was shown

drand Beacon

2 columns
CheckWhat it shows
Beacon value equals the public chain’sThe external input is the published quicknet value
Publication time from the chain formulagenesis + (round − 1) × 3 s, recomputed for every round
Bet timestamped before the beaconOn Duel’s own clock, for every captured bet
Round IDs strictly increaseNo beacon reused or taken out of order

RNG & Parity

2 columns
CheckWhat it shows
Positions recompute from seed + beaconThe outcome is deterministic and verifiable
Our spec-built code and Duel’s code agree on every roundNo hidden inputs to the RNG
Draw bias boundedPlain % 48: 1.55 × 10⁻¹⁰ per position, at or under 2⁻³²

Payout & RTP

2 columns
CheckWhat it shows
Served multiplier equals the tablePayouts follow the published paytable
Credit = stake × multiplier at 18 dpA settlement edge of 0 at the captured stakes
P × multiplier = 1 on all 6 tiersBaseline RTP is 100% by construction, not observation

Integrity

2 columns
CheckWhat it shows
Bet size does not influence the outcome$1.00 and $0.01 bets follow the same formula
Casino-seed screen on 1,350 revealed seedsNo sign of seed selection by outcome
Live probes on the bet channelInvalid bets dropped, injected outcome fields ignored
High-Level Flow

To get an overview of how a single Castle Roulette round works, here is a high-level breakdown:

1. Round Opens — Duel broadcasts the round ID and the SHA-256 hash of a fresh server seed
2. Players Bet — Each player chooses a color and a stake while betting is open
3. Betting Closes — No more bets for this round
4. drand Publishes — The server waits for a quicknet beacon published after betting closes (a new beacon every 3 seconds)
5. Wheel Position Computed — HMAC-SHA256(serverSeed bytes, UTF-8(beacon bytes) + ":0") → first 4 bytes as uint32 → u % 48 → position 0–47
6. Roll & Reveal — The wheel shows the position, and the server seed is revealed with the drand round ID and the beacon value
7. Payout — Each player whose color matches the tier is paid stake × multiplier; other stakes are lost
8. Verify — Anyone can recompute the position from the revealed seed and the beacon

High-Level Flow — illustrated flow
Provably Fair Model

Castle Roulette combines three things: a server seed committed by its SHA-256 hash, a public randomness beacon (drand quicknet) whose value and publication time anyone can check, and HMAC-SHA256 as the deterministic function that combines them into a wheel position. Duel broadcasts the hash when the round opens, and the beacon is published after betting closes, so a seed fixed before its beacon cannot be fitted to it. Two trusts remain: that the seed was fixed before the beacon, which a hash saved before betting lets you check, and which later beacon a round uses, a rule Duel does not publish.

Commit-Reveal Model

The commit-reveal model for Castle Roulette has four phases, with the public beacon between the commitment and the reveal:

Commit-Reveal Model — illustrated flow

Commit phase:
When the round opens, Duel broadcasts the round ID and SHA-256(hex_decode(serverSeed)) of a fresh server seed. The seed stays secret. Bets are accepted.

drand phase:
Betting closes and the server waits for a drand quicknet beacon. The chain publishes a new beacon every 3 seconds, signed by an independent threshold network; neither Duel nor the player sets its value.

Compute phase:
The server combines the server seed and the beacon value with HMAC-SHA256 and reduces the first 4 bytes modulo 48 to the wheel position.

Reveal phase:
The server seed is revealed with the drand round ID and the beacon value. Anyone can check SHA-256(hex_decode(serverSeed)) against the hash they saved and recompute the position. The next round uses a fresh seed: there is no seed chain or epoch.

Why Castle Roulette Uses a Public Randomness Beacon

Castle Roulette has no per-player client seed. Its second input is a public randomness beacon, drand quicknet, which publishes a new value every 3 seconds, signed by a threshold of independent operators. Everyone, Duel included, sees the same value at the same time. For the player this works like a client seed:

  • Duel broadcasts the server seed’s hash when the round opens and the beacon arrives after betting closes; the capture kept no timed record of the broadcast, so that ordering is a premise (S1.2)
  • The beacon is a BLS threshold signature: no single party can produce or predict it
  • Any player can fetch the beacon for the round’s drand round ID from any relay and compare it with the value the round used
  • Every player in the round shares the same server seed and beacon: one outcome for the round, not one per player
Why There's No Nonce or Epoch Chain

Castle Roulette gives every round a brand-new server seed, so there is no nonce counter and no seed rotation. The reveal happens after each round.

  • Each round has exactly one server seed: no reuse, no chain, no cursor
  • The nonce is fixed at 0: every HMAC message ends in :0, because every seed is already unique
  • There is no epoch to rotate: the seed is revealed after its own round
  • The 1,350-round dataset holds 1,350 distinct server seeds and 1,350 distinct hashes (Step 4)
Why There's No Nonce or Epoch Chain
Round N:      serverSeed_N (fresh), drand beacon_N → wheelPosition_N              [seed revealed after the round] Round N+1:    serverSeed_(N+1) (new, unrelated), drand beacon_(N+1) → wheelPosition_(N+1)              [seed revealed after the round] ... Every round is a fresh commitment. There is no nonce counter: every HMACmessage ends with the fixed suffix ":0".
Determinism Guarantee

Given identical inputs, the output is always identical:

Determinism Guarantee
HMAC-SHA256(hex_decode(serverSeed), UTF-8(drand bytes) + ":0")  → Always same digestFirst 4 digest bytes as a big-endian uint32                      → Always same valuevalue % 48                                                       → Always same positionPAYOUT_TABLE[position]                                           → Always same color/multipliercolor matches the player’s bet                                   → Always same win/lossstake × multiplier                                               → Always same payout
Technical Glossary7 categories▶
Core Concepts
2 columns
TermDefinition
Provably FairA gambling model in which the inputs to every outcome are cryptographically committed before the outcome is known, and any player can independently verify the outcome after the fact without trusting the operator.
Commit-Reveal ProtocolA two-phase protocol: a party publishes a hash of a secret before play (commit), then reveals the secret afterward (reveal). A match shows the revealed secret is the one behind the hash; a copy of the hash saved in advance shows it was fixed before play. In Castle Roulette, Duel broadcasts each round’s hash when the round opens and reveals the seed after the roll.
External Entropy SourceA source of randomness outside the operator’s control that goes into every outcome. Castle Roulette uses the drand quicknet public randomness beacon.
DeterminismIdentical inputs always produce identical outputs. In Castle Roulette, a server seed and a beacon value produce exactly one wheel position (0–47).
Framework 1.1The ProvablyFair.org audit framework this report is certified under: scored steps with Pass, capture flag, operator flag or hard fail; the RTP claim rule; game-profile coverage; the S5 fairness-integrity matrix.
Capture flagA flag caused by our own capture, not by the operator, which Framework 1.1 discloses apart from operator findings. This audit has none.
Seed System
2 columns
TermDefinition
Server SeedA 64-character hex string (32 bytes) generated by the operator. Hex-decoded to raw bytes before use as the HMAC key. Each Castle Roulette round uses a unique server seed.
Server Seed HashThe SHA-256 hash of the hex-decoded server seed bytes. Broadcast by Duel when the round opens: the commitment to the seed.
drand Round IDAn integer identifying one beacon of the drand quicknet chain. The server names the beacon a round uses after betting closes; the beacon publishes on the chain’s fixed schedule.
drand RandomnessThe 96-character hex BLS signature the quicknet chain publishes for a round. Hex-decoded, read as UTF-8 and followed by :0, it forms the HMAC message.
Single-Use Seed ModelCastle Roulette’s seed model: every round gets a fresh server seed, with no reuse, no chain and no nonce counter. The nonce is fixed at 0, the :0 suffix of every HMAC message.
Cryptographic Functions
2 columns
TermDefinition
HMAC-SHA256Keyed hash function: the server seed bytes are the key, the beacon text plus :0 the message. The first 4 bytes of the 32-byte digest, read as a big-endian uint32, give the wheel position.
SHA-256Cryptographic hash function used for the commit-reveal proof. SHA-256(hex_decode(serverSeed)) = serverSeedHash is checked on every round.
BLS Threshold SignatureThe signature scheme of the drand quicknet chain. A beacon needs a threshold of independent signers, so no single party can produce or predict it.
Hex DecodingConverting a hex string to raw bytes. The server seed is hex-decoded for the HMAC key; the drand randomness is hex-decoded, read as UTF-8 and re-encoded for the HMAC message.
uint32 Modulo MappingHow the HMAC output becomes a wheel position: the first 4 digest bytes are read as an unsigned 32-bit integer u, and the position is u % 48, with no rejection. Positions 0–15 carry 89,478,486 of the 2³² values and positions 16–47 carry 89,478,485: a bias of 1.55 × 10⁻¹⁰ per position.
Rejection SamplingDiscarding values outside an evenly divisible range so every outcome is exactly equally likely. The published algorithm takes a plain % 48 instead, and no captured round reaches the values where the two differ, so the bias is bounded (S2).
Verification Terms
2 columns
TermDefinition
VerifierAn implementation of the RNG and payout rules that recomputes live outcomes from the captured inputs. It must give the live result on every round.
ParityThe property that the verifier's computed wheel position equals the live game's reported position for every round. 1,350 / 1,350 parity means zero mismatches across the entire dataset.
Anti-CircularityDeriving RTP without casino-supplied probabilities: the tier probabilities are counted from the uint32 % 48 mapping, and P × multiplier = 1 on all six tiers, with a negative control that rejects each multiplier + 1.
Direct Algebraic ProofCastle Roulette’s anti-circularity technique: every tier satisfies count × multiplier = 48, which gives a baseline RTP of 100.0000% by elementary arithmetic, before any settlement edge.
RTP Claim RuleRTP-CLAIM 1.2.0: every setting is held to the RTP the casino publishes for it, within ±0.1 pp. A zero-edge line such as Duel’s Zero Edge allowance is noted, not tested. A house-side miss is the verdict RTP FIGURE OVERSTATED (exit 5), never a fairness fail.
Base Stake TierBets inside Duel’s Zero Edge allowance, where Duel’s client code computes a settlement edge of 0: up to $1,000 of a bet within $50,000 of wagering per 24 hours, by Duel’s statement. The page’s RTP and payout guarantees cover this tier; the captured stakes, $0.01 and $1.00, sit inside it.
Casino-Seed Screen (Pass 2)A chi-squared test of the position distribution of every revealed casino seed paired with 1,000 synthetic beacon values. Many failures would point to seeds chosen by outcome.
Game Mechanics
2 columns
TermDefinition
Wheel PositionThe integer 0-47 produced by value % 48, where value is the first 4 bytes of the HMAC output as a uint32. Each position belongs to exactly one of the 6 color tiers.
Color TierA group of wheel positions that share a payout multiplier. The 6 tiers are: Green (position 0, 48×), Red (1-2, 24×), Purple (3-5, 16×), Blue (6-11, 8×), Grey (12-23, 4×), Dark Blue (24-47, 2×).
Baseline RTPThe wheel and paytable’s expected return before any settlement edge: 100% on every color tier, because count × multiplier = 48 for all six.
Shared RoundOne round’s server seed and beacon are shared by every player who bets into it, so every player sees the same position. The seed’s hash is broadcast when the round opens; the beacon is published after betting closes.
Multi-Stream Chi-SquaredThe S4 Pass 1 method: 10 independent 500K-round streams, each tested with chi-squared on the 48 positions, their p-values combined by Fisher’s method. A biased RNG drives the combined p-value down.
Settlement EdgeThe reduction of a win’s multiplier at settlement, by Duel’s disclosure: 0 inside the Zero Edge allowance; above it, the edge on the stake beyond the allowance, scaled by Duel’s bankroll, between a 0.1% floor and a 5% ceiling. Read from Duel’s settings and client code; not tested.
Zero EdgeDuel’s allowance that removes the settlement edge: up to $1,000 of a bet within $50,000 of wagering per 24 hours, as Duel states it. Noted, not tested.
Audit Terms
2 columns
TermDefinition
Fairness-Integrity MatrixThe 15 standard fairness integrity tests in S5, in six categories: seed integrity, bet timing, determinism, isolation, payout integrity and wheel-position distribution. Two are live probes on the bet channel; one is N/A for a shared-outcome game.
Game ProfileThe framework’s per-game check list (Castle Roulette profile 1.0.2, checks CASTLE-01 to CASTLE-30). Each check is covered by a scored step, a package check, or marked n/a with a reason.
Bet-Before-Beacon MarginThe beacon’s publication time minus Duel’s bet timestamp, in milliseconds. Positive on all 1,350 rounds; it times the bet, not the commitment.
Mutation BatteryDeliberate faults injected into a disposable copy of the package, each of which a named step must catch: 30 / 30 caught.
Data Formats
2 columns
FileContents
data/castle-roulette-master-1350rounds.jsonThe capture dataset: 1,350 rounds across Phases A–E, each with its bet, served result, revealed seed, beacon and timing. SHA-256 pinned in S1 and S7.
outputs/verification-results.jsonOutput of the 19-step verification suite: per-step status, detail, profile checks and informational items.
outputs/simulation-results.jsonPass 1 (10 streams × 500,000 rounds, per-position counts) and Pass 2 (1,350 casino seeds × 1,000 beacon values).
outputs/drand-api-verification.jsonEvery round’s beacon value compared with the one drand.cloudflare.com returned for its round.
outputs/rtp-claim-table.jsonThe six color tiers’ exact RTP against the claim, under the RTP claim rule.
01

Commit-Reveal & Beacon Timing

Can the casino change your outcome after you bet?

Every Castle Roulette round is generated from two inputs: a server seed and the public drand beacon. Duel broadcasts a SHA-256 hash of each round’s server seed when the round opens and reveals the seed after the roll. Every revealed seed in the capture hashes to its commitment, and every bet was timestamped before its beacon was published. Those are consistency checks: when each hash was first shown is not in the capture, and the bet times are Duel’s own. Save the hash yourself and the timing is yours to check.

Commit-Reveal Consistency

1,350 / 1,350seed reveals matched

What we verified

  • Every revealed server seed hashes to the commitment stored with its round: 1,350 / 1,350
  • One fresh server seed per round: 1,350 distinct seeds and 1,350 distinct hashes
  • Every bet was timestamped before its beacon was published, on Duel’s own clock (min 14.763 s)
  • Every beacon’s publication time follows the public quicknet chain formula
  • drand round IDs strictly increase across all 1,350 rounds
  • Same inputs, same wheel position: 1,350 / 1,350, at $0.01 and $1.00 alike

What this means for you

  • If you save the hash before you bet, a swapped seed cannot match it
  • The beacon comes from a public chain on a fixed schedule, outside Duel’s control
  • Every round has its own seed: nothing carries over from one round to the next
  • Any round can be rechecked from public inputs, months later
1,350 / 1,350seed reveals matched
  • Every revealed server seed hashes to the commitment stored with its round: 1,350 / 1,350
  • One fresh server seed per round: 1,350 distinct seeds and 1,350 distinct hashes
  • Every bet was timestamped before its beacon was published, on Duel’s own clock (min 14.763 s)
  • Every beacon’s publication time follows the public quicknet chain formula
  • drand round IDs strictly increase across all 1,350 rounds
  • Same inputs, same wheel position: 1,350 / 1,350, at $0.01 and $1.00 alike
Generation Pipeline — the server seed, committed by its hash, and the public drand beacon combine via HMAC-SHA256 to give the wheel position — illustrated flow
CheckResultEvidence
Seed hash integrityPass1,350 / 1,350 revealed seeds hash to their commitments (SHA-256 of the hex-decoded bytes); 0 mismatches
Server seed uniquenessPass1,350 distinct seeds and 1,350 distinct hashes: one fresh commitment per round
Commitment timingInfoReported, not scored: the capture kept each hash in the round’s result record with no receipt time, so a match shows consistency, not when the hash was shown
Bet before beaconPass1,350 / 1,350 bets timestamped before their beacon on Duel’s transactions-API clock: min 14.763 s, mean 20.067 s, max 20.405 s
Beacon publication timesPass1,350 / 1,350 equal genesis + (round − 1) × 3 s on the quicknet chain
drand round orderingPass1,349 / 1,349 transitions strictly increasing: no beacon round reused or out of order
Deterministic outputPassSame (server seed, beacon) → same position: 1,350 / 1,350; $1.00 rounds recompute like $0.01 rounds
Seed hash integrityPass
1,350 / 1,350 revealed seeds hash to their commitments (SHA-256 of the hex-decoded bytes); 0 mismatches
Server seed uniquenessPass
1,350 distinct seeds and 1,350 distinct hashes: one fresh commitment per round
Commitment timingInfo
Reported, not scored: the capture kept each hash in the round’s result record with no receipt time, so a match shows consistency, not when the hash was shown
Bet before beaconPass
1,350 / 1,350 bets timestamped before their beacon on Duel’s transactions-API clock: min 14.763 s, mean 20.067 s, max 20.405 s
Beacon publication timesPass
1,350 / 1,350 equal genesis + (round − 1) × 3 s on the quicknet chain
drand round orderingPass
1,349 / 1,349 transitions strictly increasing: no beacon round reused or out of order
Deterministic outputPass
Same (server seed, beacon) → same position: 1,350 / 1,350; $1.00 rounds recompute like $0.01 rounds
✓  Commit-reveal consistent

All 1,350 revealed seeds hash to their commitments, one fresh seed per round. Every bet was timestamped before its beacon was published, and every publication time follows the public chain formula. Identical inputs always give the same position.

How It Works — Commit-Reveal & Beacon Timing7 sections
1.1Server Seed Commitment

When a round opens, Duel broadcasts the round ID and the SHA-256 hash of a fresh server seed. The seed is a 64-character hex string, and the hash is taken over the 32 bytes it encodes: SHA-256(hex_decode(serverSeed)). After the roll the seed is revealed with the beacon, and anyone can check that it hashes to the commitment.

Server Seed Commitment — illustrated flow
src/rng.ts · verifyHash · Verified
export function verifyHash(serverSeed: string, serverSeedHash: string): boolean {  const computed = createHash('sha256').update(decodeHex(serverSeed)).digest('hex');  return computed === serverSeedHash.toLowerCase();}
Result: 1,350 / 1,350 revealed seeds hash to their commitments (Step 1). Zero mismatches.

Real Example from Live Data:

castle-roulette-master-1350rounds.json · round 538493
{  "roundId": 538493,  "result": {    "position": 27,    "serverSeed": "adace83dfe4957273152c5c52aea5e4fc112dabef87ff4baa350ca652420eb26",    "serverSeedHash": "ae7a5f98e2f4785022a58890db980cb71bb9f0c1bd02a44a1d69699ad18baaaa",    "drandRoundId": 28007049,    "drandRandomness": "8d59f6f2c17c6c3a77f65dfc4b5530bb607c8891d21a90cdff2628d69a461ca692b6ad3c041e1c7a8a9d87005cd6621d"  }}

Verification:

verify-seed.js · Verified
const crypto = require('crypto'); const serverSeed = "adace83dfe4957273152c5c52aea5e4fc112dabef87ff4baa350ca652420eb26"; const serverSeedHash = crypto  .createHash("sha256")  .update(Buffer.from(serverSeed, 'hex'))  .digest("hex"); console.log(serverSeedHash);// Output: ae7a5f98e2f4785022a58890db980cb71bb9f0c1bd02a44a1d69699ad18baaaa ✅
1.2Commitment Timing

A hash match shows that a revealed seed is the one behind its hash. On its own it does not show when the hash was shown: a seed and hash made after the round would match each other too. The capture kept each round’s hash in its result record, taken from the round’s broadcast messages or from Duel’s transactions API, with no receipt time. So “each seed was fixed before its beacon” is a premise of this audit, not a finding. A player who saves the hash before betting can check it for their own rounds: the saved copy is what times the commitment.

For players: Copy the round’s server seed hash before you bet, then compare the revealed seed with your copy (S6).
1.3Bet Before Beacon (Step 2)

For every round, Step 2 checks that the bet was accepted before the round’s beacon was published. The bet time is timestamp_raw from Duel’s transactions API, the operator’s own database timestamp for the bet. The publication time comes from the public chain formula, so anyone can recompute it. Step 2 recomputes every margin from the raw fields and requires the capture’s stored margin to equal it exactly. It times the bet, not the commitment.

Bet Before Beacon (Step 2) — illustrated flow
tests/steps/commitment.ts · Step 2 · Verified
for (const r of rounds) {  if (r.timing.source === EXPECTED_TIMING_SOURCE) serverTimestamped++;  else failures.push(`round ${r.roundId}: timing.source '${r.timing.source}' is not '${EXPECTED_TIMING_SOURCE}'`);   const cbd = r.timing.drandPublishedAt * 1000 - r.timing.betPlacedAt;  // …  if (r.timing.commitmentBeforeDrand !== cbd) {    precomputedDisagreements++;    // …  }   if (cbd > 0) {    positive++;    if (cbd < minMarginMs) minMarginMs = cbd;    if (cbd > maxMarginMs) maxMarginMs = cbd;    sumMs += cbd;  } else {    nonPositive++;    if (failures.length < 8) failures.push(`round ${r.roundId}: bet placed at or after drand publication`);  }}
Result: 1,350 / 1,350 margins positive, every one on a transactions-API timestamp. Minimum 14.763 s (round 540097), mean 20.067 s, maximum 20.405 s. All 1,350 stored margins equal the recomputation.

Real Example — round 538493 timing:

castle-roulette-master-1350rounds.json · round 538493 · timing
{  "drandPublishedAt": 1776824511,  "drandPublishedAtISO": "2026-04-22T02:21:51.000Z",  "commitmentBeforeDrand": 20379,  "betPlacedAt": 1776824490621,  "betPlacedAtISO": "2026-04-22 02:21:30",  "source": "transactions-api"}

Verification:

verify-timing.js · Verified
// betPlacedAt      — Duel’s transactions-API timestamp for the bet (operator clock)// drandPublishedAt — from the public quicknet chain formula://                    genesis + (drandRoundId - 1) × 3//                    genesis = 1692803367  (2023-08-23T15:09:27Z)//                    period  = 3 seconds const QUICKNET_GENESIS = 1692803367;const QUICKNET_PERIOD  = 3; const drandPublishedAt = QUICKNET_GENESIS + (28007049 - 1) * QUICKNET_PERIOD;// → 1776824511 (2026-04-22T02:21:51.000Z) ✅ const margin_ms = drandPublishedAt * 1000 - 1776824490621;// → 20379 ms: the bet was timestamped 20.379 s before the beacon ✅
1.4Beacon Publication Times (Step 12)

The quicknet chain publishes round n at 1692803367 + (n − 1) × 3 seconds (genesis 23 August 2023, 15:09:27 UTC; one beacon every 3 seconds). Step 12 recomputes the publication time of every round’s beacon from its drand round ID and compares it with the captured drandPublishedAt.

tests/steps/dataset.ts · Step 12 · Verified
for (const r of rounds) {  const expected = QUICKNET_GENESIS + (r.result.drandRoundId - 1) * QUICKNET_PERIOD;  if (r.timing.drandPublishedAt === expected) match++;  else mismatches.push(`round ${r.roundId}: drandPublishedAt ${r.timing.drandPublishedAt} != ${expected}`);}
Result: 1,350 / 1,350 publication times equal the chain formula.
1.5drand Round Ordering (Step 3)

Step 3 checks that drand round IDs strictly increase from one captured round to the next: no beacon round is reused or taken out of order. This is ordering only. It does not show which later beacon the server pairs with a round; that rule is not published.

tests/steps/commitment.ts · Step 3 · Verified
for (let i = 1; i < rounds.length; i++) {  compared++;  if (rounds[i].result.drandRoundId <= rounds[i - 1].result.drandRoundId) {    violations.push(`round ${rounds[i].roundId}: drand ${rounds[i].result.drandRoundId} does not exceed the previous ${rounds[i - 1].result.drandRoundId}`);  }}
Result: 0 violations in 1,349 transitions. drand rounds 28,007,049 → 28,035,974 across the capture.
1.6Server Seed Uniqueness & Single-Use Model (Step 4)

Castle Roulette has no seed epochs and no nonce counter. Every round gets a brand-new server seed, committed when the round opens and revealed after the roll, so no seed carries over to influence a later round. Step 4 counts distinct seeds and hashes against the population declared in the package.

tests/steps/commitment.ts · Step 4 · Verified
const seeds = new Set(rounds.map(r => r.result.serverSeed));const hashes = new Set(rounds.map(r => r.result.serverSeedHash));const issues: string[] = [];if (seeds.size !== rounds.length) issues.push(`${rounds.length - seeds.size} rounds reuse a server seed`);if (hashes.size !== rounds.length) issues.push(`${rounds.length - hashes.size} rounds reuse a commitment hash`);if (seeds.size !== EXPECTED_DISTINCT_SEEDS) issues.push(`distinct seeds ${seeds.size} != ${EXPECTED_DISTINCT_SEEDS}`);if (hashes.size !== EXPECTED_DISTINCT_SEEDS) issues.push(`distinct hashes ${hashes.size} != ${EXPECTED_DISTINCT_SEEDS}`);
Result: 1,350 distinct server seeds and 1,350 distinct hashes across 1,350 rounds. Zero reuse.
1.7Deterministic Mapping

The position is fully deterministic: the same server seed and beacon always give the same wheel position. The server seed is hex-decoded to 32 bytes for the HMAC key. The beacon is hex-decoded to 48 bytes, read as UTF-8 (each invalid byte run becomes U+FFFD) and re-encoded, and :0 is appended to form the message. The first 4 bytes of the HMAC-SHA256 digest, read as a big-endian uint32, give the position by u % 48, which looks up its color and multiplier in the 6-tier table.

Deterministic Mapping — illustrated flow
src/rng.ts · computePosition · Verified
export function computePosition(serverSeed: string, drandSeed: string): number {  const key = decodeHex(serverSeed);  if (key.length === 0) throw new Error('serverSeed decodes to zero bytes');  return computePositionFromBuffer(key, drandSeed);}
Result: All 1,350 rounds recompute to the served position (Step 5). The 100 Phase C rounds at $1.00 recompute exactly like the $0.01 rounds (Step 6).

Real Bet Verified:

castle-roulette-master-1350rounds.json · round 538493 · Verified
// Round 538493: Phase A, $0.01 on Dark Blue (2×){  "roundId": 538493,  "request": { "amount": "0.01", "coin": "two" },  "result": {    "position": 27,    "winningCoin": "two",    "serverSeed": "adace83dfe4957273152c5c52aea5e4fc112dabef87ff4baa350ca652420eb26",    "drandRoundId": 28007049,    "drandRandomness": "8d59f6f2c17c6c3a77f65dfc4b5530bb607c8891d21a90cdff2628d69a461ca692b6ad3c041e1c7a8a9d87005cd6621d",    "isWin": true,    "multiplier": "2.000000000000000000",    "amountWon": "0.020000000000000000"  }}

Verification:

verify-position.js · Verified
// computePosition("adace83d…", "8d59f6f2…")//// 1. key     = hex_decode(serverSeed)                 // 32 bytes// 2. text    = UTF-8 decode of hex_decode(drand)      // 48 bytes → 47 characters// 3. message = UTF-8(text) + ":0"                     // 49 characters// 4. digest  = HMAC-SHA256(key, message)//            → d6b318ab366262e3139f86c6d1f6695b548ee0e56c05128f5ba0b8ae1b71b3b1// 5. u       = first 4 bytes, big-endian              // 0xd6b318ab → 3,602,061,483// 6. position = u % 48                                // 3,602,061,483 % 48 = 27//// Output: position 27 → Dark Blue tier (positions 24–47, 2×) ✅// Payout: $0.01 × 2 = $0.02 ✅
Technical Evidence & Verification5 sections
1.8Evidence Coverage Summary7 checks
3 columns
Verification AreaCoverageResult
Seed hash integrity (Step 1)1,350 / 1,350 commitments opened and verifiedPass
Bet before drand beacon (Step 2)1,350 / 1,350 positive margins (min 14.763 s), on Duel’s clockPass
drand round ordering (Step 3)0 violations in 1,349 transitionsPass
Server seed uniqueness (Step 4)1,350 distinct seeds, 1,350 distinct hashesPass
Position recomputation (Step 5)1,350 / 1,350 wheel positionsPass
Bet-size invariance (Step 6)100 / 100 Phase C ($1.00) roundsPass
drand chain formula (Step 12)1,350 / 1,350 publication timesPass
1.9Code References9 source files
2 columns
FilePurpose
tests/verify.tsThe 19 scored steps (Steps 1–6 and 12 cover S1), informational items and the reproduction gate
tests/steps/commitment.tsSteps 1–4: seed hash, bet before beacon, drand round ordering, seed uniqueness
tests/steps/determinism.tsSteps 5–6: position recomputation, bet-size invariance
tests/steps/dataset.tsSteps 11–13: dataset hash, drand chain formula, anti-circularity
src/rng.tsHMAC-SHA256 position code and seed hash check (computePosition, verifyHash), rebuilt from docs/ALGORITHM.md
src/verify-drand-timing.jsnpm run timing: re-checks the chain formula and margins and re-fetches every beacon (network)
src/loader.tsDataset loader, SHA-256 guard and the declared population
capture/castle-roulette-capture.reference.jsReference record of the browser-session capture
capture/castle-roulette-enrich.reference.jsReference record of the enrichment from Duel’s transactions API
1.10Datasets UsedSource artifacts
Primary: data/castle-roulette-master-1350rounds.json
2 columns
PropertyValue
SourceLive Castle Roulette rounds on Duel.com, one test account
Total Records1,350 rounds (Phase A: 800, Phase B: 200, Phase C: 100, Phase D: 100, Phase E: 150)
drand Round Range28,007,049 → 28,035,974 (quicknet)
Capture Window2026-04-22T02:20:49.763Z → 2026-04-23T02:29:27.407Z
SHA-256506e05ee9c07966a721715cd7d7b369e72159601b6a6439542330b311ffd66ce

Fields used: roundId, phase, request.amount, request.coin, result.position, result.winningCoin, result.serverSeed, result.serverSeedHash, result.drandRoundId, result.drandRandomness, result.multiplier, result.amountCurrency, result.amountWon, result.isWin, timing.betPlacedAt, timing.drandPublishedAt, timing.commitmentBeforeDrand, timing.source. result.isWin and result.effectiveEdge are written by the capture script, not served.

1.11Verified Invariants8 invariants
2 columns
InvariantResult
SHA-256(hex_decode(serverSeed)) = serverSeedHash for all 1,350 revealed seedsPass
drandPublishedAt × 1000 − betPlacedAt > 0 for all 1,350 rounds, on a transactions-API timestampPass
Stored margin equals the recomputed margin on all 1,350 roundsPass
drandPublishedAt = genesis + (drandRoundId − 1) × 3 for all 1,350 roundsPass
drand round IDs strictly increasing across all 1,349 transitionsPass
1,350 distinct server seeds and 1,350 distinct hashes across 1,350 roundsPass
computePosition(serverSeed, drandRandomness) = position for all 1,350 roundsPass
Phase C ($1.00) rounds recompute like Phase A ($0.01): the bet amount is not an RNG inputPass
1.12Reproduction InstructionsRun locally

Clone the release, install, and run the audit:

reproduce-s1.sh · 6 lines · Verified
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1npm cinpm test# Steps 1–6 and 12 cover S1
S1 steps, as printed:

[PASS] Step 1 — Seed Hash Integrity
[PASS] Step 2 — Bet Before drand Beacon
[PASS] Step 3 — drand Round Monotonicity
[PASS] Step 4 — Server Seed Uniqueness
[PASS] Step 5 — Position Recomputation
[PASS] Step 6 — Bet-Size Invariance
[PASS] Step 12 — drand Chain Formula
02

RNG & Entropy Model

Is the randomness genuinely random, or could it be rigged?

Our position code, src/rng.ts, was rebuilt from a written specification (docs/ALGORITHM.md) by an implementer who never opened Duel’s code. It reproduces all 1,350 captured positions. Duel’s own Verify-tab code is run unmodified as a second check only, and agrees on all 1,350. The only inputs are the server seed and the drand beacon, and all 1,350 beacon values equal the public chain’s. The draw is a plain uint32 % 48, with a bias of 1.55 × 10⁻¹⁰ per position.

Cryptographic Randomness Verification

1,350 / 1,350beacon values matched

What we verified

  • Our position code, rebuilt from a written specification, reproduces all 1,350 live positions
  • Duel’s published Verify-tab code, run unmodified as a second check, agrees on 1,350 / 1,350
  • Only the server seed and the beacon go in: no timestamp, no client seed, no hidden state
  • All 1,350 beacon values equal the values drand.cloudflare.com returns for their rounds
  • The % 48 reduction is bounded: 1.55 × 10⁻¹⁰ per position, at or under 2⁻³²
  • 5M simulated rounds find no sign of positional bias (Fisher’s p = 0.7712) or serial dependence

What this means for you

  • Every captured wheel position follows the published algorithm; the tiny reduction bias is measured, not assumed away
  • The external input is the public beacon value, not a number Duel wrote down
  • No input beyond the server seed and the beacon goes into the position
  • Each round has a fresh seed and its own beacon: past results say nothing about the next one
  • You can check every input yourself against the public drand chain
1,350 / 1,350beacon values matched
  • Our position code, rebuilt from a written specification, reproduces all 1,350 live positions
  • Duel’s published Verify-tab code, run unmodified as a second check, agrees on 1,350 / 1,350
  • Only the server seed and the beacon go in: no timestamp, no client seed, no hidden state
  • All 1,350 beacon values equal the values drand.cloudflare.com returns for their rounds
  • The % 48 reduction is bounded: 1.55 × 10⁻¹⁰ per position, at or under 2⁻³²
  • 5M simulated rounds find no sign of positional bias (Fisher’s p = 0.7712) or serial dependence
RNG Pipeline — server seed bytes (key) + beacon text + ":0" (message) → HMAC-SHA256 → first 4 bytes → uint32 → u % 48 → wheel position → PAYOUT_TABLE → color tier — illustrated flow
CheckResultEvidence
Position code rebuilt from the specPasssrc/rng.ts, written from docs/ALGORITHM.md without Duel’s code, reproduces 1,350 / 1,350 positions; the spec’s own vectors and properties pass (119 / 119)
Duel verify code (second check)PassDuel’s Verify-tab code, run unmodified with only its inputs filled in, returns the served position on 1,350 / 1,350
Disclosed inputs onlyPassHMAC-SHA256(key = server seed bytes, message = UTF-8(beacon bytes) + ":0"): every round recomputes from these two inputs alone
Beacon valuesPass1,350 / 1,350 equal drand.cloudflare.com’s value for the same round (quicknet), by exact string comparison
Draw biasPassPlain uint32 % 48, no rejection: 1.552 × 10⁻¹⁰ per position, at or under the 2⁻³² ceiling of 2.328 × 10⁻¹⁰; largest tier effect 7.45 × 10⁻⁹
Simulation uniformityPass5M rounds (10 streams × 500K), every stream replayed: Fisher’s T = 15.09, p = 0.7712; 0 / 10 streams below α = 0.01
Serial independencePasslag-1 z = −2.384 (|z| < 3), runs p = 0.4312 on the replayed 5M-round sequence
Position code rebuilt from the specPass
src/rng.ts, written from docs/ALGORITHM.md without Duel’s code, reproduces 1,350 / 1,350 positions; the spec’s own vectors and properties pass (119 / 119)
Duel verify code (second check)Pass
Duel’s Verify-tab code, run unmodified with only its inputs filled in, returns the served position on 1,350 / 1,350
Disclosed inputs onlyPass
HMAC-SHA256(key = server seed bytes, message = UTF-8(beacon bytes) + ":0"): every round recomputes from these two inputs alone
Beacon valuesPass
1,350 / 1,350 equal drand.cloudflare.com’s value for the same round (quicknet), by exact string comparison
Draw biasPass
Plain uint32 % 48, no rejection: 1.552 × 10⁻¹⁰ per position, at or under the 2⁻³² ceiling of 2.328 × 10⁻¹⁰; largest tier effect 7.45 × 10⁻⁹
Simulation uniformityPass
5M rounds (10 streams × 500K), every stream replayed: Fisher’s T = 15.09, p = 0.7712; 0 / 10 streams below α = 0.01
Serial independencePass
lag-1 z = −2.384 (|z| < 3), runs p = 0.4312 on the replayed 5M-round sequence
✓  Reproducible, with the draw bias bounded

Our spec-built position code reproduces every captured round, and Duel’s own code agrees on all 1,350. Every beacon value is the public chain’s. The % 48 bias is bounded at 1.55 × 10⁻¹⁰ per position, and 5M simulated rounds find no sign of positional bias or serial dependence.

How It Works — RNG & Entropy Model9 sections
2.1RNG Function Implementation

Each round produces one wheel position from one HMAC-SHA256. The 32 hex-decoded server seed bytes are the key. The 48 beacon bytes are read as UTF-8, with each invalid byte run replaced by U+FFFD, re-encoded, and :0 appended: that is the message. The first 4 digest bytes, read as an unsigned big-endian 32-bit integer, are reduced by u % 48 to a position in [0, 47], which looks up its color and multiplier in the 6-tier table. No shuffle, no loop: one HMAC, one integer, one modulo, one lookup.

2 columns
ComponentDetail
Hash functionHMAC-SHA256
Keyhex_decode(serverSeed): 32 bytes
MessageThe beacon bytes read as UTF-8 (lossy, deterministic), re-encoded, then :0
ExtractionFirst 4 digest bytes as an unsigned big-endian 32-bit integer u
Mappingu % 48 → wheel position 0–47, no rejection
LookupPAYOUT_TABLE[position] → { multiplier, color } from the 6-tier table
OutputOne wheel position per round, shared by every player
src/rng.ts · buildMessage, positionFromDigest, computePositionFromBuffer · Verified
function buildMessage(drandBytes: Buffer): Buffer {  const text = new TextDecoder('utf-8').decode(drandBytes);  return Buffer.concat([Buffer.from(text, 'utf8'), Buffer.from(':0', 'ascii')]);}// …export function positionFromDigest(hmacHex: string): number {  if (!/^[0-9a-fA-F]+$/.test(hmacHex) || hmacHex.length < DRAW_HEX_CHARS) {    throw new Error('digest must be hex with at least 8 characters');  }  const u = parseInt(hmacHex.slice(0, DRAW_HEX_CHARS), 16);  return u % RANGE;}// …export function computePositionFromBuffer(keyBuffer: Buffer, drandSeed: string): number {  const drandBytes = decodeHex(drandSeed); // §2.1  // §5.2: with no whole byte in the input the Verify page shows no result.  if (drandBytes.length === 0) throw new Error('drandSeed decodes to zero bytes');  const message = buildMessage(drandBytes); // §2.2  const digest = createHmac('sha256', keyBuffer).update(message).digest('hex'); // §2.3  return positionFromDigest(digest);}
Result: All 1,350 live positions reproduced, zero mismatches (Step 5).
2.2Code Origin & Second Check

src/rng.ts was rebuilt from docs/ALGORITHM.md, a written specification drawn from Duel’s public pages, black-box readings of Duel’s public Verify page, the standard provably fair construction, the drand beacon and the 1,350 live rounds, without Duel’s code. Each step there names its source. Duel’s own Castle Roulette Verify-tab code, saved verbatim from duel.com on 26 September 2026 and pinned by SHA-256, is run on every captured round as a second check, not used as the source. The specification left open whether a first uint32 in the top 16 values of 2³² is reduced by plain % 48 or rejected, because no captured round reaches one. Its probe vector has first uint32 4,294,967,284: plain % 48 gives position 4, a rejection draw 41. Duel’s published code returns 4, and so does src/rng.ts.

Result: Our code, the ProvablyFair.org site verifier and Duel’s Verify-tab code each return the served position on 1,350 / 1,350 rounds.
2.3Entropy Sources

All randomness comes from HMAC-SHA256 over two cleanly separated inputs. There is no player-contributed entropy: the external input is the drand quicknet beacon, a value published by an independent threshold network.

Entropy Sources — illustrated flow
3 columns
SourceControlled ByPurpose
Server SeedCasinoBase randomness, committed by its SHA-256 hash when the round opens
drand RandomnessPublic drand quicknet chainExternal input: a BLS threshold signature (chain 52db9ba7…4e971)
Nonce SuffixSystem (fixed)Always :0: each server seed is used once, so no counter is needed
No mixed entropy sources detected. Identical inputs always give the identical position: 1,350 / 1,350.

How we know: all 1,350 live rounds recompute from these two inputs alone. Any hidden input would break the recomputation; none did.

Absent from the formula: timestamps, Math.random(), other external APIs or any further input. Only HMAC-SHA256(hex_decode(serverSeed), UTF-8(beacon bytes) + ":0"). The server still chooses the seed, and which later beacon a round uses is not published (S1.5).

The beacon values themselves are checked in 2.4.

2.4drand Beacon Values (Step 16)

2.3 shows that only the server seed and the beacon go into the RNG. This asks whether the beacon values are real: a recorded 48-byte string could in principle be anything. For every round, npm run timing fetched the beacon for its drand round ID from drand.cloudflare.com and compared the signature with the captured value. Step 16 recounts the pinned results row by row and binds each row to its dataset round.

drand Beacon Values (Step 16) — illustrated flow
src/verify-drand-timing.js · beacon fetch · Verified
const DRAND_API_BASE   = `https://drand.cloudflare.com/${DRAND_CHAIN_HASH}/public`;// …const api = await fetchDrandRound(r.result.drandRoundId);const sigMatch = api.signature === r.result.drandRandomness;
Result: 1,350 / 1,350 beacon values equal drand.cloudflare.com’s signature for the same round. The external input is the public chain’s.

What a match shows. Every captured value is the value the public quicknet chain serves for that round, not one Duel made up. A fabricated value would fail here.

Coverage. All 1,350 rounds, not a spot check. The comparison is exact string equality with the API’s signature.

Reproducibility. The results are pinned in outputs/drand-api-verification.json, which every npm test re-reads. npm run timing re-fetches every signature (network needed).

2.5Modulo Bias Analysis

The HMAC output’s first 4 bytes are taken as a uniform uint32 over [0, 2³² − 1], and position = u % 48. 2³² is not a multiple of 48: 2³² = 48 × 89,478,485 + 16, so positions 0–15 each receive one extra value. No rejection sampling is applied. The bias per position is 1.552 × 10⁻¹⁰, at or under the 2⁻³² ceiling of 2.328 × 10⁻¹⁰ that Step 5 enforces. Carried into the payout identity, it moves a tier’s expected return by at most 7.45 × 10⁻⁹.

Mapping:
  uint32 value u ∈ [0, 2³² − 1]
  position = u % 48                ∈ [0, 47]

Modulo bias:
  2³² = 4,294,967,296 = 48 × 89,478,485 + 16
  Positions 0–15 each carry 89,478,486 values of 2³²
  Positions 16–47 each carry 89,478,485 values of 2³²

  Fair probability:          1 / 48         = 0.0208333333…
  Positions 0–15:            89,478,486 / 2³² = 0.0208333335…
  Positions 16–47:           89,478,485 / 2³² = 0.0208333333…
  Bias per position:         1.552 × 10⁻¹⁰
  Ceiling (2⁻³²):            2.328 × 10⁻¹⁰

Expected return per tier (Step 13):
  Green (1 position × 48×):      1.0000000075
  Red (2 positions × 24×):       1.0000000075
  Purple (3 positions × 16×):    1.0000000075
  Blue (6 positions × 8×):       1.0000000075
  Grey (12 positions × 4×):      1.0000000000
  Dark Blue (24 positions × 2×): 0.9999999963
Result: Bias 1.552 × 10⁻¹⁰ per position, at or under 2⁻³². Largest per-tier effect 7.45 × 10⁻⁹ (Step 5, Step 13).

Green, Red, Purple and Blue sit wholly inside positions 0–15 and gain 7.45 × 10⁻⁹; Grey straddles the boundary and is exact; Dark Blue sits in 16–47 and loses 3.73 × 10⁻⁹. No sample size reached in play could detect this. A rejection draw would remove it entirely; the published algorithm does not use one, so the bias is measured and disclosed instead. The full anti-circularity proof is in S4 (Step 13).

2.6RNG Isolation

Each round uses a fresh server seed and its own beacon. The HMAC is a single stateless computation: no state shared between rounds, no cursor, no buffer. The :0 suffix is a constant, not a counter. Because every seed is used once, no input pair repeats.

RNG Isolation — illustrated flow
Result: No state carries between rounds. All 1,350 seeds are distinct (Step 4) and drand round IDs strictly increase (Step 3).

Evidence: computePositionFromBuffer in 2.1 is a pure function of its two arguments: no module state, no external call, no memory between rounds. The position takes no per-player input, so every player in a round shares it by design.

2.7Monte Carlo Simulation (5M Rounds)

A 5,000,000-round simulation checks the position distribution at scale, through the same HMAC-SHA256 and % 48. It runs 10 independent 500,000-round streams from seeds pinned in src/sim-seeds.ts, tests each stream’s 48 positions with chi-squared, and combines the 10 p-values with Fisher’s method. Every npm test replays all 10 streams, the full 5,000,000-position sequence, and recomputes every statistic from it.

2 columns
MetricValue
Total rounds5,000,000 (10 streams × 500,000)
Fisher’s combined statisticT = 15.0912 (df = 20)
Fisher’s combined p-value0.7712
Streams below α = 0.010 / 10
Lag-1 autocorrelation (z)−2.384
Wald-Wolfowitz runs test (p)0.4312
Simulated RTP, $1 on the 2× tier100.0070%
Baseline RTP100.0000%
3 columns
Streamchi²p-value
058.3910.1232
136.7060.8601
235.5260.8899
358.8620.1149
435.8370.8825
552.2260.2781
643.5460.6164
743.9980.5976
842.2120.6708
938.5810.8042
3 columns
StreamBaseline RTPSimulated RTP (500K rounds, 2× bet)
0100.0000%99.9624%
1100.0000%99.9156%
2100.0000%100.1916%
3100.0000%100.1888%
4100.0000%99.8312%
5100.0000%99.9300%
6100.0000%100.1028%
7100.0000%99.9356%
8100.0000%100.0604%
9100.0000%99.9516%
All 10 streams100.0000%100.0070%
src/sim-seeds.ts · Pass 1 constants and draw · Verified
export const PASS1_STREAMS      = 10;export const PASS1_ROUNDS_EACH  = 500_000;export const PASS1_ROUNDS_TOTAL = PASS1_STREAMS * PASS1_ROUNDS_EACH; // 5,000,000export const PASS2_NONCES       = 1_000;// …export function pass1Position(s: number, i: number): number {  const serverSeed = deterministicSeed(i, `server-stream-${s}`);  const drandSeed = deterministicSeed(i, `drand-stream-${s}`) + deterministicSeed(i, `drand2-stream-${s}`).slice(0, 32);  return computePositionFromBuffer(Buffer.from(serverSeed, 'hex'), drandSeed);}
Result: 5M rounds in 10 independent streams. Fisher’s combined p = 0.7712, mid-range, as a fair RNG gives. 0 streams below α = 0.01. Each stream’s RTP on the 2× tier is within ±0.2% of 100%, and all 10 together give 100.0070%. The position distribution is consistent with the % 48 model.

Fisher’s combined test turns K independent p-values into T = −2 Σ ln(p_i), χ² with 2K degrees of freedom under a fair RNG. A biased RNG drives p-values down across streams and T up. Here T = 15.09 on 20 degrees of freedom, p = 0.7712.

2.8Serial Independence

Serial independence means one round’s position says nothing about the next. Two tests run on the replayed 5M-round sequence:

Lag-1 autocorrelation (z): Correlation between consecutive positions; z = r × √n. |z| ≥ 3 would point to structure. Observed: z = −2.384.

Wald-Wolfowitz runs test (p): Whether positions in the upper half (24–47) and the lower half come in the expected number of runs. p < 0.01 would point to structure. Observed: p = 0.4312.

src/stats.ts · lag1Autocorrelation · Verified
export function lag1Autocorrelation(values: number[]): number {  const n = values.length;  if (n < 3) return 0;   const mean = values.reduce((s, v) => s + v, 0) / n;  let num = 0;  let den = 0;  for (let i = 0; i < n; i++) {    den += (values[i] - mean) ** 2;    if (i < n - 1) num += (values[i] - mean) * (values[i + 1] - mean);  }  return den === 0 ? 0 : num / den;}
Result: Both tests pass the rule |z| < 3 and runs p ≥ 0.01: z = −2.384, runs p = 0.4312. Consecutive positions show no dependence.
2.9Worked Example — Full RNG Trace

A real bet from the dataset: round 540514, the last Phase C round, $1.00 on Dark Blue (2×). It runs through the same path as the $0.01 round traced in S1. Values from data/castle-roulette-master-1350rounds.json:

serverSeed      = 8fc3079d13a9dd48451dda45fd164406c72e85e55ef40ed3b448bdac870d1735
drandRoundId    = 28027584
drandRandomness = 973a07744778398e8be015e73d88e0ca7e4da16cb032a3c7fa463d93fc6469fb
                  b61c2d027c9f10566abb7292cae288b4   (96 hex characters, 48 bytes)

Step 1 — Key:
  key = hex_decode(serverSeed)                        (32 bytes)

Step 2 — Beacon text (lossy UTF-8):
  text = UTF-8 decode of hex_decode(drandRandomness)  (48 bytes → 46 characters)

Step 3 — Message with the fixed :0 suffix:
  message = UTF-8(text) + ":0"                        (48 characters)

Step 4 — HMAC-SHA256:
  digest = 63b2f5e60540f441fd2a2c17fe25002c10492c28c49c948ef845a18eea010ccf

Step 5 — First 4 bytes as a big-endian uint32:
  u = 0x63b2f5e6 = 1,672,672,742

Step 6 — Modulo 48:
  position = 1,672,672,742 % 48 = 38

Step 7 — Tier from PAYOUT_TABLE[38]:
  Position 38 ∈ [24, 47] → Dark Blue, 2×
3 columns
StepProcessOutput
1Decode serverSeed from hexkey (32 bytes)
2Decode drandRandomness from hex, read as UTF-8text (46 characters)
3Append :0message (48 characters)
4HMAC-SHA256(key, message)63b2f5e60540f441…ea010ccf
5First 4 bytes, big-endian1,672,672,742 (uint32)
6u % 4838 (wheel position)
7PAYOUT_TABLE[38]Dark Blue (2×)
Parity verified: Round 540514 recomputes to position 38. The bet was on Dark Blue (coin: "two"), and 38 is in Dark Blue’s range [24, 47], so it wins 1 × 2 = 2.00, the amountWon in the dataset. The $1.00 stake follows the same path as the $0.01 round in S1; only the inputs differ.
Live Gameposition = 38 → Dark Blue (2×)
Verifierposition = 38 → Dark Blue (2×)
Technical Evidence & Verification5 sections
2.10Evidence Coverage Summary7 checks
3 columns
Verification AreaCoverageResult
Position recomputation (Step 5)1,350 / 1,350 live positions; draw bias at or under 2⁻³²Pass
Second checks (Step 5)ProvablyFair.org site verifier and Duel’s Verify-tab code: 1,350 / 1,350 eachPass
Specification tests (unit tests)The spec’s own vectors and properties: 119 / 119Pass
drand beacon values (Step 16)1,350 / 1,350 equal drand.cloudflare.com’sPass
Simulation Pass 1 (Step 14)Fisher’s p = 0.7712, 0 / 10 streams below α = 0.01, all 10 streams replayedPass
Serial independence (Step 14)lag-1 z = −2.384, runs p = 0.4312Pass
Live-sample fit (Step 19, informational)Positions χ² = 36.52, df 47, p = 0.865; every tier’s win rate fits the binomialPass
2.11Code References9 source files
2 columns
FilePurpose
docs/ALGORITHM.mdThe written specification src/rng.ts is rebuilt from
src/rng.tsHMAC-SHA256 position code, position → color table, multiplier table
src/bias.tsThe draw-bias bound, computed over src/rng.ts’s own draw function
src/site-verifier.ts, src/operator-verifier.tsPin and run the ProvablyFair.org site verifier and Duel’s Verify-tab code (second checks)
src/simulate.ts, src/sim-seeds.tsThe two-pass simulation and its pinned seeds
src/stats.tsChi-squared, lag-1 autocorrelation, runs test
src/verify-drand-timing.jsBeacon re-fetch from drand.cloudflare.com (npm run timing)
tests/steps/determinism.ts, tests/steps/simulation.tsSteps 5–6 and 14–16
tests/castle-roulette/RngSpecTests.tsThe specification’s own tests, run against src/rng.ts
2.12Verified Invariants11 invariants
2 columns
InvariantResult
Recomputed position equals the live position for all 1,350 roundsPass
The key is the hex-decoded seed bytes, not the hex textPass
The message is the beacon bytes read as UTF-8, re-encoded, plus :0Pass
The :0 suffix is a constant, not a counterPass
Per-position bias of the % 48 reduction at or under 2⁻³² (1.552 × 10⁻¹⁰)Pass
No inputs beyond the server seed and the beaconPass
All 1,350 beacon values equal drand.cloudflare.com’sPass
Fisher’s combined p ≥ 0.01 (observed 0.7712) on 10 × 500K streamsPass
0 / 10 streams below α = 0.01Pass
|lag-1 z| < 3 (observed −2.384) and runs p ≥ 0.01 (observed 0.4312)Pass
Every stream’s counts regenerate from src/sim-seeds.tsPass
2.13Datasets UsedSource artifacts
Simulation: outputs/simulation-results.json — 5M rounds across 10 streams, and the casino-seed screen
Primary dataset: data/castle-roulette-master-1350rounds.json — 1,350 live rounds for position recomputation
Simulation output: outputs/simulation-results.json — Pass 1 (10 streams × 500,000 rounds, per-position counts, Fisher’s combination, serial tests) and Pass 2 (1,350 casino seeds × 1,000 beacon values)
drand evidence: outputs/drand-api-verification.json — the 1,350 beacon comparisons against drand.cloudflare.com, written by npm run timing and re-read by Step 16 on every run
2.14Reproduction InstructionsRun locally

Clone the release, install, and run the audit:

reproduce-s2.sh · 6 lines · Verified
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1npm cinpm test# Steps 5, 14, 15, 16 and 19 cover S2
S2 steps, as printed:

[PASS] Step 5 — Position Recomputation
[PASS] Step 14 — Simulation Pass 1 (Fisher's Combined — 10 Streams)
[PASS] Step 15 — Simulation Pass 2 (Casino Seeds)
[PASS] Step 16 — drand API Signature Verification
[PASS] Step 19 — Live-Sample Fit (informational, CASTLE-22)
03

Verifier Parity

Does the live game actually follow its own rules?

Every captured round is recomputed: all 1,350, wins and losses, from the revealed server seed and the beacon. Each position, winning tier, multiplier and payout matches the live game. The ProvablyFair.org verifier players use on this site is pinned by hash and run on every captured round, and so is Duel’s own published verify code.

Live ↔︎ Verifier Parity

1,350 / 1,350rounds matched

What we verified

  • Every round recomputed from the server seed and the beacon: the wheel position, not just the payout
  • Payouts are exact: stake × multiplier on wins, 0 on losses, on all 1,350 rounds
  • Win flags are right: a round counts as a win exactly when the landed tier matches the bet, 1,350 / 1,350
  • The served multiplier equals the table’s at the recomputed position on every round
  • The bet amount is not an input: $1.00 rounds recompute exactly like $0.01 rounds
  • The ProvablyFair.org verifier and Duel’s own code return the same positions

What this means for you

  • The verifier is not a simulation: it gives the exact position the live game gave
  • Any round you play can be recomputed from the revealed seed and the public beacon
  • No hidden logic changed a captured payout, at either stake or on any color
  • The game in production follows the published algorithm on every captured round
1,350 / 1,350rounds matched
  • Every round recomputed from the server seed and the beacon: the wheel position, not just the payout
  • Payouts are exact: stake × multiplier on wins, 0 on losses, on all 1,350 rounds
  • Win flags are right: a round counts as a win exactly when the landed tier matches the bet, 1,350 / 1,350
  • The served multiplier equals the table’s at the recomputed position on every round
  • The bet amount is not an input: $1.00 rounds recompute exactly like $0.01 rounds
  • The ProvablyFair.org verifier and Duel’s own code return the same positions
Parity Verification Flow — (serverSeed, drandRandomness) → recompute → compare → exact match — illustrated flow
1,350Live Rounds Tested
100%Parity Rate
$0.01 & $1Bet Sizes Tested
0Mismatches
CheckResultEvidence
Wheel-position recomputationPass1,350 / 1,350 exact, from the server seed and the beacon alone (Step 5)
Payout correctnessPassAll 1,350 rounds: stake × multiplier on wins, 0 on losses, exact on the 2-decimal money grid (Step 7)
Win conditionPass1,350 / 1,350 capture-recorded win flags agree with the landed tier (Step 7)
Color-position mappingPassThe recomputed position maps to the served winning tier, and the served multiplier equals the table exactly (Step 8)
Bet-size invariancePass100 / 100 Phase C ($1.00) rounds recompute exactly; the bet amount is not an RNG input (Step 6)
ProvablyFair.org verifier parityPassThe site verifier, pinned by SHA-256, returns the served position, color and multiplier on 1,350 / 1,350 (Step 5)
Duel verify code (second check)PassDuel’s Verify-tab code, run unmodified, returns the served position on 1,350 / 1,350 (Step 5)
Phase coveragePassPhases A 800, B 200, C 100, D 100, E 150, as declared in the package (Step 10)
Wheel-position recomputationPass
1,350 / 1,350 exact, from the server seed and the beacon alone (Step 5)
Payout correctnessPass
All 1,350 rounds: stake × multiplier on wins, 0 on losses, exact on the 2-decimal money grid (Step 7)
Win conditionPass
1,350 / 1,350 capture-recorded win flags agree with the landed tier (Step 7)
Color-position mappingPass
The recomputed position maps to the served winning tier, and the served multiplier equals the table exactly (Step 8)
Bet-size invariancePass
100 / 100 Phase C ($1.00) rounds recompute exactly; the bet amount is not an RNG input (Step 6)
ProvablyFair.org verifier parityPass
The site verifier, pinned by SHA-256, returns the served position, color and multiplier on 1,350 / 1,350 (Step 5)
Duel verify code (second check)Pass
Duel’s Verify-tab code, run unmodified, returns the served position on 1,350 / 1,350 (Step 5)
Phase coveragePass
Phases A 800, B 200, C 100, D 100, E 150, as declared in the package (Step 10)
✓  Live game and verifiers aligned

All 1,350 captured rounds recompute to the served position. Payouts and win flags are exact on every round, and every served multiplier is the table’s. The ProvablyFair.org verifier and Duel’s own verify code return the same positions.

How It Works — Verifier Parity8 sections
3.1Why Parity Matters

If a verifier gave a different result from the live game, players could not rely on it: a single discrepancy would mean a bug in the verifier, a change in the live game, or an RNG that is not what it claims. Parity means a player can take the revealed server seed and the beacon value, run them through an independent verifier, and get the exact wheel position and payout the live round gave.

Why Parity Matters — illustrated flow
3.2Five-Phase Collection Design

The capture ran in five phases, each for a specific property: baseline coverage, every tier, bet size, and payout coverage on two rare tiers, Purple (16×) and Green (48×).

5 columns
PhaseRoundsColor BetStakePurpose
A — Baseline800Dark Blue (2×)$0.01Statistical coverage on the most common tier
B — Multi-tier200All 6 colors (rotating)$0.01Every tier’s payout: 34 on Dark Blue (2×), 34 on Grey (4×), 33 each on Blue (8×), Purple (16×), Red (24×) and Green (48×)
C — Bet size100Dark Blue (2×)$1.00The position does not depend on the stake (100× Phase A’s)
D — Rare tier100Purple (16×)$0.01Coverage of the 3-position tier
E — Rare tier150Green (48×)$0.01Coverage of the 1-position tier (P(win) ≈ 2.08%)
Total: 1,350 rounds, one server seed each. $112.50 wagered: $8.00 Phase A, $2.00 Phase B, $100.00 Phase C, $1.00 Phase D, $1.50 Phase E. drand rounds 28,007,049 → 28,035,974, captured 22–23 April 2026.
3.3Wheel-Position Recomputation (Step 5)

For every round, Step 5 recomputes the position with computePosition(serverSeed, drandRandomness) and compares it with the served position. The count is bound to the population the package declares, so a shortened dataset fails too.

Wheel-Position Recomputation (Step 5) — illustrated flow
tests/steps/determinism.ts · Step 5 · Verified
for (const r of rounds) {  const computed = computePosition(r.result.serverSeed, r.result.drandRandomness);  if (computed === r.result.position) {    match++;  } else {    mismatch++;    if (mismatches.length < 5) {      mismatches.push(`round ${r.roundId}: expected pos=${r.result.position}, got ${computed}`);    }  }}
Result: 1,350 / 1,350 rounds verified. Zero mismatches: no encoding drift, no off-by-one, no modulo discrepancy.
3.4Player Verifiers & Duel’s Code

Step 5 runs two more implementations on every captured round. The ProvablyFair.org verifier on this site (derive.js with its HMAC library) is vendored in the package and pinned by SHA-256; Step 5 fails unless the copies hash to their pins, then executes it. Duel’s own Verify-tab code is run unmodified with only its two input values filled in.

3 columns
ImplementationSourceRounds matched
src/rng.tsRebuilt from docs/ALGORITHM.md1,350 / 1,350
ProvablyFair.org site verifierderive.js 44f821b5…, hmac-sha256.js bc30bfe9… (pinned)1,350 / 1,350
Duel’s Verify-tab codeSaved from duel.com on 26 September 2026, c83dca21… (pinned)1,350 / 1,350
tests/steps/determinism.ts · Step 5, site verifier · Verified
for (const r of rounds) {  const site = sv.deriveCastle({ serverSeed: r.result.serverSeed, drandRandomness: r.result.drandRandomness });  const pkg = computePosition(r.result.serverSeed, r.result.drandRandomness);  siteCompared++;  const ok = site.position === pkg && site.multiplier === getResult(pkg).multiplier && site.color === getResult(pkg).color    && site.multiplier === coinToMult[r.result.winningCoin];  // …}
Scope: The verifier at www.provablyfair.org/verify-bets is a separate build and was not checked. Duel’s live Verify page was read black-box only: crafted inputs and one captured round, 538493, which it shows as roll 27.
3.5Payout Math & Win Condition (Step 7)

A bet wins when the landed position’s tier is the color bet; a win credits stake × multiplier, a loss 0. Step 7 checks every settlement on the 2-decimal money grid in whole units, so a credit off by a fraction of a cent fails. The win flag in the dataset is written by the capture script, so it is checked for consistency with the landed tier.

Payout Math & Win Condition (Step 7) — illustrated flow
2 columns
ObservationValue
Rounds checked1,350
Win flags agreeing with the landed tier1,350
Overall win rate (informational)473 / 1,350 (35.04%)
Phase A win rate (Dark Blue 2×, P(win) = 50.00%)394 / 800 (49.25%)
Phase C win rate (Dark Blue 2×, P(win) = 50.00%)41 / 100 (41.00%)
Phase D win rate (Purple 16×, P(win) = 6.25%)5 / 100 (5.00%)
Phase E win rate (Green 48×, P(win) = 2.08%)4 / 150 (2.67%)
tests/steps/payouts.ts · Step 7 · Verified
for (const r of rounds) {  // …  if (r.result.isWin) {    // Win: amountWon should = bet × multiplier, the full baseline payout. Step 9 holds    // the same credit to the table multiplier exactly at 18 dp on every recomputed win.    // Compared on the money grid: the credit must be a legal 2-dp amount AND the same    // number of grid units as the expected payout.    const expected = amount * multiplier;    if (onGridM(won) && unitsM(won) === unitsM(expected)) {      correct++;    } else if (!onGridM(won)) {      // …    } else {      wrong++;      // …    }  } else {    // Loss: amountWon = 0 — held to the same grid, so a 1e-9 credit on a loss is not    // "zero" either.    if (onGridM(won) && unitsM(won) === 0) {      correct++;    } else {      wrong++;      // …    }  }} // isWin is capture-recorded (the capture script compares winningCoin with the coin bet); consistency onlylet isWinCorrect = 0;for (const r of rounds) {  const posResult = getResult(r.result.position);  // …  // Map coin keys to color names  const coinToColor: Record<string, string> = {    two: 'dark_blue', four: 'grey', eight: 'blue',    sixteen: 'purple', twenty_four: 'red', forty_eight: 'green',  };  const betColor = coinToColor[r.request.coin];  const actuallyWins = posResult.color === betColor;  if (r.result.isWin === actuallyWins) isWinCorrect++;}
Result: All 1,350 payouts exact; every win flag agrees with the landed tier. Per-phase win rates are within normal variance (S4, informational items).
3.6Color-Position Mapping (Step 8)

Step 8 takes the position from the recomputation, not from the served record, and requires on every round: the served position to equal it, the served winning tier to be the table’s tier there, and the served 18-decimal multiplier to equal the table’s multiplier exactly, parsed as an exact decimal.

tests/steps/payouts.ts · Step 8 · Verified
const exactDecimalEquals = (s: string, m: number): boolean => {  const mm = /^(\d+)(?:\.(\d+))?$/.exec(String(s));  if (!mm) return false;  const frac = mm[2] ?? '';  return BigInt(mm[1] + frac) === BigInt(m) * 10n ** BigInt(frac.length);}; for (const r of rounds) {  const pos = computePosition(r.result.serverSeed, r.result.drandRandomness);  const expected = getResult(pos);  const ok = pos === r.result.position    && coinToMult[r.result.winningCoin] === expected.multiplier    && exactDecimalEquals(r.result.multiplier, expected.multiplier);  if (ok) match++;  // …}
Result: 1,350 / 1,350 rounds map to the served tier, with the table’s exact multiplier.
3.7Phase C — Bet-Size Invariance (Step 6)

The bet amount is not part of the HMAC key or message. Phase C placed 100 bets at $1.00, 100× the Phase A stake, and Step 6 recomputes each from the server seed and the beacon alone. If the stake moved the wheel, a recomputation with no stake input would miss.

tests/steps/determinism.ts · Step 6 · Verified
for (const r of phaseC) {  const computed = computePosition(r.result.serverSeed, r.result.drandRandomness);  if (computed === r.result.position) match++;  else mismatch++;}
Result: Phase C: 100 / 100 positions recompute at $1.00, through the same code path as the $0.01 rounds of Phases A, B, D and E.
Variance context: Phase C returned 82.00%: 41 wins × $2.00 = $82.00 on $100.00 staked, against 50 wins expected (exact binomial, two-sided p = 0.089). At 100 bets the return is consistent with variance and is not a measure of RTP; the baseline RTP is derived in S4.
3.8Worked Example — Full Parity Verification

A real bet from Phase E: round 541180, $0.01 on Green (48×), the rarest tier. It shows exact parity at the far end of the payout table. Values from data/castle-roulette-master-1350rounds.json:

roundId          = 541180
serverSeed       = 651a40d387346919ee59de3ac9858c3a8b20aa1d5dc78ecfd54d5a869bd5cfb5
serverSeedHash   = 8930e42cbf5db531bf28177327324bea49f6711e8c19d7b0bcb61040a1d651a6
drandRoundId     = 28034244
drandRandomness  = 91f15725497c704c9f61ed8a7f5937067c7928022ba670f0b8fa5f7c23a15836
                   49fd470a748e1413864038285f4c1332   (96 hex characters, 48 bytes)
stake            = $0.01
bet              = forty_eight (Green, 48×)
3 columns
StepProcessOutput
1computePosition(serverSeed, drandRandomness)0 (wheel position)
2PAYOUT_TABLE[0]{ multiplier: 48, color: "green" }
3Landed tier against the betgreen === green → win
4stake × multiplier0.01 × 48 = 0.48 (amount won)
5Compare with the live roundAll four match
Recomputation and payout · Verified
// Step 1: position from (serverSeed, drandRandomness)////   HMAC-SHA256 digest:  07129a702e6f6237d190061776e058804613bf2be5c5bad2647bb221c8dec392//   First 4 bytes:       07129a70//   uint32 value:        118,659,696//   position = 118,659,696 % 48//            = 0  ✅  (matches dataset) // Step 2: tier from PAYOUT_TABLE[0]//   Position 0 → Green, 48× // Step 3: win condition//   bet = forty_eight → Green//   Green === Green → win  ✅ // Step 4: payout//   amount_won = 0.01 × 48//              = 0.48  ✅  (matches dataset)
Parity verified: Round 541180: position, tier, win flag and payout all match between the live game and the verifier. The rarest tier (P = 1/48 ≈ 2.08%) pays the full 48×: 0.01 × 48 = 0.48. The same code path produced the 2× rounds in S1 and S2; only the inputs differ.
Live Gameposition = 0 · color = green · win · amount_won = $0.48
Verifierposition = 0 · color = green · win · amount_won = $0.48
Technical Evidence & Verification5 sections
3.9Evidence Coverage Summary7 checks
3 columns
Verification AreaCoverageResult
Wheel-position recomputation (Step 5)1,350 / 1,350 rounds, from the server seed and the beaconPass
Player verifier and Duel’s code (Step 5)1,350 / 1,350 eachPass
Payout math and win flags (Step 7)1,350 / 1,350 on the 2-decimal money gridPass
Color-position mapping (Step 8)1,350 / 1,350, exact multipliersPass
Phase C bet-size invariance (Step 6)100 / 100 $1.00 roundsPass
Phase coverage (Step 10)A 800 + B 200 + C 100 + D 100 + E 150 = 1,350Pass
Configuration coverage (Step 17)All 6 tiers above 30 rounds; 48 / 48 positions landedPass
3.10Code References6 source files
2 columns
FilePurpose
tests/steps/determinism.tsSteps 5–6: position recomputation with both second checks, Phase C bet-size invariance
tests/steps/payouts.tsSteps 7–10: payout math and win flags, color-position mapping, settlement edge, phase coverage
tests/steps/coverage.tsStep 17: tier and position coverage
src/rng.tscomputePosition, getResult, the 6-tier PAYOUT_TABLE
verifier-parity/Pinned copies of the ProvablyFair.org site verifier and the runner for Duel’s code
src/loader.tsDataset loading and the declared population
3.11Datasets UsedSource artifacts
Primary dataset: data/castle-roulette-master-1350rounds.json — 1,350 live rounds in 5 phases (A: 800, B: 200, C: 100, D: 100, E: 150)
Verification output: outputs/verification-results.json — Steps 5–8, 10 and 17 (S3)
Payout table: src/rng.ts — PAYOUT_TABLE, the 6-tier color and multiplier for all 48 positions
3.12Verified Invariants10 invariants
2 columns
InvariantResult
Recomputed wheel position equals the live position for all 1,350 roundsPass
Win flag equals (landed tier = bet tier) for all 1,350 roundsPass
amount_won = stake × multiplier on every winning round, in whole centsPass
amount_won = 0 on every losing roundPass
Served multiplier equals the table’s at the recomputed position, exactlyPass
Phase C ($1.00) recomputes through the same code path as $0.01 roundsPass
No inputs beyond the server seed and the beacon: the bet amount is not an RNG inputPass
All 5 capture phases present (A: 800, B: 200, C: 100, D: 100, E: 150)Pass
All 6 color tiers bet, each above the 30-round floorPass
All 48 positions landed on in live playPass
3.13Reproduction InstructionsRun locally
reproduce-s3.sh · 6 lines · Verified
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1npm cinpm test# Steps 5–8, 10 and 17 cover S3
S3 steps, as printed:

[PASS] Step 5 — Position Recomputation
[PASS] Step 6 — Bet-Size Invariance
[PASS] Step 7 — Payout Math
[PASS] Step 8 — Color-Position Mapping
[PASS] Step 10 — Phase Coverage
[PASS] Step 17 — Configuration Coverage (coin tiers and wheel positions)
04

RTP & Payout Logic

Is the return what the casino claims?

Theoretical RTP is 100.0% at the base stake tier. We derive it from first principles: every color tier has count × multiplier = 48, so the wheel and paytable return 100% on each tier, with no casino-supplied probability; the % 48 draw moves that by at most 7.45 × 10⁻⁹. Every captured win was credited the full multiplier, a settlement edge of 0 inside Duel’s Zero Edge allowance. The RTP claim rule records Duel’s Zero Edge line as noted, not tested. Above the allowance, Duel’s settings and client code give a 0.1%–5% edge, explained here from the config. A 5M-round simulation is consistent with the proof, and the casino-seed screen finds no sign that seeds were selected by outcome.

Return to Player Verification

100.0%theoretical RTP · base tier

What we verified

  • Theoretical RTP is 100% on all 6 color tiers: count × multiplier = 48, from first principles; the draw bias moves it by at most 7.45 × 10⁻⁹
  • Every captured win was credited stake × the table multiplier: a settlement edge of 0 at $0.01 and $1.00 (473 / 473)
  • RTP claim rule: NOTED. Duel’s Zero Edge line is recorded, not tested; the six tiers’ true range is 100.000000–100.000001%
  • 5M simulated rounds: 100.007% on the 2× tier, consistent with 100%
  • The casino-seed screen on all 1,350 revealed seeds finds no sign of seeds selected by outcome
  • Bet size does not move the wheel: $1.00 and $0.01 rounds recompute alike

What this means for you

  • Inside Duel’s Zero Edge allowance, the wheel returns 100% of wagering in expectation
  • Duel states the allowance covers up to $1,000 of a bet, within $50,000 of wagering per 24 hours
  • Beyond it, Duel’s settings and client code give an edge between 0.1% and 5%; that range was not tested
  • The RTP proof does not rely on trusting the casino
  • Your bet size does not move the wheel
100.0%theoretical RTP · base tier
  • Theoretical RTP is 100% on all 6 color tiers: count × multiplier = 48, from first principles; the draw bias moves it by at most 7.45 × 10⁻⁹
  • Every captured win was credited stake × the table multiplier: a settlement edge of 0 at $0.01 and $1.00 (473 / 473)
  • RTP claim rule: NOTED. Duel’s Zero Edge line is recorded, not tested; the six tiers’ true range is 100.000000–100.000001%
  • 5M simulated rounds: 100.007% on the 2× tier, consistent with 100%
  • The casino-seed screen on all 1,350 revealed seeds finds no sign of seeds selected by outcome
  • Bet size does not move the wheel: $1.00 and $0.01 rounds recompute alike
INDEPENDENT DERIVATION
count(tier) × multiplier(tier) / 48= 1.000
48-position wheel · All 6 color tiers · Base stake tier

With the % 48 draw counted exactly, every tier is within 7.45 × 10⁻⁹ of 1. Above Duel’s Zero Edge allowance, Duel’s settings and client code give a 0.1%–5% settlement edge, outside this proof.

100.0%Theoretical RTP at the base stake tier
100.007%Simulated (5M rounds)
0%Settlement edge on captured wins
100.0% on all 6Tiers proven from first principles
CheckResultEvidence
Anti-circularityPassTier probabilities counted from the uint32 % 48 mapping: P × multiplier = 1 within 1.12 × 10⁻⁸ on all 6 tiers; a corrupted table (multiplier + 1) is rejected on every tier
RTP claim (RTP-CLAIM 1.2.0)InfoClaim kind noted: Duel’s Zero Edge line is recorded, not tested. The 6 tiers are tabled at their exact RTP, 100.000000–100.000001%; the outcome is NOTED and moves no step
Settlement edge at the captured stakesPass473 / 473 wins credited stake × table multiplier exactly at 18 decimals (Step 9): 432 at $0.01, 41 at $1.00
Settlement edge above the allowanceInfoFrom Duel’s settings and client code: the stake above the allowance × (multiplier − 1) / bankroll, between a 0.1% floor and a 5% ceiling. Explained from the config, not tested (4.7)
Multipliers and payoutsPassEvery served multiplier equals the table’s at the recomputed position, and every payout is stake × multiplier (Steps 7, 8)
Simulated RTP (Pass 1)Pass5M rounds: 100.007% on the 2× tier; every tier within one standard error of 100%; Fisher’s p = 0.7712
Casino-seed screen (Pass 2)Pass1,350 revealed seeds × 1,000 beacon values: 15 χ² failures against a threshold of 25
Bet-size invariancePass100 / 100 Phase C ($1.00) rounds recompute; credits exact at both stakes
Anti-circularityPass
Tier probabilities counted from the uint32 % 48 mapping: P × multiplier = 1 within 1.12 × 10⁻⁸ on all 6 tiers; a corrupted table (multiplier + 1) is rejected on every tier
RTP claim (RTP-CLAIM 1.2.0)Info
Claim kind noted: Duel’s Zero Edge line is recorded, not tested. The 6 tiers are tabled at their exact RTP, 100.000000–100.000001%; the outcome is NOTED and moves no step
Settlement edge at the captured stakesPass
473 / 473 wins credited stake × table multiplier exactly at 18 decimals (Step 9): 432 at $0.01, 41 at $1.00
Settlement edge above the allowanceInfo
From Duel’s settings and client code: the stake above the allowance × (multiplier − 1) / bankroll, between a 0.1% floor and a 5% ceiling. Explained from the config, not tested (4.7)
Multipliers and payoutsPass
Every served multiplier equals the table’s at the recomputed position, and every payout is stake × multiplier (Steps 7, 8)
Simulated RTP (Pass 1)Pass
5M rounds: 100.007% on the 2× tier; every tier within one standard error of 100%; Fisher’s p = 0.7712
Casino-seed screen (Pass 2)Pass
1,350 revealed seeds × 1,000 beacon values: 15 χ² failures against a threshold of 25
Bet-size invariancePass
100 / 100 Phase C ($1.00) rounds recompute; credits exact at both stakes
✓  RTP holds at the base stake tier

The theoretical RTP is 100% on every color tier, derived from first principles and within 7.45 × 10⁻⁹ with the draw counted exactly. Every captured win was credited the full multiplier, a settlement edge of 0 inside Duel’s Zero Edge allowance. The simulation is consistent with it, and the casino-seed screen finds no sign of seeds selected by outcome.

How It Works — RTP & Payout Logic10 sections
4.1Anti-Circularity Proof (Step 13)

The anti-circularity proof derives the RTP from first principles, without any casino-supplied probability and without measured outcomes. For Castle Roulette it is short: every color tier satisfies count(tier) × multiplier(tier) = 48, so P(color) × multiplier = 1 and the expected return of every bet is 1 by construction. Step 13 counts each position’s probability from the % 48 mapping itself: positions 0–15 carry 89,478,486 of the 2³² draw values, positions 16–47 carry 89,478,485.

Anti-Circularity Proof (Step 13) — illustrated flow
3 columns
ComponentFormulaSource
Position probabilityP(p) = 89,478,486 / 2³² for p < 16, else 89,478,485 / 2³²Counted from the u % 48 mapping: pure arithmetic, no casino data
Tier probabilityP(tier) = Σ P(p) over the tier’s positionsThe 6-tier table in src/rng.ts, rebuilt from the written specification
Payout on a winstake × multiplier(tier)Verified on every captured round (Steps 7–9)
RTPP(tier) × multiplier(tier)Independent probability × verified payout
Result= 1 within 1.12 × 10⁻⁸ on all 6 tiersA first-principles proof, not a statistical estimate
6 columns
Color TierPositionsMultipliercount × multiplierP(color)Exact RTP
Green048×1 × 48 = 482.0833%100.000001%
Red1–224×2 × 24 = 484.1667%100.000001%
Purple3–516×3 × 16 = 486.2500%100.000001%
Blue6–118×6 × 8 = 4812.5000%100.000001%
Grey12–234×12 × 4 = 4825.0000%100.000000%
Dark Blue24–472×24 × 2 = 4850.0000%100.000000%
Result: All 6 color tiers return 100% by the count × multiplier = 48 identity. With the % 48 draw counted exactly, the largest departure from 1 is Green’s +7.45 × 10⁻⁹, inside the 1.12 × 10⁻⁸ bound; the 48 probabilities sum to 1; a table with any multiplier raised by one is rejected on every tier. The proof is non-circular.

Anti-Circularity Verification:

tests/steps/dataset.ts · Step 13 · Verified
const total = 2 ** 32;const base = Math.floor(total / RANGE);     // 89478485const remainder = total % RANGE;            // 16 const tiers = [  { name: 'Green (48×)',     positions: 1,  mult: 48, start: 0 },  { name: 'Red (24×)',       positions: 2,  mult: 24, start: 1 },  { name: 'Purple (16×)',    positions: 3,  mult: 16, start: 3 },  { name: 'Blue (8×)',       positions: 6,  mult: 8,  start: 6 },  { name: 'Grey (4×)',       positions: 12, mult: 4,  start: 12 },  { name: 'Dark Blue (2×)',  positions: 24, mult: 2,  start: 24 },]; // …const EV_BOUND = RANGE / 2 ** 32;   // the uint32 claim, stated independently of `total`// …for (const tier of tiers) {  // Compute exact probability for this tier's positions  let tierProb = 0;  for (let p = tier.start; p < tier.start + tier.positions; p++) {    tierProb += (p < remainder ? base + 1 : base) / total;  }  const ev = tierProb * tier.mult;  probByTier[tier.name] = tierProb;  evByTier[tier.name] = ev;  const dev = Math.abs(ev - 1.0);  if (dev > maxEvDeviation) maxEvDeviation = dev;   // EV should be very close to 1.000 — the baseline the paytable enforces  if (dev > EV_BOUND) failures.push(`${tier.name}: P × multiplier departs from 1.0 beyond the ${EV_BOUND.toExponential(4)} bound (deviation ${dev.toExponential(4)})`);}// …let negativeControlAccepted = 0;for (const tier of tiers) {  let tierProb = 0;  for (let p = tier.start; p < tier.start + tier.positions; p++) tierProb += (p < remainder ? base + 1 : base) / total;  if (Math.abs(tierProb * (tier.mult + 1) - 1.0) <= EV_BOUND) negativeControlAccepted++;}if (negativeControlAccepted > 0) failures.push(`negative control: a corrupted table (multiplier + 1) was accepted on ${negativeControlAccepted} tier(s)`);

Why this proof is non-circular: the probabilities come from counting draw values per position, a property of the u % 48 mapping, not from casino data or observed outcomes. The multipliers come from the 6-tier table, and that table is checked against what Duel served on every captured round: the served multiplier equals the table’s at the recomputed position (Step 8), and every win is credited stake × that multiplier (Steps 7, 9).

4.2RTP Claim Rule (RTP-CLAIM 1.2.0)

The claim and where it is published. The only return figure Duel publishes for Castle Roulette is the “Zero Edge” label on the game screen. Its ceilings, up to $1,000 of a bet within $50,000 of wagering per 24 hours, come from Duel’s own statement and are not in the game settings. Under the rule, a zero-edge line is noted, not tested: the six tiers are still tabled at their exact RTP, but none is held to a figure.

How it is scored. A noted claim is recorded with outcome NOTED and status Info, so it moves no step and no verdict, and a house-side miss (RTP FIGURE OVERSTATED, exit 5) cannot arise. What Duel’s game settings do state is the edge beyond the allowance, a 0.1% floor and a 5% ceiling, set out in 4.7. No captured stake reached it.

4 columns
Color TierExact RTP (rational)RTPOutcome
Green (48×)134,217,729 / 134,217,728100.000001%Noted
Red (24×)134,217,729 / 134,217,728100.000001%Noted
Purple (16×)134,217,729 / 134,217,728100.000001%Noted
Blue (8×)134,217,729 / 134,217,728100.000001%Noted
Grey (4×)1 / 1100.000000%Noted
Dark Blue (2×)268,435,455 / 268,435,456100.000000%Noted
src/rtp-claim-switch.ts + src/rtp-settings.ts · Verified
export const RTP_CLAIM_RULE_ENFORCED: boolean = true; export function computeRtpClaim(): RtpClaimResult {  const domain = 1n << BigInt(4 * DRAW_HEX_CHARS);     // 2^32  const R = BigInt(RANGE);  const base = domain / R, extra = domain % R;  const tiers = new Map<string, { mult: number; count: bigint }>();  PAYOUT_TABLE.forEach((cell, p) => {    const t = tiers.get(cell.color) ?? { mult: cell.multiplier, count: 0n };    if (t.mult !== cell.multiplier) throw new Error(`tier ${cell.color} carries two multipliers`);    t.count += base + (BigInt(p) < extra ? 1n : 0n);    tiers.set(cell.color, t);  });  if (PAYOUT_TABLE.length !== RANGE) throw new Error('payout table does not cover the wheel');  const acc = new RtpClaimAccumulator(RTP_CLAIM);  for (const [color, t] of tiers) acc.add(`tier=${color} (${t.mult}x)`, t.count * BigInt(t.mult), domain);  return acc.result();}
Result: NOTED. True minimum 100.000000% (Dark Blue 2×), true maximum 100.000001% (Green 48×), 0 rows unstated. The tier figures are the game engine’s, before any settlement edge; the edge above the allowance is not modelled in the table. Full table: outputs/rtp-claim-table.json, pinned by SHA-256.
4.3Settlement Edge at the Captured Stakes (Step 9)

By Duel’s disclosure, its edge is applied at settlement, by reducing the multiplier, not inside the wheel draw. Step 9 derives the settlement edge from served data. A round is a win when the recomputed tier is the coin bet, and on each of the 473 winning rounds the credit Duel’s transactions API served must equal the served stake × the table multiplier exactly, at 18 decimals. A multiplier reduced by any amount at settlement fails here. The dataset’s effectiveEdge field is written by the capture script, so it is not scored.

tests/steps/payouts.ts · Step 9 · Verified
for (const r of rounds) {  const tier = getResult(computePosition(r.result.serverSeed, r.result.drandRandomness));  if (COIN_TO_COLOR[r.request.coin] !== tier.color) continue;  wins++;  const stakeKey = String(r.result.amountCurrency).replace(/^-/, '');  winsByServedStake[stakeKey] = (winsByServedStake[stakeKey] ?? 0) + 1;  const stake = units18(r.result.amountCurrency);  const won = units18(r.result.amountWon);  if (stake !== null && won !== null && stake < 0n && won === -stake * BigInt(tier.multiplier)) exact++;  else if (offList.length < MAX_LISTED) offList.push(`round ${r.roundId}: credited ${r.result.amountWon} on stake ${r.result.amountCurrency} at ${tier.multiplier}x`);}
Result: 473 / 473 wins credited the full multiplier: 432 at $0.01 and 41 at $1.00. A settlement edge of 0 at both captured stakes, inside Duel’s Zero Edge allowance.
Variance note: Castle Roulette is high-variance on the rare tiers: Green pays 48× at a 2.08% win chance. Observed returns on small samples move a long way from 100%; the proof in 4.1 is the RTP evidence.
4.4Full RTP Table — All 6 Color Tiers

Castle Roulette’s RTP is one closed-form value per tier. The table shows each tier’s theoretical RTP beside its RTP on the 5M simulated rounds of Pass 1, computed from the per-position counts the simulation artifact ships.

6 columns
Color TierMultiplierP(win)Theoretical RTPSimulated RTP (5M rounds)Deviation
Green48×2.0833%100.0000%99.9283%−0.0717%
Red24×4.1667%100.0000%100.1050%+0.1050%
Purple16×6.2500%100.0000%100.0048%+0.0048%
Blue8×12.5000%100.0000%99.9555%−0.0445%
Grey4×25.0000%100.0000%99.9955%−0.0045%
Dark Blue2×50.0000%100.0000%100.0070%+0.0070%
Result: Every tier’s simulated RTP is within one standard error of 100%. The spread widens with rarity: the standard error is 0.04% on Dark Blue and 0.31% on Green. All six are consistent with the 100% baseline.
Variance note: The six figures slice the same 5M rounds: each round lands on one position, which pays on exactly one tier. The test of each position’s rate is the chi-squared test in Step 14 (4.5).
4.5Simulation Pass 1 — Fresh Seeds (Step 14)

4.1 proves the RTP. Pass 1 checks that the implementation produces it at scale: 5,000,000 rounds through the same HMAC-SHA256 and % 48, in 10 independent 500,000-round streams on seeds pinned in src/sim-seeds.ts. Every npm test replays all 10 streams and recomputes every statistic from the replayed sequence.

Simulation Pass 1 — Fresh Seeds (Step 14) — illustrated flow

Chi-squared test (per stream): Observed counts on the 48 positions against the counts a fair wheel gives. 0 / 10 streams below α = 0.01.

Fisher’s combined test: Combines the 10 stream p-values into T = −2 × Σ ln(p_i), χ² with 20 degrees of freedom under a fair RNG. Observed T = 15.0912, p = 0.7712.

Serial independence: Lag-1 autocorrelation and the runs test on the replayed 5M-round sequence: lag1Z = −2.384 (rule |z| < 3), runsP = 0.4312 (rule ≥ 0.01).

RTP on the 2× tier: 100.0070% over 5M rounds, against the 100.0000% baseline.

tests/steps/simulation.ts · Step 14 replay · Verified
for (let s = 0; s < PASS1_STREAMS; s++) {  const counts = new Array(RANGE).fill(0);  for (let i = 0; i < PASS1_ROUNDS_EACH; i++) {    const pos = pass1Position(s, i);    counts[pos]++;    allPositions[k++] = pos;    if (pos >= RANGE / 2) cumReturned += 2;    if (PASS1_CONVERGENCE_POINTS.includes(k)) convergence.push({ rounds: k, rtp: cumReturned / k });  }  streamsReplayed++;  const art = rows[s]?.observed;  const bad = Array.isArray(art) ? counts.findIndex((v, i) => v !== art[i]) : 0;  if (bad === -1) streamsMatching++;  // …} const lag1R = lag1Autocorrelation(allPositions);const lag1ZRecomputed = lag1R * Math.sqrt(PASS1_ROUNDS_TOTAL);const lag1PRecomputed = 2 * normalCDF(-Math.abs(lag1ZRecomputed));const runs = runsTest(allPositions.map(p => p >= RANGE / 2));// …const serialFailsRecomputed = Math.abs(lag1ZRecomputed) < 3 && runs.pValue >= 0.01 ? 0 : 1;
Result: 5M rounds in 10 streams, every stream’s counts identical to the artifact’s on replay. Fisher’s p = 0.7712, 0 streams below α = 0.01, 0 serial-independence failures, 100.0070% on the 2× tier. Consistent with the % 48 model.
4.6Casino-Seed Screen — Pass 2 (Step 15)

Could Duel have chosen server seeds that favour the house? Pass 2 takes each of the 1,350 seeds Duel actually used, pairs it with 1,000 beacon values from src/sim-seeds.ts, and runs a chi-squared test on that seed’s 48 positions. A seed chosen to bias the wheel would show up as an excess of failures. Every npm test replays it in full.

Threshold: At α = 0.01, 1,350 fair seeds give 13.5 failures on average. The pre-registered threshold, 13.5 plus three binomial standard deviations rounded up, is 25. Observed: 15.

Mean casino-seed RTP: 99.9985% over 1,350,000 simulated rounds on the 2× tier, against the 100.0000% baseline.

2 columns
TestResult
Casino seeds tested1,350 (one per round)
Beacon values per seed1,000
Rounds simulated1,350,000
Chi-squared failures at α = 0.0115 / 1,350
Expected under a fair RNG13.5
Failure threshold (3σ)25
Mean RTP on the 2× tier99.9985%
tests/steps/simulation.ts · Step 15 · Verified
for (let s = 0; s < casinoSeeds.length; s++) {  const keyBuf = Buffer.from(casinoSeeds[s], 'hex');  const obs = new Array(RANGE).fill(0);  for (let n = 0; n < PASS2_NONCES; n++) {    const pos = computePositionFromBuffer(keyBuf, pass2Drand(s, n));    obs[pos]++;    wagered += 1;    if (pos >= RANGE / 2) returned += 2;  }  if (chiSquaredTest(obs, expected).pValue < ALPHA) chi2Fails++;}// …const expectedFails = casinoSeeds.length * ALPHA;const threshold = Math.ceil(expectedFails + 3 * Math.sqrt(expectedFails * (1 - ALPHA)));if (casinoSeeds.length === 0) issues.push('zero casino seeds replayed');if (chi2Fails > threshold) issues.push(`${chi2Fails} replayed chi-squared failures exceed the H₀ threshold ${threshold}`);
Result: 15 failures against a threshold of 25, and a mean RTP of 99.9985%. The screen finds no sign that seeds were selected by outcome.
How the screen works: Each of the 1,350 revealed seeds is paired with 1,000 beacon values and screened with a count threshold. The values are generated for the test, not each round’s own beacon; that each seed was fixed before its beacon is a premise (S1.2).
4.7Stake Tiers — Settlement Edge Above the Allowance (From the Config)

0% is the edge inside Duel’s Zero Edge allowance, not a fixed rate. Duel states the allowance covers up to $1,000 of each bet, within $50,000 of wagering per 24 hours. Duel’s client code takes the allowance off the stake first and applies the edge to what is left: excess × (multiplier − 1) / bankroll × 100, held between a 0.1% floor and a 5% ceiling, with a bankroll of 50,000,000 in Duel’s game settings. A bet the remaining allowance covers has an edge of 0, and so does every captured bet.

This is explained from the config, not certified. Duel’s game settings and client code were read on 5 October 2026, not on the capture days, and the client code is not pinned. The $1,000 and $50,000 allowance figures come from Duel’s own statement. No captured stake left the allowance, so what the server credits above it was not observed.

3 columns
TileEdge on the $24,000 above the allowanceEffective edge at a $25,000 stake
2×0.048%0.1% (the floor binds)
4×0.144%0.144%
8×0.336%0.336%
16×0.72%0.72%
24×1.104%1.104%
48×2.256%2.256%
From the config: Bankroll 50,000,000, floor 0.1% and ceiling 5% as served by Duel’s game settings (/api/v2/metadata/roulette) on 5 October 2026. On the five tiles that show a figure, the formula reproduces the edge Duel’s game screen displayed at a $25,000 stake; the 2× tile showed none. Once the daily allowance is used up, the client code computes the edge on the full stake, and as written returns 0 below the floor while Zero Edge is on. Consistent with the formula, not a verified payout.
4.8Bet-Size Invariance (Step 6)

The bet amount is not part of the HMAC key or the message, and nothing in the position derivation reads it. Step 6 recomputes all 100 Phase C rounds, placed at $1.00, 100× the $0.01 stake of the other phases, from the server seed and the beacon alone. If the stake moved the wheel, a recomputation with no stake input would miss.

2 columns
PropertyResult
Bet amount in the HMAC keyNo: the key is the server seed bytes only
Bet amount in the HMAC messageNo: the message is the beacon text + :0 only
Phase C at $1.00100 / 100 positions recompute; 41 wins credited 2× exactly (Step 9)
Phases A, B, D and E at $0.011,250 / 1,250 positions recompute
Code pathcomputePosition(serverSeed, drandRandomness), the same at every stake
Result: The bet amount is not an input to the wheel. 1,350 / 1,350 positions recompute across a 100× stake range, and credits are exact at both stakes.
4.9Informational Items (Not Scored)

Observed returns during the capture, for context only. At these sample sizes they show variance; the proof in 4.1 is the RTP evidence.

3 columns
ItemValueContext
Phase A observed RTP98.50%800 bets at $0.01 on Dark Blue (2×); 394 wins
Phase B observed RTP82.00%200 bets at $0.01 across all 6 colors; 29 wins, $1.64 returned on $2.00
Phase C observed RTP82.00%100 bets at $1.00 on Dark Blue (2×); 41 wins against 50 expected (p = 0.089)
Phase D observed RTP80.00%100 bets at $0.01 on Purple (16×); 5 wins against 6.25 expected
Phase E observed RTP128.00%150 bets at $0.01 on Green (48×); 4 wins against 3.13 expected
Total83.77%1,350 bets, $112.50 wagered; the $1.00 phase dominates (97.92% without it)
Position fit, 48 positionsχ² = 36.52, df 47, p = 0.865Step 19, informational
Win-rate fit, 6 tiers6 / 6 above the Bonferroni boundSmallest p = 0.252 (Dark Blue 2×); Step 19
6 columns
Color betRoundsWinsWin rateExpectedObserved RTP
Dark Blue (2×)93444948.1%50.0%83.2%
Grey (4×)34823.5%25.0%94.1%
Blue (8×)33412.1%12.5%97.0%
Purple (16×)13353.8%6.3%60.2%
Red (24×)3339.1%4.2%218.2%
Green (48×)18342.2%2.1%104.9%
4.10Worked Example — Payout Verification

A real bet from Phase B: round 540018, $0.01 on Red (24×), a mid-rarity tier. Values from data/castle-roulette-master-1350rounds.json, with the tier’s RTP from the count × multiplier = 48 identity:

roundId          = 540018
serverSeed       = e5e5f053134592b0529de6a4ec078399c4213f65d0f0b6202e81b15f9a138f33
serverSeedHash   = 24cbb91a05d2c46c1bc052a547d6f6bf59b455e6a8cd38a4bbbbb38cd616b619
drandRoundId     = 28022624
drandRandomness  = 923e2633196c6cdcebd6422e6652e274c17980325f46bdaad68502c40867d7d4
                   feb8b10e7b42c231e7185cc00974a90c   (96 hex characters, 48 bytes)
stake            = $0.01
bet              = twenty_four (Red, 24×)
amountWon        = 0.240000000000000000 (served)

Step 1 — Wheel position: computePosition("e5e5f053…", "923e2633…") → HMAC-SHA256 bf6d2df10030cc3c…22949eb9 → first 4 bytes = uint32 3,211,603,441 → 3,211,603,441 % 48 = 1

Step 2 — Tier: PAYOUT_TABLE[1] → { multiplier: 24, color: "red" } (positions 1–2 are Red)

Step 3 — Win condition: Bet twenty_four → Red; landed Red → win

Step 4 — Payout: 0.01 × 24 = 0.24 ✓ (equals the served credit)

Step 5 — Red tier RTP: P(Red) = 2 / 48 = 4.1667%; P × 24 = 1 (100%) ✓

3 columns
StepProcessOutput
1computePosition(serverSeed, drandRandomness)1 (wheel position)
2PAYOUT_TABLE[1]{ multiplier: 24, color: "red" }
3Landed tier against the betred === red → win
4stake × multiplier0.01 × 24 = 0.24 (amount won)
5P(Red) × 244.1667% × 24 = 100%
RTP for this bet’s tier · Verified
// Tier = Red (24×): RTP from first principles////   count(Red) = 2   (positions 1, 2)//   P(Red)     = 2 / 48 = 0.041666666666666664//   P × 24     = 1.0000000000000000  = 100%  ✅//// With the % 48 draw counted exactly (positions 0–15 carry one extra value out of 2³²)://   P(position 1) = 89,478,486 / 2³² = 0.020833333488553762//   P(position 2) = 89,478,486 / 2³² = 0.020833333488553762//   P(Red)        = 0.041666666977107525//   P × 24        = 1.0000000074505806  (+7.45 × 10⁻⁹)//// The same identity holds on every tier://   count(tier) × multiplier(tier) = 48  →  P(tier) × multiplier(tier) = 1
Parity verified: Round 540018: position, tier, win and payout match between the live game and the verifier, and the credit is the full 24×. The Red tier returns 100% by the identity, +7.45 × 10⁻⁹ with the draw counted exactly.
Live Gameposition = 1 · color = red · win · amount_won = $0.24
Verifierposition = 1 · color = red · win · amount_won = $0.24
Technical Evidence & Verification5 sections
4.11Evidence Coverage Summary7 checks
3 columns
Verification AreaCoverageResult
Anti-circularity (Step 13)6 color tiers from the counted % 48 mapping; negative control rejected on all 6Pass
RTP claim rule (RTP-CLAIM 1.2.0)6 tiers tabled at their exact RTP; claim noted, not testedInfo
Settlement edge (Step 9)473 / 473 wins at the full multiplier, at $0.01 and $1.00Pass
Simulation Pass 1 (Step 14)5M rounds (10 streams × 500K), Fisher’s p = 0.7712, 0 / 10 streams below α = 0.01Pass
Casino-seed screen (Step 15)1,350 seeds × 1,000 beacon values, 15 failures against a threshold of 25Pass
Bet-size invariance (Step 6)100 / 100 Phase C rounds at $1.00Pass
Serial independence (Step 14)lag1Z = −2.384, runsP = 0.4312 on the replayed 5M-round sequencePass
4.12Code References7 source files
2 columns
FilePurpose
tests/steps/dataset.tsStep 13: anti-circularity, per-tier expectation from the counted mapping, negative control
tests/steps/payouts.tsSteps 7–9: payouts, multipliers and the settlement edge from served credits
tests/steps/simulation.tsSteps 14–15: Pass 1 replay with Fisher’s combination and serial tests; Pass 2 casino-seed screen
src/rtp-settings.ts, src/rtp-claim.tsThe RTP claim rule 1.2.0 and the exact per-tier RTP table
src/simulate.ts, src/sim-seeds.tsThe two-pass simulation and its pinned seeds
src/stats.tsChi-squared, lag-1 autocorrelation, runs test
src/rng.tsPAYOUT_TABLE, RANGE = 48, the position code
4.13Datasets UsedSource artifacts
Simulation output: outputs/simulation-results.json — Pass 1 (10 streams × 500,000 rounds, per-position counts, Fisher’s combination, serial tests) and Pass 2 (1,350 casino seeds × 1,000 beacon values)
RTP claim table: outputs/rtp-claim-table.json — the exact RTP of the 6 tiers under the RTP claim rule 1.2.0
Primary dataset: data/castle-roulette-master-1350rounds.json — 1,350 live rounds for settlement, bet-size invariance and the informational returns
Game settings: evidence/E10-metadata-roulette-2026-10-05.json — Duel’s /api/v2/metadata/roulette response of 5 October 2026: bankroll and edge limits
4.14Verified Invariants8 invariants
2 columns
InvariantResult
P(tier) × multiplier = 1 within 1.12 × 10⁻⁸ on all 6 tiers, from the counted mappingPass
The 48 position probabilities sum to 1 within 10⁻¹⁰Pass
A table with any multiplier raised by one is rejected on every tierPass
Every win credited stake × table multiplier exactly at 18 decimals (473 / 473)Pass
Fisher’s combined p ≥ 0.01 on 10 × 500K streams (observed 0.7712)Pass
Casino-seed failures at or under the threshold (15 ≤ 25)Pass
Phase C ($1.00) positions recompute like the $0.01 roundsPass
The committed RTP claim table equals the run and its pinPass
4.15Reproduction InstructionsRun locally
reproduce-s4.sh · 6 lines · Verified
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1npm cinpm test# Steps 6–9, 13–15 and 19 cover S4
S4 steps, as printed:

[PASS] Step 6 — Bet-Size Invariance
[PASS] Step 7 — Payout Math
[PASS] Step 8 — Color-Position Mapping
[PASS] Step 9 — Settlement Edge Verification
[PASS] Step 13 — Anti-Circularity (Baseline RTP by Construction)
[PASS] Step 14 — Simulation Pass 1 (Fisher's Combined — 10 Streams)
[PASS] Step 15 — Simulation Pass 2 (Casino Seeds)
[PASS] Step 19 — Live-Sample Fit (informational, CASTLE-22)

The RTP claim rule, as printed:

rtp-claim: ENFORCED — NOTED, never scored as a miss
rtp-claim:   true range 100.000000–100.000001% over 6 settings · true min 100.000000% (tier=dark_blue (2x)) · true max 100.000001% (tier=green (48x))
rtp-claim:   outcome NOTED (never a miss, enforced or not) · per-setting table: all 6 rows
05

Fairness Integrity Testing

Does the implementation maintain fairness under non-standard conditions?

Sections 1–4 prove the game is mathematically fair. Section 5 proves the implementation maintains integrity under non-standard conditions. We applied 15 standard fairness integrity tests covering seed integrity, bet timing, outcome determinism, cross-player isolation, payout integrity, and wheel-position distribution integrity. For Castle Roulette, the framework is adapted from the pan-game matrix to reflect the dual-entropy (server seed + drand) architecture and the discrete 48-position outcome model: there is no client seed to test, no nonce sequence per player, no per-player outcome divergence, and the commit-reveal chain is anchored against an external public beacon.

Fairness Integrity Testing

14pass1N/A

What we verified

  • Seed commitment — server seed hash published before drand beacon emits (1,350 / 1,350 verified)
  • drand authenticity — every beacon value matches the public drand chain byte-for-byte (1,350 / 1,350)
  • Bet timing — bet placed before drand publication for every round (min margin 14.763s)
  • Outcome determinism — identical inputs produce identical wheel positions (1,350 / 1,350 recomputed)
  • Cross-player isolation — all players see the same wheel position per round (global outcome model)
  • Distribution integrity — wheel-position distribution is uniform across 48 positions (Fisher's p = 0.7712)

What this means for you

  • No one — not the player, not the casino — can alter the wheel position through the API
  • The casino commits to each round's outcome before the external entropy is even known
  • Every round is cryptographically isolated from every other — no state leakage
  • The external entropy comes from a public beacon the casino cannot forge or withhold
  • The server's outcome is computed from the canonical inputs only — adversarial probes confirmed the server rejects malformed bet parameters and ignores injected outcome fields
14pass1N/A
  • Seed commitment — server seed hash published before drand beacon emits (1,350 / 1,350 verified)
  • drand authenticity — every beacon value matches the public drand chain byte-for-byte (1,350 / 1,350)
  • Bet timing — bet placed before drand publication for every round (min margin 14.763s)
  • Outcome determinism — identical inputs produce identical wheel positions (1,350 / 1,350 recomputed)
  • Cross-player isolation — all players see the same wheel position per round (global outcome model)
  • Distribution integrity — wheel-position distribution is uniform across 48 positions (Fisher's p = 0.7712)
5 / 5Seed Integrity
2 / 2Bet Timing
2 / 2Determinism
2 / 2Isolation
2 / 2Payout Integrity
1 / 1Distribution Integrity

Category Coverage

Seed Integrity5/5
Bet Timing2/2
Determinism2/2
Isolation2/2
Payout Integrity2/2
Distribution Integrity1/1
CheckResultEvidence
Seed integrityPass5 tests — all SEED-001..005 pass (commitment, drand authenticity, uniqueness, determinism, statistical quality χ² p = 0.5505, H = 7.99583 bits/byte)
Bet timingPassBet placed before drand in 1,350 / 1,350 rounds (min margin 14.763s); drand round IDs strictly increasing (28,007,049 → 28,035,974)
Outcome determinismPassIdentical inputs produce identical wheel positions — 1,350 / 1,350 confirmed. Bet-size invariance verified (Phase C 100 / 100). Player-action invariance: architecturally N/A under global outcome model
Cross-player isolationPassRNG state independent (lag1Z = −2.384, runsP = 0.4312); global outcome model — all players see same wheel position
Payout integrityPass2 adversarial socket probes pass (FI-PAYOUT-001 parameter limits: 5/5 invalid bets dropped; FI-PAYOUT-002 field injection: 3/3 injected wheel_position/payout_multiplier/result fields ignored)
Distribution integrityPassWheel positions uniform across 48 bins (live position chi² p = 0.8650 on 1,350 rounds; Fisher's combined p = 0.7712 across 10 × 500K-round streams)
Seed integrityPass
5 tests — all SEED-001..005 pass (commitment, drand authenticity, uniqueness, determinism, statistical quality χ² p = 0.5505, H = 7.99583 bits/byte)
Bet timingPass
Bet placed before drand in 1,350 / 1,350 rounds (min margin 14.763s); drand round IDs strictly increasing (28,007,049 → 28,035,974)
Outcome determinismPass
Identical inputs produce identical wheel positions — 1,350 / 1,350 confirmed. Bet-size invariance verified (Phase C 100 / 100). Player-action invariance: architecturally N/A under global outcome model
Cross-player isolationPass
RNG state independent (lag1Z = −2.384, runsP = 0.4312); global outcome model — all players see same wheel position
Payout integrityPass
2 adversarial socket probes pass (FI-PAYOUT-001 parameter limits: 5/5 invalid bets dropped; FI-PAYOUT-002 field injection: 3/3 injected wheel_position/payout_multiplier/result fields ignored)
Distribution integrityPass
Wheel positions uniform across 48 bins (live position chi² p = 0.8650 on 1,350 rounds; Fisher's combined p = 0.7712 across 10 × 500K-round streams)
✓  Fairness Integrity Verified

15 standard fairness integrity tests: 14 pass, 1 N/A (player-action invariance — global outcome model).

How It Works — Fairness Integrity Testing2 sections
5.1Framework Overview

Testing follows the ProvablyFair.org Fairness Integrity Framework — a structured methodology derived from real, historically observed failures in provably fair systems. For Castle Roulette, the framework is adapted to the dual-entropy model and the discrete 48-position outcome wheel: seed integrity includes bet timing against a public external beacon (drand), outcome determinism is verified position-by-position against the 6-tier PAYOUT_TABLE, and a Castle-specific category covers wheel-position distribution uniformity. Scope boundary: S5 tests whether fairness guarantees hold under non-standard API interaction. Platform-level implementation testing falls outside standard certification.

3 columns
CategoryTestsWhat It Catches
Seed Integrity5Hash mismatches, drand forgery, seed reuse, non-determinism, non-uniform seed generation
Bet Timing2Late-commitment attacks, round shopping, post-hoc drand selection
Determinism3Non-deterministic outputs, player-action influence on global outcome, bet-size influence on outcome
Isolation2Cross-round state leakage, cross-player outcome divergence
Payout Integrity2Parameter enforcement, server-side computation verification
Distribution Integrity1Biased wheel-position distribution across the 48-position discrete outcome space
5.2Severity Framework & Hard Fail Criteria

Findings are classified by severity. Hard fail criteria — any one triggers a NOT PROVABLY FAIR verdict.

3 columns
SeverityMeaningAction
PASSTest passed — no issue detectedNone
N/ATest not applicable to this game typeNone
FLAGAnomaly detected, documented for transparencyDisclosed
HARD FAILFairness guarantee cannot be confirmedCertification blocked until remediated
2 columns
ConditionConsequence
Negative commitment margin (bet placed after drand published)Pre-commitment guarantee broken — operator could have seen beacon first
drand signature mismatch against api.drand.shExternal entropy forged — no independent randomness source
drand round ID non-monotonic (round shopping)Operator cherry-picking favourable beacons post-hoc
Wheel-position recomputation mismatchUndisclosed inputs affecting outcomes
Server seed reuse across roundsCommit-reveal guarantee broken
Per-player wheel-position divergence in the same roundCross-player isolation broken / hidden per-user seed
Position-tier mapping mismatch (PAYOUT_TABLE[position] ≠ live winningCoin)Static payout table modified server-side mid-round
Hard fail criteria: Any single hard fail = NOT PROVABLY FAIR. The audit cannot proceed past a hard fail without operator remediation and re-verification.

15 tests · 14 pass · 1 N/A

Seed Integrity5/5
FI-CR-SEED-001Pass

Server seed is committed (hashed) before the round's drand beacon is known

S1, Step 1 — 1,350/1,350 hashes verified. SHA-256(serverSeed_bytes) === serverSeedHash published pre-drand.

FI-CR-SEED-002Pass

drand beacon is authentic and externally verifiable against the public drand chain

S2, Step 16 — 1,350/1,350 drand signatures cross-verified against api.drand.sh (chain 52db9ba7…4e971). 0 forgeries.

FI-CR-SEED-003Pass

Server seed is unique per round — no reuse across the captured sample

S1, Step 4 — 1,350 unique seeds and 1,350 unique hashes across 1,350 rounds.

FI-CR-SEED-004Pass

Wheel position is deterministic from (serverSeed, drandRandomness) — no hidden entropy

S3, Step 5 — 1,350/1,350 wheel positions independently recomputed via HMAC-SHA256(serverSeed, drand:0) % 48. 0 mismatches.

FI-CR-SEED-005Pass

Captured server seeds show no statistical patterns — uniform byte distribution, high entropy, no round-order correlation

Statistical quality check on 43,200 bytes (1,350 seeds × 32 bytes): byte-value χ² p = 0.5505; Shannon entropy H = 7.99583 bits/byte; round-order × first-byte Spearman ρ = −0.0446 (p = 0.1009). All thresholds met (p ≥ 0.01, H > 7.9, |ρ| < 0.1).

Bet Timing2/2
FI-CR-TIMING-001Pass

Bet placement precedes drand beacon publication for every round — operator commits to the seed before external entropy is known

S1, Step 2 — 1,350/1,350 rounds with positive commitment margin (min 14.763s, mean 20.067s, max 20.405s). Single negative margin = hard fail.

FI-CR-TIMING-002Pass

drand round IDs strictly increase across the capture window — no round shopping

S1, Step 3 — 1,350 rounds, drand round IDs strictly increasing across range 28,007,049 → 28,035,974. No gaps, no backward jumps.

Determinism3/3
FI-OUTCOME-001Pass

Given identical inputs (serverSeed, drandRandomness), the game always produces the same wheel position

S3, Step 5 — 1,350/1,350 wheel positions independently recomputed from the two inputs, zero mismatches.

FI-OUTCOME-002N/A

Wheel position cannot be influenced by player actions — single global outcome computed before any player bets

Architectural — Castle Roulette uses a single global outcome model. Wheel position is computed from (serverSeed, drandRandomness) before any player bets. Players choose bet type (color tier 2× through 48×) but cannot alter the outcome. No manipulation surface exists.

FI-CR-DETERMINISM-003Pass

Wheel position cannot be influenced by bet size — outcome is invariant under stake changes

S3 / S4, Step 6 — all 100 Phase C ($1) rounds verify under the identical RNG code path as the $0.01 rounds. Bet amount is not an input to the HMAC key or message.

Isolation2/2
FI-ISO-001Pass

RNG state is fully independent across rounds — no carry-over from one round to the next

S2, Step 14 — serial independence tested on combined 5M-round sequence: lag1Z = −2.384 (within |Z|<3), runsP = 0.4312 (well above 0.01 threshold).

FI-ISO-002Pass

All players see the same wheel position per round — single global outcome model, no per-user seed, no cross-user dependence

Architectural — computePosition(serverSeed, drandRandomness) takes no per-user input. RNG code path confirmed in S2 (2.1 Implementation).

Payout Integrity2/2
FI-PAYOUT-001Pass

Bet parameters cannot exceed defined limits — invalid amounts and out-of-range bet types are rejected server-side

Adversarial socket probe — 6 place bet requests over wss://roulette.duel.com/s/. Control bet (coin=two, amount=0.01) accepted. 5 adversarial bets all silently dropped (no own_bet response within 8 s): amount=−1, amount=50001, coin="invalid_category", position=48 (out-of-range), position=−1. controlBetAccepted=true, acceptedCount=0, noResponseCount=5. Evidence: testing/tests/castle-roulette/fi-payout-001 in integrity-test repo.

FI-PAYOUT-002Pass

Payout and wheel-position fields cannot be injected into the bet request — server computes outcome only from canonical inputs

Adversarial socket probe — 7 place bet requests over wss://roulette.duel.com/s/. Betting phase: 3 bets accepted across consecutive rounds (598911-598913) with wheel_position=1000, payout_multiplier=999, and result="win" injected respectively — every injected field absent from server responses. injectedFieldsLeaked=false. Spin phase: 3 injection bets silently dropped (betting window closed). No injected value influenced the wheel position or payout outcome. Evidence: testing/tests/castle-roulette/fi-payout-002 in integrity-test repo.

Distribution Integrity1/1
FI-CR-DIST-001Pass

Wheel-position distribution is uniform across 0-47 — no mapping bias, no serial correlation

S2, Steps 14 and 19 — chi-squared goodness-of-fit on 48-bin position distribution. Live dataset (Step 19): position chi² = 36.52 (df = 47, p = 0.8650, n = 1,350) — null hypothesis of uniform distribution not rejected. Simulation (Step 14): Fisher's combined p = 0.7712 across 10 × 500K-round streams; 0 / 10 streams fail at α = 0.01.

Technical Evidence & Verification4 sections
5.3Coverage Summary15 checks
4 columns
Test IDCategoryVerification SourceStatus
FI-CR-SEED-001SeedS1, Step 1 (data-driven)Pass
FI-CR-SEED-002SeedS2, Step 16 (data-driven)Pass
FI-CR-SEED-003SeedS1, Step 4 (data-driven)Pass
FI-CR-SEED-004SeedS3, Step 5 (data-driven)Pass
FI-CR-SEED-005SeedStatistical analysis (data-driven)Pass
FI-CR-TIMING-001TimingS1, Step 2 (data-driven)Pass
FI-CR-TIMING-002TimingS1, Step 3 (data-driven)Pass
FI-OUTCOME-001DeterminismS3, Step 5 (data-driven)Pass
FI-OUTCOME-002DeterminismStructural — global outcome modelN/A
FI-CR-DETERMINISM-003DeterminismS3 / S4, Step 6 (data-driven)Pass
FI-ISO-001IsolationS2, Step 14 (simulation)Pass
FI-ISO-002IsolationStructural — global outcome modelPass
FI-PAYOUT-001PayoutAdversarial socket probePass
FI-PAYOUT-002PayoutAdversarial socket probePass
FI-CR-DIST-001DistributionS2, Step 14 (simulation) + Step 19 (position chi² on live dataset)Pass
Method breakdown: 12 tests verified via verification-suite steps and structural analysis, 1 test N/A (player-action invariance — global outcome model), 2 tests verified via adversarial socket probes. No state-integrity tests required — Castle Roulette is a single-step auto-resolving game with a global outcome model.
5.4Additional Integrity Evidence (S1–S4)7 records
3 columns
PropertySourceFinding
473 / 473 wins credited stake × table multiplier exactlyS4, Step 9Zero house edge — no scaling, no per-tier variation, no edge factor in the RNG formula
1,350 / 1,350 PAYOUT_TABLE multiplier matchS3, Step 8Color-position mapping correct — static 6-tier table not server-modified
Anti-circularity proven for 6 color tiersS4, Step 13100% RTP from count × multiplier = 48 identity — derived from wheel structure, not casino data
15 / 1,350 Pass 2 chi² fails ≤ 25 thresholdS4, Step 15No seed pre-selection bias — mean casino-seed RTP = 99.9985%
Mean simulated RTP = 100.0070%S4, Step 14Within 0.01% of theoretical 100.0000% across 5M rounds (10 × 500K streams)
1,350 / 1,350 wheel-position parityS3, Step 5No post-RNG conditional logic, no hidden entropy — verifier produces identical position to live game
Phase coverage verified: A 800 + B 200 + C 100 + D 100 + E 150 = 1,350S3, Step 10All 5 capture phases represented — full multi-tier and bet-size coverage
5.5Scope

This certification covers the 15 standard fairness integrity tests listed above — the minimum required to verify that the provably fair implementation holds up under non-standard conditions, adapted to Castle Roulette's dual-entropy architecture and 48-position discrete outcome model. This is not a penetration test. It focuses specifically on the provably fair implementation — not the operator's broader platform security.

Standard scope: The 15 tests above are our standard fairness integrity matrix for Castle Roulette games, adapted from the pan-game framework to reflect dual-entropy (server seed + drand) architecture and discrete 48-position outcomes.

Single-account scope: Tests were conducted from a single auditor account. Cross-player consistency (all users seeing the same wheel position per round) is verified architecturally via RNG code path, not empirically through multi-account capture.

No infrastructure testing: Server security, network-level protections and operational controls fall under platform-level security, not game-level fairness, and sit outside this certification.

Point-in-time: Results apply to the game configuration and codebase at the time of audit. Post-audit changes require re-certification.

5.6Reproduction InstructionsRun locally

Data-driven tests (12 of 15): Fully reproducible from the open-source repo. These tests run against the captured dataset and produce deterministic results.

reproduce-s5-data.sh · 4 lines · Verified
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1npm cinpm test
Expected output (S5-related steps):

[PASS] Step 1  — Seed Hash Integrity                → FI-CR-SEED-001
[PASS] Step 2  — Bet Before drand Beacon            → FI-CR-TIMING-001
[PASS] Step 3  — drand Round Monotonicity           → FI-CR-TIMING-002
[PASS] Step 4  — Server Seed Uniqueness             → FI-CR-SEED-003
[PASS] Step 5  — Position Recomputation             → FI-CR-SEED-004, FI-OUTCOME-001
[PASS] Step 6  — Bet-Size Invariance                → FI-CR-DETERMINISM-003
[PASS] Step 14 — Simulation Pass 1 (Fisher's Combined — 10 Streams) → FI-ISO-001, FI-CR-DIST-001
[PASS] Step 15 — Simulation Pass 2 (Casino Seeds)   → FI-CR-DIST-001
[PASS] Step 16 — drand API Signature Verification   → FI-CR-SEED-002

Statistical Quality Test (FI-CR-SEED-005):

fi-seed-quality.js
// FI-CR-SEED-005: Server-seed byte distribution quality// Runs on the 1,350 revealed server seeds from data/castle-roulette-master-1350rounds.json//// Three sub-checks (all PASS thresholds)://   1. Byte-value chi² across 256 buckets — pass if p ≥ 0.01//   2. Shannon entropy (bits/byte)        — pass if H > 7.9//   3. Round-order × first-byte Spearman  — pass if |ρ| < 0.1 AND p ≥ 0.01//// Observed (43,200 bytes from 1,350 × 32-byte seeds)://   1. χ² = 251.4844, p = 0.5505  ✓//   2. H  = 7.99583 bits/byte     ✓//   3. ρ  = −0.0446, p = 0.1009   ✓//// Overall: PASS

API Probe Tests (completed):

fi-api-probes.sh
# FI-PAYOUT-001: Bet parameter limits#   bet_amount = -1, 50001 (exceeds max)#   coin = "invalid_category"#   position = 48 (out of range), -1#   Result: PASS — 5/5 adversarial bets silently dropped (no own_bet within 8s) # FI-PAYOUT-002: Payout / position field injection#   Injected wheel_position=1000, payout_multiplier=999, result="win" in request body#   Result: PASS — 3/3 injected fields absent from server responses (injectedFieldsLeaked=false) # Status: PASS — see integrity-test repo testing/tests/castle-roulette/
Adversarial probes completed: Both adversarial socket probes (parameter validation and field injection) ran against Castle Roulette's bet endpoint and passed. All 5 adversarial bet-parameter inputs were silently dropped by the server; all 3 injected outcome fields were ignored. The data-driven tests cover 12 of 15 fairness integrity guarantees via the published dataset; the remaining 2 are covered by these adversarial probes.
06

Player Verification

Can a player verify their own bets without trusting anyone?

Every Castle Roulette round can be recomputed from two inputs the player can see: the server seed revealed after the spin and the public drand beacon. Save the round’s server seed hash before you bet. A revealed seed that hashes to your saved copy is the seed that was fixed before you played, and the beacon can be checked against any drand relay. This section walks through the steps, with an independent verifier and scripts you can run yourself.

Independent Round Verification

4 Stepsto verify any round

Key principles

  • Save the round’s server seed hash before you bet: your own copy is what shows the seed was fixed in advance
  • Every wheel position recomputes from two inputs you can see; no hidden input goes in
  • If the revealed seed hashes to your saved copy and the beacon matches the public chain, the position is the one those inputs produce
  • ProvablyFair.org’s verifier code, pinned in the package, returned the served position on all 1,350 captured rounds

What you need

  • Server Seed — revealed in the round’s Provably Fair panel after the spin; its hash is broadcast when the round opens
  • drand Round ID — the public beacon round the server used for this round
  • drand Randomness — that round’s beacon value, the same on any drand relay
4 Stepsto verify any round
  • Save the round’s server seed hash before you bet: your own copy is what shows the seed was fixed in advance
  • Every wheel position recomputes from two inputs you can see; no hidden input goes in
  • If the revealed seed hashes to your saved copy and the beacon matches the public chain, the position is the one those inputs produce
  • ProvablyFair.org’s verifier code, pinned in the package, returned the served position on all 1,350 captured rounds
From Saved Hash to Independent Verification — 4-step flow with the optional beacon check — illustrated flow
Server SeedRevealed after the spin
drand Round IDBeacon round used
drand RandomnessPublic beacon value
  1. 1

    Save the Hash & Bet

    Before you bet, copy the round’s server seed hash and keep it. Then pick a color tier and bet while the betting window is open.

  2. 2

    Open the Provably Fair Panel

    After the spin, the round’s panel shows the server seed hash, the revealed server seed, the drand round ID and the drand randomness. Copy the full values.

  3. 3

    Recompute & Confirm

    Enter the values and your saved hash in the ProvablyFair.org verifier, or run a script. The hash must match your copy, and the position must match your round.

  4. 4

    Check the Beacon (Optional)

    Fetch the drand round from any relay. Its signature must equal the panel’s drand randomness.

Visual Walkthroughstep-by-step
6.1Step 1: Save the Hash & Place Your Bet

Before you bet, copy the round’s Server Seed Hashed value as it is shown for that round and keep it: Duel broadcasts the hash when the round opens. That saved copy is what lets you check later that the seed was fixed before you played. Then pick a color tier (Dark Blue 2×, Grey 4×, Blue 8×, Purple 16×, Red 24× or Green 48×) and bet while the window is open. The position depends only on the server seed and the beacon, not on your stake or your color.

Duel.com Castle Roulette — the 48-position wheel, the six color tiers and the Provably Fair button. Other players’ names are masked.

Duel.com Castle Roulette — the 48-position wheel, the six color tiers and the Provably Fair button. Other players’ names are masked.

6.2Step 2: Open the Provably Fair Panel

After the spin, open the round’s Provably Fair panel. It shows the round ID, the server seed hash, the revealed server seed, the drand round ID and the drand randomness, each with a copy button for the full value (the panel shortens them on screen). The revealed seed, hashed as the 32 bytes its hex encodes, must equal the hash you saved:

Server Seed Hashed — the commitment. Compare it with your saved copy.

Server Seed — the plaintext behind the commitment, revealed after the spin.

Drand Round ID — the public beacon round the server used for this round.

Drand Randomness — that round’s beacon value, 96 hex characters; any drand relay serves the same value.

Provably Fair panel of a settled round (599568, illustrative: not in the dataset). Other players’ names are masked.

Provably Fair panel of a settled round (599568, illustrative: not in the dataset). Other players’ names are masked.

6.3Step 3: Recompute & Confirm

Click Verify in the panel to open Duel’s Provably Fair page with the drand seed and server seed filled in; it shows the roll inline. For a check that does not rely on Duel’s page, enter the same values and the hash you saved in the ProvablyFair.org verifier, or run a script from 6.8. The position must equal your round’s, and its tier sets the payout.

Duel’s Provably Fair page with round 599568’s seeds: roll 17 (Grey, 4×). The same inputs recompute to 17.

Duel’s Provably Fair page with round 599568’s seeds: roll 17 (Grey, 4×). The same inputs recompute to 17.

6.4Step 4: Check the Beacon (Optional)

Open api.drand.sh/v2/beacons/quicknet/rounds/ followed by the drand Round ID from the panel, in any browser. Its signature field must equal the panel’s drand randomness exactly. drand is a public beacon run by an independent network; the audit matched all 1,350 captured values against drand.cloudflare.com (Step 16).

Public drand API response for one quicknet round (illustrative, not the round above): its round number and signature.

Public drand API response for one quicknet round (illustrative, not the round above): its round number and signature.

Manual Verification (Advanced)7 sections
6.5Why Manual Verification Matters

Manual verification needs no casino tool and no verifier you have to trust. The calculation runs on your own machine, from the specification in the release, and you can read every line of it.

6.6How the Algorithm Works (Plain English)

Two inputs fix the wheel position:

  • The server seed — Duel’s secret for this round, committed by broadcasting its SHA-256 hash when the round opens
  • The drand beacon — a public value the drand quicknet network publishes every 3 seconds; every captured bet was placed before its round’s beacon was published

HMAC-SHA256, keyed with the server seed’s bytes, takes the beacon value read as text plus :0. The first 4 bytes of the result, read as a number, are reduced modulo 48 to a position from 0 to 47, and the position sets the winning tier: Green 48× (position 0), Red 24× (1–2), Purple 16× (3–5), Blue 8× (6–11), Grey 4× (12–23), Dark Blue 2× (24–47). Your stake and your color do not go in, so every player in the round shares the position. If the revealed seed hashes to the copy you saved before betting, the seed was fixed before the beacon was published and could not be chosen to suit it. Which beacon round the server pairs with a round is not published; the panel shows the one it used.

6.7Casino Verifier vs ProvablyFair.org Verifier3 records

Both tools should give the same position. If they ever differ, something has changed.

3 columns
Duel.com VerifierProvablyFair.org Verifier
SourceCasino-controlledIndependent, open source
Accessduel.com/provably-fair/verifyprovablyfair.org/verify-bets/duel
Trust modelRequires trusting the casinoNot controlled by the casino
Checked by this audit: Duel’s published Verify-tab code, run unmodified on all 1,350 captured rounds: the served position every time; its live page was read on one of them. ProvablyFair.org’s verifier code, pinned by SHA-256, returns the served position on all 1,350 (Step 5).
6.8JavaScript Verification Script

Paste your round’s values into the four constants and run it with Node.js. Use the hash you saved before betting, not one read after the reveal:

verify-round.js · Node.js, no dependencies
// node verify-round.js — paste your round's values into the four constants// serverSeedHashed: the hash you saved BEFORE bettingconst crypto = require('crypto');const serverSeed = '', serverSeedHashed = '', drandRandomness = '', position = 0; const TIERS = [[0, 0, 'Green', 48], [1, 2, 'Red', 24], [3, 5, 'Purple', 16], [6, 11, 'Blue', 8], [12, 23, 'Grey', 4], [24, 47, 'Dark Blue', 2]];const key = Buffer.from(serverSeed, 'hex');const hashMatches = crypto.createHash('sha256').update(key).digest('hex') === serverSeedHashed;const text = new TextDecoder('utf-8').decode(Buffer.from(drandRandomness, 'hex')); // invalid bytes → U+FFFDconst message = Buffer.concat([Buffer.from(text, 'utf8'), Buffer.from(':0')]);const digest = crypto.createHmac('sha256', key).update(message).digest();const pos = digest.readUInt32BE(0) % 48;                                              // no rejectionconst [, , color, multiplier] = TIERS.find(([from, to]) => pos >= from && pos <= to);console.log({ hashMatches, position: pos, tier: `${color} ${multiplier}×`, matches: pos === position });
Checked: Run on all 1,350 captured rounds, it confirms the hash, the served position and its tier on every one.
6.9Python Verification Script

The same steps in Python, standard library only:

verify_round.py · Python 3, standard library
# python3 verify_round.py — paste your round's values into the four constants# server_seed_hashed: the hash you saved BEFORE bettingimport hashlib, hmac server_seed, server_seed_hashed, drand_randomness, position = '', '', '', 0 TIERS = [(0, 0, 'Green', 48), (1, 2, 'Red', 24), (3, 5, 'Purple', 16), (6, 11, 'Blue', 8), (12, 23, 'Grey', 4), (24, 47, 'Dark Blue', 2)]key = bytes.fromhex(server_seed)hash_matches = hashlib.sha256(key).hexdigest() == server_seed_hashedtext = bytes.fromhex(drand_randomness).decode('utf-8', errors='replace')  # invalid bytes → U+FFFDmessage = text.encode('utf-8') + b':0'digest = hmac.new(key, message, hashlib.sha256).digest()pos = int.from_bytes(digest[:4], 'big') % 48  # no rejectioncolor, multiplier = next((c, m) for lo, hi, c, m in TIERS if lo <= pos <= hi)print({'hash_matches': hash_matches, 'position': pos, 'tier': f'{color} {multiplier}×', 'matches': pos == position})
Checked: Run on all 1,350 captured rounds, it confirms the hash, the served position and its tier on every one.
6.10Worked Example7 records

A captured round, 538493 from Phase A: server seed adace83dfe4957273152c5c52aea5e4fc112dabef87ff4baa350ca652420eb26, drand round 28007049. Its commitment, SHA-256 of the seed bytes, is ae7a5f98e2f4785022a58890db980cb71bb9f0c1bd02a44a1d69699ad18baaaa. The steps:

3 columns
StepInputOutput
Hash checkSHA-256 of the 32 seed bytesae7a5f98…ad18baaaa = the commitment ✓
Beacon textdrand randomness 8d59f6f2…5cd6621d, 48 bytes, read as UTF-847 characters
Messagebeacon text + :049 characters
HMAC-SHA256key = seed bytesd6b318ab366262e3…ae1b71b3b1
First 4 bytes0xd6b318ab3,602,061,483
Modulo 483,602,061,483 % 48position 27
Tierpositions 24–47Dark Blue, 2×

The bet was $0.01 on Dark Blue (coin: "two"), so it wins $0.02, the served credit. Any quicknet relay returns the same randomness for round 28,007,049; the audit matched it against drand.cloudflare.com (Step 16).

6.11Evidence Screenshots6 records
2 columns
EvidenceDescription
step1-game-ui.pngCastle Roulette game screen: the wheel, the six color tiers and the Provably Fair button (other players’ names masked)
step2-fairness-page.pngProvably Fair panel of settled round 599568 (illustrative: not in the dataset; names masked)
step3-verification-result.pngDuel’s Provably Fair page with the same round’s seeds: roll 17
step4-drand-verification.pngPublic drand API response for one quicknet round (illustrative)
E07, E08The package’s exhibits of Duel’s fairness page and its verification tab (game selector, seed inputs, published code)
E09Duel’s Castle Roulette Verify-tab code, saved verbatim on 26 September 2026, SHA-256 c83dca21…
From Saved Hash to Independent Verification — 4-step flow with the optional beacon check — illustrated flow
How it works
  1. 1

    Save the Hash & Bet

    Before you bet, copy the round’s server seed hash and keep it. Then pick a color tier and bet while the betting window is open.

  2. 2

    Open the Provably Fair Panel

    After the spin, the round’s panel shows the server seed hash, the revealed server seed, the drand round ID and the drand randomness. Copy the full values.

  3. 3

    Recompute & Confirm

    Enter the values and your saved hash in the ProvablyFair.org verifier, or run a script. The hash must match your copy, and the position must match your round.

  4. 4

    Check the Beacon (Optional)

    Fetch the drand round from any relay. Its signature must equal the panel’s drand randomness.

Visual Walkthroughstep-by-step
6.1Step 1: Save the Hash & Place Your Bet

Before you bet, copy the round’s Server Seed Hashed value as it is shown for that round and keep it: Duel broadcasts the hash when the round opens. That saved copy is what lets you check later that the seed was fixed before you played. Then pick a color tier (Dark Blue 2×, Grey 4×, Blue 8×, Purple 16×, Red 24× or Green 48×) and bet while the window is open. The position depends only on the server seed and the beacon, not on your stake or your color.

Duel.com Castle Roulette — the 48-position wheel, the six color tiers and the Provably Fair button. Other players’ names are masked.

Duel.com Castle Roulette — the 48-position wheel, the six color tiers and the Provably Fair button. Other players’ names are masked.

6.2Step 2: Open the Provably Fair Panel

After the spin, open the round’s Provably Fair panel. It shows the round ID, the server seed hash, the revealed server seed, the drand round ID and the drand randomness, each with a copy button for the full value (the panel shortens them on screen). The revealed seed, hashed as the 32 bytes its hex encodes, must equal the hash you saved:

Server Seed Hashed — the commitment. Compare it with your saved copy.

Server Seed — the plaintext behind the commitment, revealed after the spin.

Drand Round ID — the public beacon round the server used for this round.

Drand Randomness — that round’s beacon value, 96 hex characters; any drand relay serves the same value.

Provably Fair panel of a settled round (599568, illustrative: not in the dataset). Other players’ names are masked.

Provably Fair panel of a settled round (599568, illustrative: not in the dataset). Other players’ names are masked.

6.3Step 3: Recompute & Confirm

Click Verify in the panel to open Duel’s Provably Fair page with the drand seed and server seed filled in; it shows the roll inline. For a check that does not rely on Duel’s page, enter the same values and the hash you saved in the ProvablyFair.org verifier, or run a script from 6.8. The position must equal your round’s, and its tier sets the payout.

Duel’s Provably Fair page with round 599568’s seeds: roll 17 (Grey, 4×). The same inputs recompute to 17.

Duel’s Provably Fair page with round 599568’s seeds: roll 17 (Grey, 4×). The same inputs recompute to 17.

6.4Step 4: Check the Beacon (Optional)

Open api.drand.sh/v2/beacons/quicknet/rounds/ followed by the drand Round ID from the panel, in any browser. Its signature field must equal the panel’s drand randomness exactly. drand is a public beacon run by an independent network; the audit matched all 1,350 captured values against drand.cloudflare.com (Step 16).

Public drand API response for one quicknet round (illustrative, not the round above): its round number and signature.

Public drand API response for one quicknet round (illustrative, not the round above): its round number and signature.

Technical evidence
6.5Why Manual Verification Matters

Manual verification needs no casino tool and no verifier you have to trust. The calculation runs on your own machine, from the specification in the release, and you can read every line of it.

6.6How the Algorithm Works (Plain English)

Two inputs fix the wheel position:

  • The server seed — Duel’s secret for this round, committed by broadcasting its SHA-256 hash when the round opens
  • The drand beacon — a public value the drand quicknet network publishes every 3 seconds; every captured bet was placed before its round’s beacon was published

HMAC-SHA256, keyed with the server seed’s bytes, takes the beacon value read as text plus :0. The first 4 bytes of the result, read as a number, are reduced modulo 48 to a position from 0 to 47, and the position sets the winning tier: Green 48× (position 0), Red 24× (1–2), Purple 16× (3–5), Blue 8× (6–11), Grey 4× (12–23), Dark Blue 2× (24–47). Your stake and your color do not go in, so every player in the round shares the position. If the revealed seed hashes to the copy you saved before betting, the seed was fixed before the beacon was published and could not be chosen to suit it. Which beacon round the server pairs with a round is not published; the panel shows the one it used.

6.7Casino Verifier vs ProvablyFair.org Verifier3 records

Both tools should give the same position. If they ever differ, something has changed.

3 columns
Duel.com VerifierProvablyFair.org Verifier
SourceCasino-controlledIndependent, open source
Accessduel.com/provably-fair/verifyprovablyfair.org/verify-bets/duel
Trust modelRequires trusting the casinoNot controlled by the casino
Checked by this audit: Duel’s published Verify-tab code, run unmodified on all 1,350 captured rounds: the served position every time; its live page was read on one of them. ProvablyFair.org’s verifier code, pinned by SHA-256, returns the served position on all 1,350 (Step 5).
6.8JavaScript Verification Script

Paste your round’s values into the four constants and run it with Node.js. Use the hash you saved before betting, not one read after the reveal:

verify-round.js · Node.js, no dependencies
// node verify-round.js — paste your round's values into the four constants// serverSeedHashed: the hash you saved BEFORE bettingconst crypto = require('crypto');const serverSeed = '', serverSeedHashed = '', drandRandomness = '', position = 0; const TIERS = [[0, 0, 'Green', 48], [1, 2, 'Red', 24], [3, 5, 'Purple', 16], [6, 11, 'Blue', 8], [12, 23, 'Grey', 4], [24, 47, 'Dark Blue', 2]];const key = Buffer.from(serverSeed, 'hex');const hashMatches = crypto.createHash('sha256').update(key).digest('hex') === serverSeedHashed;const text = new TextDecoder('utf-8').decode(Buffer.from(drandRandomness, 'hex')); // invalid bytes → U+FFFDconst message = Buffer.concat([Buffer.from(text, 'utf8'), Buffer.from(':0')]);const digest = crypto.createHmac('sha256', key).update(message).digest();const pos = digest.readUInt32BE(0) % 48;                                              // no rejectionconst [, , color, multiplier] = TIERS.find(([from, to]) => pos >= from && pos <= to);console.log({ hashMatches, position: pos, tier: `${color} ${multiplier}×`, matches: pos === position });
Checked: Run on all 1,350 captured rounds, it confirms the hash, the served position and its tier on every one.
6.9Python Verification Script

The same steps in Python, standard library only:

verify_round.py · Python 3, standard library
# python3 verify_round.py — paste your round's values into the four constants# server_seed_hashed: the hash you saved BEFORE bettingimport hashlib, hmac server_seed, server_seed_hashed, drand_randomness, position = '', '', '', 0 TIERS = [(0, 0, 'Green', 48), (1, 2, 'Red', 24), (3, 5, 'Purple', 16), (6, 11, 'Blue', 8), (12, 23, 'Grey', 4), (24, 47, 'Dark Blue', 2)]key = bytes.fromhex(server_seed)hash_matches = hashlib.sha256(key).hexdigest() == server_seed_hashedtext = bytes.fromhex(drand_randomness).decode('utf-8', errors='replace')  # invalid bytes → U+FFFDmessage = text.encode('utf-8') + b':0'digest = hmac.new(key, message, hashlib.sha256).digest()pos = int.from_bytes(digest[:4], 'big') % 48  # no rejectioncolor, multiplier = next((c, m) for lo, hi, c, m in TIERS if lo <= pos <= hi)print({'hash_matches': hash_matches, 'position': pos, 'tier': f'{color} {multiplier}×', 'matches': pos == position})
Checked: Run on all 1,350 captured rounds, it confirms the hash, the served position and its tier on every one.
6.10Worked Example7 records

A captured round, 538493 from Phase A: server seed adace83dfe4957273152c5c52aea5e4fc112dabef87ff4baa350ca652420eb26, drand round 28007049. Its commitment, SHA-256 of the seed bytes, is ae7a5f98e2f4785022a58890db980cb71bb9f0c1bd02a44a1d69699ad18baaaa. The steps:

3 columns
StepInputOutput
Hash checkSHA-256 of the 32 seed bytesae7a5f98…ad18baaaa = the commitment ✓
Beacon textdrand randomness 8d59f6f2…5cd6621d, 48 bytes, read as UTF-847 characters
Messagebeacon text + :049 characters
HMAC-SHA256key = seed bytesd6b318ab366262e3…ae1b71b3b1
First 4 bytes0xd6b318ab3,602,061,483
Modulo 483,602,061,483 % 48position 27
Tierpositions 24–47Dark Blue, 2×

The bet was $0.01 on Dark Blue (coin: "two"), so it wins $0.02, the served credit. Any quicknet relay returns the same randomness for round 28,007,049; the audit matched it against drand.cloudflare.com (Step 16).

6.11Evidence Screenshots6 records
2 columns
EvidenceDescription
step1-game-ui.pngCastle Roulette game screen: the wheel, the six color tiers and the Provably Fair button (other players’ names masked)
step2-fairness-page.pngProvably Fair panel of settled round 599568 (illustrative: not in the dataset; names masked)
step3-verification-result.pngDuel’s Provably Fair page with the same round’s seeds: roll 17
step4-drand-verification.pngPublic drand API response for one quicknet round (illustrative)
E07, E08The package’s exhibits of Duel’s fairness page and its verification tab (game selector, seed inputs, published code)
E09Duel’s Castle Roulette Verify-tab code, saved verbatim on 26 September 2026, SHA-256 c83dca21…
✓  Any Player Can Reproduce Castle Roulette Results

Only disclosed inputs are used, and identical inputs always give the same position. Save the hash before you bet and the timing is yours to check too.

07

Reproducibility & Artifacts

Can anyone independently reproduce every finding in this audit?

All 19 scored steps ship as code in the open-source release. Check out v1.2.1, run npm ci and npm test: in about 80 seconds it re-verifies all 1,350 live rounds offline and compares its results field by field with the committed ones. The repository is the credential, not this report.

Open-Source Audit Repository

v1.2.1release tag

Repository Details

Prerequisites

  • Node.js 22.x (.nvmrc)
  • npm 9 or later
  • Git
  • npm ci installs Mocha and ts-node from the lockfile
v1.2.1release tag
github.com/ProvablyFair-org/duel-castle-rouletteRelease v1.2.1 · original audit e57da3e

Commands to Reproduce

Clone the release tag and confirm its release manifest: artifact hashes, verdict and scored counts. Node 22.x; the check needs nothing installed.

sh
git clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1node scripts/release-manifest.mjs --check
Expected output
  [release-manifest] OK: 6 artifact hashes match disk, verdict "PROVABLY FAIR — Full Pass", scored 19/19 (flags 0)

Audit Reproducibility Pinning

Release
v1.2.1 · commit d396ac9537f3d723d1fd7a17ef5561f8d28f310a
Original Audit
commit e57da3e96211d6e9fd404f44e497ceac0b59e55d · 4 June 2026
Framework
1.1 · Castle Roulette profile 1.0.2
Node Version
22.x (.nvmrc)
Dataset
data/castle-roulette-master-1350rounds.json (1,350 rounds, Phases A–E)
Dataset Hash (SHA-256)
506e05ee9c07966a721715cd7d7b369e72159601b6a6439542330b311ffd66ce
RNG Code (SHA-256)
src/rng.ts · dbe46b269d43d1491af5694ab3eadf9c7d3c364f5d171fbdd4e832f5518542db
drand Chain
quicknet · 52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971
Capture Window
22–23 April 2026 (UTC)
Runtime
npm test 82 s (Apple M2 Max, Node 22.23.1)
Mutation Battery
30 / 30 must-fail mutations caught by their named step; all 19 scored steps reached
Signed Tag
v1.2.1, ProvablyFair.org SSH key SHA256:gEujiJm2pRyq7lQsfYQfQ1r97H/J7GdaKHbOW8GtikY
Audit ID
PF-2026-DL07
Output Artifacts5 files · SHA-256 pinned
3 columns
FileContentsSHA-256
verification-results.jsonAll 19 scored steps: status, detail, profile checks and informational items82800394b4b4ecb8…
rtp-claim-table.jsonThe 6 color tiers at their exact RTP under the RTP claim ruled633c433749651e9…
simulation-results.json5M-round Pass 1 with per-position counts; Pass 2 on 1,350 casino seedsc91033bd6aed05fb…
drand-api-verification.jsonAll 1,350 beacon values against drand.cloudflare.comcd5554cecdc37448…
rtp-convergence.htmlInteractive RTP convergence chart, self-containede5b14d856f95f97c…
Repository Structure
duel-castle-roulette/  (v1.2.1)
├── src/
│   ├── rng.ts                  → HMAC-SHA256 position code and 6-tier table, built from docs/ALGORITHM.md
│   ├── bias.ts                 → Draw-bias bound of the % 48 reduction
│   ├── rtp-claim.ts            → The framework’s RTP claim rule (1.2.0)
│   ├── rtp-settings.ts         → The claim (noted) and the exact 6-tier RTP table
│   ├── operator-verifier.ts    → Runs Duel’s Verify-tab code unmodified (second check)
│   ├── site-verifier.ts        → Pins and runs the ProvablyFair.org site verifier
│   ├── simulate.ts · sim-seeds.ts → Monte Carlo, 10 streams × 500K; pinned seeds
│   ├── verify-drand-timing.js  → `npm run timing`: chain formula, margins, beacon re-fetch
│   ├── artifact-pins.ts        → SHA-256 pins of the artifacts of record
│   └── loader.ts               → Dataset, SHA-256 guard, declared population
├── tests/
│   ├── verify.ts               → 19 scored steps
│   ├── steps/                  → commitment, determinism, payouts, dataset, simulation,
│   │                             coverage, artifacts, live-fit
│   ├── castle-roulette/        → 24 Mocha unit tests, including the spec’s own (119 checks)
│   └── mutations.json          → 30 must-fail mutations
├── data/
│   └── castle-roulette-master-1350rounds.json → 1,350 live rounds (Phases A–E)
├── outputs/                    → Committed results of record
│   └── run/                    → Your run writes here, never over the record
├── evidence/                   → Screenshots, Duel’s game settings, Duel’s Verify-tab code
├── verifier-parity/            → Pinned copy of the ProvablyFair.org verifier, runner for Duel’s code
├── docs/ALGORITHM.md           → The written specification
├── capture/                    → Reference records of the capture scripts
├── README.md · MANIFEST.md
└── RELEASE-MANIFEST.json       → Artifact hashes, verdict, signing key
Step-to-Section Cross-Reference19 scored steps mapped
3 columns
StepTest NameReport Section
1Seed Hash IntegrityS1, S5
2Bet Before drand BeaconS1, S5
3drand Round MonotonicityS1, S5
4Server Seed UniquenessS1, S5
5Position RecomputationS1, S2, S3, S5, S6
6Bet-Size InvarianceS1, S3, S4, S5
7Payout MathS3, S4
8Color-Position MappingS3, S4, S5
9Settlement Edge VerificationS4, S5
10Phase CoverageS3, S5
11Dataset HashS7
12drand Chain FormulaS1
13Anti-Circularity (Baseline RTP by Construction)S4, S5
14Simulation Pass 1 (Fisher's Combined — 10 Streams)S2, S4, S5
15Simulation Pass 2 (Casino Seeds)S2, S4, S5
16drand API Signature VerificationS2, S5
17Configuration Coverage (coin tiers and wheel positions)S3
18Artifact Integrity (pinned artifacts of record)S7
19Live-Sample Fit (informational, CASTLE-22)S2, S4, S5
Exit Codes0 · 1 · 2 · 5

The exit code is the verdict, so a script or CI job can read it directly.

3 columns
CodeVerdictWhen
0PROVABLY FAIR — Full PassEvery step passes and the run reproduces the committed results
2PROVABLY FAIR — Conditional PassAt least one flag
5RTP FIGURE OVERSTATEDNo draw check failed, but a published RTP figure is above the game’s real return beyond the ±0.1 pp band. Under this game’s noted claim it cannot arise
1NOT PROVABLY FAIRAt least one hard fail, or a reproduction difference beyond tolerance
Reproduction Gateoutputs/run/

An ordinary run writes nothing into outputs/. Its results and diff.json go to outputs/run/, so a re-run can never replace the evidence it scores. outputs/run/diff.json compares the run with the committed results field by field: 1e-14 absolute + 1e-12 relative, and two distinct integers never agree.

2 columns
Committed artifactDifferences in our run
outputs/verification-results.json0

Result: REPRODUCED, 0 fields beyond tolerance; our run’s outputs/run/verification-results.json is byte-identical to the committed file.

Release History5 entries

The dataset is the same in every release.

3 columns
ReleaseWhat changedVerdict
e57da3e · 4 June 2026Original audit published: 16 scored stepsPROVABLY FAIR — Full Pass
v1.0.0Original audit tagged, with artifact pinning (17 steps)Unchanged
v1.1.0Re-certified under Framework 1.1: 19 scored steps, the RTP claim rule, configuration coverage, the live-sample fitUnchanged
v1.2.0Position code rebuilt from the written specification; Duel’s Verify-tab code kept as a second checkUnchanged
v1.2.1Line-ending fix so a Windows clone stays byte-identical; no audit content changedUnchanged
reproduce-audit.sh
reproduce-audit.sh
# Clone the releasegit clone https://github.com/ProvablyFair-org/duel-castle-roulette.gitcd duel-castle-roulettegit checkout v1.2.1 # Install and run the audit (Node 22.x)npm cinpm test # Optional: regenerate the simulation into outputs/run/ and verifynpm run test:full # Optional, needs network: re-fetch every drand signaturenpm run timing # Confirm the release manifestnode scripts/release-manifest.mjs --check
provablyfair.org/verify-bets/duel
This is an open-source audit. Every scored step, dataset and line of verification code is public. Clone the repo, run the tests, and check the results yourself.
✓  Fully Reproducible

Check out v1.2.1 and npm test reproduces all 19 scored steps and compares them with the committed evidence: REPRODUCED, exit 0. The dataset hash pins the same 1,350 rounds.

Framework 1.1

Game Profile Coverage

Is every check of the Castle Roulette profile accounted for?

Framework 1.1 gives each game a profile: a fixed list of checks the audit must cover. Castle Roulette profile 1.0.2 has 30 checks. 19 are covered by scored steps, 6 by package checks, and 5 are not applicable, each with its reason: the game has no seed rotation, no nonce, no client seed and no balance field. Two checks are partial, as the package states.

1.0.2Castle Roulette profile
19Scored steps
6Package checks
5N/A, with reasons
4 columns
CheckWhat it coversCovered byCoverage
CASTLE-01Every revealed seed hashes to its commitmentStep 1Full
CASTLE-02Each rotation’s next-seed hash is the next epoch’s commitmentn/a — no seed rotation and no next-seed hash; round ordering is carried by the beacon instead (Step 3)N/A
CASTLE-03Every bet in an epoch carries its epoch’s commitmentn/a — each round has its own server seed: 1,350 distinct seeds and hashes (Step 4)N/A
CASTLE-04Nonces start at the declared base, with no reusen/a — no nonce: the message is the beacon value + :0, and no record carries a nonce fieldN/A
CASTLE-05Round, seed and phase counts match the capture planSteps 4, 10Full
CASTLE-06The client seed changes the outcomen/a — no client seed: the unpredictable input is the public drand beacon (Steps 2, 16)N/A
CASTLE-07Every position recomputes from its revealed seed and beaconStep 5Full
CASTLE-08Draw-bias bound of the % 48 reductionStep 5Full
CASTLE-09RNG built from the written spec; operator code as a second checkPackage check: spec, spec tests, operator-code runFull
CASTLE-10Win condition from the recomputed positionSteps 7, 8Full
CASTLE-11Every credit equals stake × multiplier on the money gridStep 7Full
CASTLE-12Bet size does not change the position or the payoutStep 6Full
CASTLE-13Served multipliers equal the declared table exactlyStep 8Full
CASTLE-14Tier identity, count × multiplier = 48; caps (none declared, 48× is the maximum)Steps 8, 13Full
CASTLE-15Coin-tier and wheel-position coverageStep 17Full
CASTLE-16Balance ledger across consecutive betsn/a — no balance or wallet field appears in the captured data; every credit is verified instead (Step 7)N/A
CASTLE-17Beacon: public value, publication time, ordering, bet timing, commitment before the beaconSteps 2, 3, 12, 16Partial
CASTLE-18RTP from counted draw values, not casino dataStep 13Full
CASTLE-19Settlement edge served and derivedSteps 9, 13Full
CASTLE-20Simulation, 10 streams × 500,000 roundsStep 14Full
CASTLE-21Casino-seed screen on every revealed seedStep 15Partial
CASTLE-22Live-sample fit of positions and win ratesStep 19Full
CASTLE-23Framework S5 matrix in the packagePackage check: MANIFEST S5 matrix, from the captured dataFull
CASTLE-24ProvablyFair.org verifier matches the audit RNGStep 5Full
CASTLE-25Player instructions: where the seed is, fields, encoding, reductionPackage check: MANIFEST, Verify a betFull
CASTLE-26Dataset pinned by SHA-256Step 11Full
CASTLE-27Artifacts of record pinned, with value domainsStep 18Full
CASTLE-28Fresh-clone reproduction and test countsPackage check: fresh-clone runFull
CASTLE-29Mutation battery reaches every scored stepPackage check: 30 must-fail mutationsFull
CASTLE-30Declared limitations and premisesPackage check: MANIFEST limitationsFull
Partial coverage: CASTLE-17 also asks that each round’s commitment be shown before its beacon is published. The capture kept each hash only in the round’s result record, with no receipt time, so that part is a premise; the beacon values, publication times, ordering and bet timing are covered. CASTLE-21’s casino-seed screen uses 1,000 beacon values per seed against the framework’s 10,000 floor, with a count threshold rather than an exact null.