Mathematical Analysis Engine — Pre-Audit Research Document
Duel.com Blackjack uses the same commit-reveal provably fair scheme as all Duel Originals. Each hand pre-generates 50 cards from a deterministic hash chain.
serverSeed and commits SHA-256(serverSeed) before playclientSeed (can be customized)nonce (0, 1, 2, ...)hash = HMAC-SHA256(hex_decode(serverSeed), clientSeed + ":" + nonce + ":" + cursor)| Cursor | Recipient | Card |
|---|---|---|
| 0 | Player — Card 1 | Face up |
| 1 | Dealer — Card 1 (hole) | Face down |
| 2 | Player — Card 2 | Face up |
| 3 | Dealer — Card 2 (upcard) | Face up |
| 4+ | Hits / Splits / Doubles | Sequential |
Server seed: 27fa3967c605e599f2580abe7a33e36cada3bd3610ee8639fdafe7b78394a215
Client seed: wcJKB0KlS07Nrg2_ | Nonce: 5
SHA-256 commitment: 28270a5db414681ca20549fedc6c2284d365b122414dd68cf31f6f7b0bfe16bf
Under infinite deck, dealer outcomes are computed exactly via Markov chain with constant transition probabilities. Each card drawn has P(rank) = 1/13 for ranks 2–9 and Ace, P(10-value) = 4/13.
| Upcard | Bust | 17 | 18 | 19 | 20 | 21 | BJ | Total |
|---|---|---|---|---|---|---|---|---|
| 2 | 35.36% | 13.98% | 13.49% | 12.97% | 12.40% | 11.80% | 0.00% | 100.00% |
| 3 | 37.39% | 13.50% | 13.05% | 12.56% | 12.03% | 11.47% | 0.00% | 100.00% |
| 4 | 39.45% | 13.05% | 12.59% | 12.14% | 11.65% | 11.12% | 0.00% | 100.00% |
| 5 | 41.64% | 12.23% | 12.23% | 11.77% | 11.31% | 10.82% | 0.00% | 100.00% |
| 6 | 42.32% | 16.54% | 10.63% | 10.63% | 10.17% | 9.72% | 0.00% | 100.00% |
| 7 | 26.23% | 36.86% | 13.78% | 7.86% | 7.86% | 7.41% | 0.00% | 100.00% |
| 8 | 24.47% | 12.86% | 35.93% | 12.86% | 6.94% | 6.94% | 0.00% | 100.00% |
| 9 | 22.84% | 12.00% | 12.00% | 35.08% | 12.00% | 6.08% | 0.00% | 100.00% |
| 10 | 19.58% | 10.29% | 10.29% | 10.29% | 31.59% | 10.29% | 7.69% | 100.00% |
| A | 7.98% | 9.05% | 9.05% | 9.05% | 9.05% | 25.03% | 30.77% | 100.00% |
| Upcard | Bust | 17 | 18 | 19 | 20 | 21 | BJ | Total |
|---|---|---|---|---|---|---|---|---|
| 2 | 35.67% | 13.01% | 13.65% | 13.13% | 12.57% | 11.96% | 0.00% | 100.00% |
| 3 | 37.67% | 12.63% | 13.20% | 12.71% | 12.18% | 11.62% | 0.00% | 100.00% |
| 4 | 39.71% | 12.24% | 12.73% | 12.28% | 11.79% | 11.26% | 0.00% | 100.00% |
| 5 | 41.77% | 11.84% | 12.29% | 11.84% | 11.38% | 10.89% | 0.00% | 100.00% |
| 6 | 43.95% | 11.48% | 11.48% | 11.48% | 11.03% | 10.57% | 0.00% | 100.00% |
| 7 | 26.23% | 36.86% | 13.78% | 7.86% | 7.86% | 7.41% | 0.00% | 100.00% |
| 8 | 24.47% | 12.86% | 35.93% | 12.86% | 6.94% | 6.94% | 0.00% | 100.00% |
| 9 | 22.84% | 12.00% | 12.00% | 35.08% | 12.00% | 6.08% | 0.00% | 100.00% |
| 10 | 19.58% | 10.29% | 10.29% | 10.29% | 31.59% | 10.29% | 7.69% | 100.00% |
| A | 9.62% | 3.98% | 9.91% | 9.91% | 9.91% | 25.89% | 30.77% | 100.00% |
Under infinite deck, only total-dependent strategy matters — composition-dependent benefit is exactly 0% because deck composition never changes. Only 2 cells differ from standard 6/8-deck strategy.
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | A | |
|---|---|---|---|---|---|---|---|---|---|---|
| 5 | H | H | H | H | H | H | H | H | H | H |
| 6 | H | H | H | H | H | H | H | H | H | H |
| 7 | H | H | H | H | H | H | H | H | H | H |
| 8 | H | H | H | H | H | H | H | H | H | H |
| 9 | H | D | D | D | D | H | H | H | H | H |
| 10 | D | D | D | D | D | D | D | D | H | H |
| 11 | D | D | D | D | D | D | D | D | D | H |
| 12 | H | H | S | S | S | H | H | H | H | H |
| 13 | S | S | S | S | S | H | H | H | H | H |
| 14 | S | S | S | S | S | H | H | H | H | H |
| 15 | S | S | S | S | S | H | H | H | H | H |
| 16 | S | S | S | S | S | H | H | H | H | H |
| 17 | S | S | S | S | S | S | S | S | S | S |
| 18 | S | S | S | S | S | S | S | S | S | S |
| 19 | S | S | S | S | S | S | S | S | S | S |
| 20 | S | S | S | S | S | S | S | S | S | S |
| 21 | S | S | S | S | S | S | S | S | S | S |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | A | |
|---|---|---|---|---|---|---|---|---|---|---|
| 13 | H | H | H | H | H | H | H | H | H | H |
| 14 | H | H | H | H | H | H | H | H | H | H |
| 15 | H | H | H | H | H | H | H | H | H | H |
| 16 | H | H | D | D | D | H | H | H | H | H |
| 17 | H | D | D | D | D | H | H | H | H | H |
| 18 | S | Ds | Ds | Ds | Ds | S | S | H | H | H |
| 19 | S | S | S | S | S | S | S | S | S | S |
| 20 | S | S | S | S | S | S | S | S | S | S |
| 21 | S | S | S | S | S | S | S | S | S | S |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | A | |
|---|---|---|---|---|---|---|---|---|---|---|
| A | P | P | P | P | P | P | P | P | P | P |
| 10 | S | S | S | S | S | S | S | S | S | S |
| 9 | P | P | P | P | P | S | P | P | S | S |
| 8 | P | P | P | P | P | P | P | P | P | P |
| 7 | P | P | P | P | P | P | H | H | H | H |
| 6 | P | P | P | P | P | H | H | H | H | H |
| 5 | D | D | D | D | D | D | D | D | H | H |
| 4 | H | H | H | P | P | H | H | H | H | H |
| 3 | P | P | P | P | P | P | H | H | H | H |
| 2 | P | P | P | P | P | P | H | H | H | H |
Perfect Pairs evaluates the player's first two cards. Under infinite deck (independent draws at 1/52), the probabilities simplify to exact fractions.
| Outcome | Probability | Multiplier | EV Contribution | Formula |
|---|---|---|---|---|
| Perfect Pair | 0.0192307692 | 27x | +0.5192307692 | P = 1/52 (same rank + same suit) |
| Colored Pair | 0.0192307692 | 11x | +0.2115384615 | P = 1/52 (same rank + same color + different suit) |
| Mixed Pair | 0.0384615385 | 7x | +0.2692307692 | P = 2/52 (same rank + different color) |
| No Pair (loss) | 0.9230769231 | −1 | +0.0000000000 | P = 48/52 (different rank) |
| Total EV | 0.0000000000 |
Multipliers are GROSS returns (total payout including original bet). EV = Σ P(outcome) × multiplier − 1 (cost of bet) = (1/52)(27) + (1/52)(11) + (2/52)(7) − 1 = 27/52 + 11/52 + 14/52 − 1 = 52/52 − 1 = 0 The multiplier-weighted sum: 1×27 + 1×11 + 2×7 = 52 = denominator. This is algebraically exact — not an approximation. QED: Perfect Pairs has exactly 0.000000% house edge under infinite deck. At 6-deck: EV = (5/311)(27) + (6/311)(11) + (12/311)(7) − 1 = -99.08% house edge.
| Outcome | Infinite Deck P | 6-Deck P | Multiplier | EV (Infinite) | EV (6-Deck) |
|---|---|---|---|---|---|
| Perfect Pair | 0.019231 | 0.016077 | 27x | 0.519231 | 0.434084 |
| Colored Pair | 0.019231 | 0.019293 | 11x | 0.211538 | 0.212219 |
| Mixed Pair | 0.038462 | 0.038585 | 7x | 0.269231 | 0.270096 |
| No Pair | 0.923077 | 0.926045 | -1 | -0.923077 | -0.926045 |
| Total EV | 0.000000 | -0.083601 |
21+3 evaluates a 3-card poker hand from Player Card 1, Player Card 2, and Dealer Upcard. Under infinite deck, each of the three cards is drawn independently at 1/52.
| Outcome | Probability | Multiplier | EV Contribution | Formula |
|---|---|---|---|---|
| Suited Trips | 0.0003698225 | 121.2307692x | +0.0448338643 | P = 1/2704 = 0.0003698225 |
| Straight Flush | 0.0020482476 | 53x | +0.1085571234 | P = 288/140608 = 0.0020482476 |
| Three of a Kind | 0.0055473373 | 32x | +0.1775147929 | P = 15/2704 = 0.0055473373 |
| Straight | 0.0307237142 | 12x | +0.3686845699 | P = 4320/140608 = 0.0307237142 |
| Flush | 0.0600819299 | 5x | +0.3004096495 | P = 8448/140608 = 0.0600819299 |
| No Win (loss) | 0.9012289486 | −1 | +0.0000000000 | P = 1 - sum(above) = 0.9012289486 |
| Total EV | -0.0000000000 |
Multipliers are GROSS returns (total payout including original bet). EV = Σ P(outcome) × multiplier − 1 = 1.0000000000 − 1 = -0.0000000000 = -0.0000% The suited trips multiplier 121.2307692... = 121 + 3/13 = 1576/13. This precise irrational value was back-calculated to bring the 21+3 EV as close to 0% as possible under infinite deck. The small residual (-0.0000%) is due to the limited decimal precision of the stored multiplier.
The base game house edge under infinite deck depends on the rule set. Duel's confirmed rules and their impact:
| Rule | Status | Effect on House Edge |
|---|---|---|
| Dealer hits soft 17 (H17 vs S17) | TBD | +0.22% |
| Double after split allowed (DAS) | Confirmed | -0.14% |
| No surrender | Confirmed | +0.07% |
| Resplit aces | TBD | -0.08% |
| No resplit aces | TBD | +0.08% |
| Blackjack pays 3:2 | Confirmed | 0.00% |
| Infinite deck (vs 8-deck) | Confirmed | +0.08% |
| Baseline House Edge (S17, Infinite Deck) | 0.5117% |
Duel's "zero edge" is achieved via fee structure, not game math. The base game runs at ~0.51% house edge under infinite deck with S17. Duel offers a daily wagering allowance at 0% edge. The API field "effective_edge: 0.1" represents the fee/rake — distinct from the game's mathematical house edge.
effective_edge field is reported as observed but not audited for correctness.
| Bet Type | effective_edge Value | Interpretation |
|---|---|---|
| Main bet | 0.1 (10%) | Fee/rake on net winnings — distinct from game math |
| Perfect Pairs | 0 (0%) | Zero edge — confirmed by analytical proof above |
| 21+3 | 0 (0%) | Zero edge — confirmed by analytical proof above |
These expected values validate the simulation engine. If simulated outcomes don't match within 2σ at 10M rounds, the engine has a bug.
| Metric | Value |
|---|---|
| P(dealer BJ | Ace upcard) | 4/13 = 0.307692 = 30.77% |
| Insurance payout | 2:1 |
| Insurance EV | 2 × (4/13) − 1 × (9/13) = −1/13 = -7.69% |
| Expected in 6K hands | ~460 Ace upcards, ~142 dealer BJs |
| Metric | Value |
|---|---|
| P(player BJ) | 2 × (4/13) × (1/13) = 8/169 = 0.047337 = 4.73% |
| Expected in 6K hands | 284 ± 16.4 (1σ) |
| P(dealer BJ) | 8/169 = 4.73% (same as player) |
Each test is classified as DETERMINISTIC (zero tolerance — any failure is a finding) or STATISTICAL (threshold-based — p-value determines pass/fail). The audit will execute all 27 tests against the captured dataset.
Revision note: Four tests from the initial 28 were removed per reviewer feedback — BJ frequency (derivable from per-cursor uniformity + conditional independence), side/main bet correlation (dominated by Pass 2 cherry-pick detection), duplicate card confirmation (reframed as narrative callout), and rank distribution (dominated by 52-card chi-squared). Three tests added: Optimal-Play RTP Engine, Split Rules Verification, Insurance Payout Verification.
Description: For every hand in the dataset, recompute all dealt cards using HMAC-SHA256(hex_decode(serverSeed), clientSeed:nonce:cursor) and rejection sampling. Every card must match.
Mathematical Basis: The HMAC is deterministic: same inputs = same output. If any card mismatches, the casino is not using the committed algorithm.
Expected Value: 100% match rate. Zero tolerance.
Interpretation: Any mismatch = critical finding.
HMAC-SHA256(hex_decode("27fa39..."), "wcJKB0KlS07Nrg2_:5:0") → hash → readUint32BE(0) → mod 52 → card index → CARDS[index]Description: For every revealed server seed, verify SHA-256(serverSeed) matches the hash committed before play began.
Mathematical Basis: SHA-256 is collision-resistant. If the hash matches, the seed was determined before the bet was placed.
Expected Value: 100% match. Zero tolerance.
Interpretation: Any mismatch = the casino changed the seed after seeing the player's actions.
SHA-256("27fa3967c605e599...") = "5e71cdbf40dc2486..." → matches committed hashDescription: When a player splits, verify cards are drawn from sequential cursor positions with no gaps or reuse.
Mathematical Basis: The committed deck (50 pre-generated cards) must be consumed in order. Cursor 4 is the 5th card regardless of whether the player hits or splits.
Expected Value: Sequential cursors, no reuse, cards match HMAC output.
Interpretation: Cursor reuse = reduced entropy. Cursor gaps = possible manipulation.
P1=cursor0, D_hole=cursor1, P2=cursor2, D_up=cursor3, split_card1=cursor4, split_card2=cursor5...Description: Verify nonces are sequential (0, 1, 2, ...) within each seed epoch. Detect gaps or duplicates.
Mathematical Basis: Each hand increments the nonce by exactly 1. Gaps = undisclosed hands. Duplicates = reused randomness.
Expected Value: Strictly sequential. Any gap requires explanation.
Interpretation: Small gaps at phase boundaries: capture artifacts. Gaps mid-phase: suspicious.
Epoch 1: nonces 0,1,2,3,4,5. Gap at 6 → investigate.Description: Count occurrences of each of 52 card types across ALL draws. Under infinite deck, each should appear at 1/52.
Mathematical Basis: Chi-squared goodness-of-fit, 51 df. Critical value at alpha=0.01: 76.15.
Expected Value: Each card at N/52. At 30,000 draws: ~577 per card, sigma 23.4.
Interpretation: p < 0.01 = biased. p >= 0.01 = consistent with fair infinite deck.
X2 = sum((observed_i - expected_i)^2 / expected_i) for i = 0..51Description: Test card distribution at EACH cursor position independently. Each position should produce uniform 1/52 distribution.
Mathematical Basis: Each cursor is an independent HMAC call. Per-position testing catches position-dependent bias that aggregate testing misses.
Expected Value: Chi-squared per position, 51 df. At 6,000 hands: ~115 draws per card per position.
Interpretation: Failed positions = cursor-to-hash mapping flaw at specific offsets.
Cursor 0: count each card across all hands. Expected = 6000/52 = 115.4Description: For each dealer upcard value (2-A), compute P(hole card = 10-value). Must be exactly 4/13 regardless of upcard.
Mathematical Basis: With independent draws, upcard provides zero information about hole card. Any correlation = draws not independent.
Expected Value: P(10-value hole | any upcard) = 4/13 = 0.30769. Binomial test per upcard group.
Interpretation: Deviation in any upcard group = draws are correlated = not truly infinite deck.
For upcard=6: count hole card in {10,J,Q,K}. Expected ratio: 4/13.Description: Lag-1 autocorrelation and Wald-Wolfowitz runs test on main bet outcomes. Consecutive hands should be independent.
Mathematical Basis: Each hand uses a different nonce. Correlation suggests seed-level manipulation.
Expected Value: |lag1_z| < 3 AND runs_p >= 0.01.
Interpretation: Positive autocorrelation = streaks beyond chance. Negative = alternating pattern.
Encode: win=1, push=0, loss=-1. lag-1 r, z = r * sqrt(N).Description: For every hand, verify dealer hit when total < 17 (or soft 17 under H17) and stood when total >= 17 (or soft 18+ under S17).
Mathematical Basis: Dealer rules are deterministic. Any deviation is a game logic error.
Expected Value: 100% compliance. Zero tolerance.
Interpretation: Any rule violation = bug or manipulation.
Dealer: 6 → draws 3 (9) → draws A (soft 20). S17: stand. Verify dealer stood.Description: Compare observed dealer final values (17, 18, 19, 20, 21, bust) to Markov chain probabilities, stratified by upcard.
Mathematical Basis: Dealer outcomes follow a Markov chain with constant transition probabilities (infinite deck).
Expected Value: Overall bust rate ~28-29% (S17). Chi-squared with 5 df. Per-upcard bust rates from Markov chain.
Interpretation: Per-upcard deviation = rule applied incorrectly for specific starting hands.
At 6,000 hands: expected busts ~1,700. Chi-squared on {17,18,19,20,21,bust}.Description: When insurance is accepted and dealer has blackjack, verify payout = 3x insurance stake (2:1 net + stake returned). When dealer does not have BJ, verify insurance stake is lost.
Mathematical Basis: Insurance is a deterministic side bet — payout depends only on whether dealer has BJ. Not a statistical test.
Expected Value: 100% payout correctness. Zero tolerance.
Interpretation: Any discrepancy = payout calculation error on insurance.
Insurance $0.005 (half main bet). Dealer BJ: amount_won includes $0.015 (3x). No BJ: $0.005 lost.Description: For every hand, recompute the correct total payout and compare to amount_won.
Mathematical Basis: Win = 2x. Push = 1x. BJ = 2.5x. Double win = 4x. Double push = 2x. Loss = 0. Side bet wins added.
Expected Value: 100% match. Zero tolerance.
Interpretation: Any discrepancy = payout error. Check edge cases: BJ vs dealer BJ = push.
Bet $0.01, BJ win: amount_won = $0.025. PP 27x: add $0.27.Description: For every natural blackjack, verify amount_won = bet x 2.5. 6:5 would add ~1.39% house edge.
Expected Value: 100% of naturals pay exactly 2.5x. Zero tolerance.
Interpretation: Any deviation from 2.5x: check if 6:5 (2.2x) or even money (2x).
Bet $0.01: natural BJ amount_won = $0.025. Confirmed in test hands.Description: For every doubled hand, verify: win = 4x original, push = 2x, loss = 0.
Expected Value: 100% match. Zero tolerance.
Interpretation: Common bug: paying 2x instead of 4x on double win.
Bet $0.01, double. Total wager $0.02. Win: amount_won = $0.04.Description: Once split rules are observed during capture, lock them as deterministic checks: (a) re-split allowed/denied correctly, (b) hit after split aces allowed/denied correctly, (c) double after split allowed/denied correctly, (d) surrender correctly rejected (not available).
Mathematical Basis: Game rules are fixed by the implementation. Once observed, any deviation is a logic error.
Expected Value: 100% consistency with observed rules. Zero tolerance.
Interpretation: Inconsistent rule application = non-deterministic game logic.
If re-split observed in Phase H: verify re-split is offered on all subsequent pairs-after-split. If denied: verify never offered.Description: Each split hand is evaluated and paid independently. Verify payout per split hand matches the hand's outcome.
Expected Value: 100% match. Zero tolerance.
Interpretation: One split hand winning while the other loses must produce correct net payout.
Split 8s: hand 1 = 18 (win), hand 2 = 15 (lose). Payout = 1x bet (net: +0 from hand1 win, -1x from hand2 loss).Description: For every PP-active hand, classify first 2 player cards. Verify payout: perfect = 27x, colored = 11x, mixed = 7x, no pair = 0.
Expected Value: 100% match. Zero tolerance.
Interpretation: Any mismatch = classification or payout error.
QS + QS → same rank, same suit → Perfect Pair → payout = bet x 27.Description: For every 21+3 active hand, evaluate the 3-card poker hand (P1, P2, D_upcard). Verify payout matches config.
Expected Value: 100% match. Zero tolerance. Priority: suited trips > SF > 3oaK > straight > flush.
Interpretation: Any mismatch = hand classification or payout error.
9H, JD, 10S → consecutive (9,10,J) → different suits → Straight → bet x 12.Description: Verify side bet results use ONLY initial 3 cards (P1, P2, D_upcard), unchanged by subsequent player actions.
Expected Value: side_bet_results identical in deal response and final response.
Interpretation: If results change after player actions: evaluation is not based solely on initial cards.
Compare side_bet_results from POST /blackjack (deal) vs POST /blackjack/{id}/stand (final).Description: Verify suited trips uses full-precision multiplier 121.2307692... = 1576/13, not a rounded approximation.
Mathematical Basis: Truncation at 121.23 instead of 121.2307692 creates measurable edge over millions of bets.
Expected Value: amount_won = amount_placed x 121.2307692... with API-level precision.
Bet $0.01: payout should be $1.212307692..., not $1.2123.Description: Compute the exact optimal-play RTP via dynamic programming over all player/dealer states under infinite deck. This produces the headline RTP figure. Parallel to Video Poker's exhaustive C(52,5) enumeration.
Mathematical Basis: For infinite deck, enumerate all (player_total, dealer_upcard) states. For each, compute EV of hit/stand/double/split via recursive expectation. The max EV across actions = optimal play. Weight by deal probabilities = theoretical RTP.
Expected Value: ~99.49% (S17) or ~99.27% (H17). Cross-validate against Wizard of Odds published figure of 0.5117% house edge for infinite deck S17.
Interpretation: If independently computed RTP does not match WoO within 0.001%, the engine has a bug. This is the anti-circularity proof for blackjack.
~340 states (34 player totals x 10 upcards). Hard 16 vs dealer 10: EV(hit) = -0.5386, EV(stand) = -0.5401 → optimal = HIT.Description: Simulate 10M+ hands with basic strategy using fresh random seeds. Compare empirical RTP to analytical engine output.
Mathematical Basis: Law of large numbers + Fisher's method across 10 streams. Eliminates single-seed bias.
Expected Value: Simulated RTP within 0.05% of analytical. Fisher's p > 0.01.
Interpretation: Deviation > 0.1% at 10M rounds: investigate.
10 streams x 1M hands. Per-stream: chi-squared on outcome distribution. Fisher's T = -2 * sum(ln(p_i)).Description: For each revealed casino seed, simulate 100K hands. Compare early-nonce vs extended-nonce RTP. Flag systematic early-window depression.
Expected Value: ~5% flagged by chance. Binomial test on flag count. PASS if p >= 0.01.
Interpretation: Significantly more flags = evidence of cherry-pick bias.
Seeds: 110. Flags: k. Binomial p = P(X >= k | n=110, p=0.05).Description: Prove analytically that PP(27/11/7) = exactly 0% edge under infinite deck.
Mathematical Basis: EV = (1/52)(27) + (1/52)(11) + (2/52)(7) - 1 = 52/52 - 1 = 0.
Expected Value: EV = 0.000000. Exact.
1x27 + 1x11 + 2x7 = 52 = denominator. QED.Description: Prove analytically that 21+3 pay table = ~0% edge under infinite deck. The multiplier 121+3/13 was back-calculated for this.
Expected Value: EV within rounding of 0.00%.
P(suited trips) x 121.23 + P(SF) x 53 + P(3oaK) x 32 + P(straight) x 12 + P(flush) x 5 - P(loss) = ~0%.Description: Prove analytically that card counting is impossible against infinite deck. P(next card = X) = 1/52 regardless of history.
Expected Value: Confirmed by per-cursor uniformity (#6) and conditional independence (#7).
Interpretation: Positive finding — immune to advantage play.
After 100 aces in 1000 hands: P(next = Ace) still = 1/13. Card counting advantage = 0.Description: Verify hands at different stakes produce identical cards given same seed/nonce/cursor. Bet amount is not an HMAC input.
Expected Value: Card generation independent of bet size. Zero tolerance.
Interpretation: Any correlation = bet discrimination.
Phase A ($0.01) nonce 5: [8H, JH, 3C, KD]. Phase E ($10) same seed/nonce: identical sequence.This section defines the complete audit methodology for Duel.com Blackjack — capture phases, verification steps, simulation approach, report structure, and what makes this audit unique in the provably fair space.
Six capture phases, each targeting specific game mechanics. All phases use the same test account with seed rotation between phases. Side bets placed at $0.01.
Revision note: Phases F and G (PP-only $0.10 and 21+3-only $0.10) were removed per reviewer feedback. The standard multipliers (27x, 11x, 7x, 53x, 32x, 12x, 5x) all multiply cleanly into $0.01 — no rounding ambiguity at either stake. The one precision-sensitive multiplier (suited trips 121.2307692x) hits at P=1/2704, making empirical capture infeasible at any sane sample size. It is handled analytically in Step 20. The 800 freed hands are rolled into Phase A for a stronger baseline.
| Phase | Hands | Stake | Side Bets | Strategy | Purpose |
|---|---|---|---|---|---|
| A | 3,300 | $0.01 | Both $0.01 | Basic strategy | Baseline coverage — main game + both side bets under optimal play. ~250 PP hits, ~330 21+3 wins expected. |
| B | 1,000 | $0.01 | Both $0.01 | Aggressive (hit to 16+) | Extended cursor consumption — verifies cards beyond cursor 4 |
| C | 500 | $0.01 | Both $0.01 | Split/double priority | Force splits and doubles whenever available — cursor ordering verification |
| D | 500 | $0.01 | Both $0.01 | Custom client seed | 10 auditor-chosen client seeds (50 hands each) — proves client seed influences outcome |
| E | 200 | $10 | None | Basic strategy | Bet-size invariance — same RNG at 1000x the stake |
| F | 500 | $0.01 | Both $0.01 | Multi-split focus | Split every pair — cursor ordering across split hands, re-split testing |
Steps 1–18 follow the standardized ProvablyFair.org framework. Steps 19–27 are blackjack-specific. Each step is DETERMINISTIC (zero tolerance) or STATISTICAL (threshold-based with Bonferroni correction). Revised per reviewer feedback: 4 redundant tests removed, 3 higher-value tests added.
| # | Step Name | Type | What It Proves |
|---|---|---|---|
| 1 | Seed Hash Integrity | DET | SHA-256(serverSeed) matches pre-committed hash |
| 2 | Commitment Linkage | DET | nextServerSeedHash chains to next epoch's serverSeedHashed |
| 3 | Hash Consistency Within Epoch | DET | All bets in epoch use the same server seed hash |
| 4 | Nonce Audit | DET | Sequential nonces 0,1,2,...,n-1 — no gaps or duplicates |
| 5 | Outcome Recomputation | DET | Every card matches HMAC-SHA256 output at correct cursor |
| 6 | Client Seed Influence | DET | Changing client seed produces different cards |
| 7 | Payout Math | DET | amount_won = correct payout for all outcome types |
| 8 | Multiplier Provenance | DET | Side bet multipliers match /api/v2/blackjack/config |
| 9 | Bet-Size Invariance | DET | Phase E cards recompute identically to $0.01 cards |
| 10 | House Edge Audit | DET | effective_edge field consistent across all hands |
| 11 | Config Completeness | DET | All side bet hand types present in config |
| 12 | Epoch Size | DET | All epochs within expected nonce range |
| 13 | Phase Labels | DET | All 6 phases (A-F) present in dataset |
| 14 | Dataset Hash | DET | SHA-256 of dataset file matches pinned value |
| 15 | Phase D Client Seed Variation | DET | 500 hands with auditor client seeds — all recomputed correctly |
| 16 | Anti-Circularity (Optimal-Play RTP Engine) | DET | Headline RTP from independent DP computation — cross-validated against WoO |
| 17 | Simulation Pass 1 | STAT | 10M+ hands, Fisher's method — empirical RTP matches analytical engine |
| 18 | Pass 2 Cherry-Pick Detection | STAT | Casino seeds tested for early-nonce bias |
| Blackjack-Specific Steps | |||
| 19 | Dealer Rule Compliance | DET | Dealer hits/stands correctly per H17 or S17 for every hand |
| 20 | Blackjack Payout (3:2) | DET | Every natural BJ pays exactly 2.5x |
| 21 | Double Payout | DET | Win=4x, push=2x, loss=0 on doubled hands |
| 22 | Split Cursor Ordering | DET | Sequential cursors across split hands — no reuse, no gaps |
| 23 | Split Rules Verification | DET | Re-split / hit-split-aces / DAS / surrender rejection — consistent with observed rules |
| 24 | Split Payout Independence | DET | Each split hand evaluated and paid independently |
| 25 | Insurance Payout | DET | Accepted: 3x stake on dealer BJ, 0 otherwise. Deterministic, not statistical. |
| 26 | Perfect Pairs + 21+3 Payout | DET | Classification + payout match config for all side bet hands |
| 27 | Side Bet Independence | DET | Results from initial 3 cards only, unchanged by player actions |
| Parameter | Value | Rationale |
|---|---|---|
| Pass 1 — Fresh Seeds | 10 streams x 1M hands = 10M | Fisher's method eliminates single-seed bias |
| Strategy | Full basic strategy (hit/stand/double/split) | Infinite deck optimal play — total-dependent only |
| Side Bets | Both active on all simulated hands | Validates PP + 21+3 RTP independently |
| Pass 2 — Casino Seeds | ~110 seeds x 100K nonces | Cherry-pick detection via early vs extended window |
| Serial Independence | Lag-1 + Wald-Wolfowitz per stream | Bonferroni-corrected across 10 streams |
| Expected RTP (main) | ~99.49% (S17) or ~99.27% (H17) | Before Duel's edge deduction |
| Expected RTP (PP) | 100.00% | Proven analytically — see Section 4 |
| Expected RTP (21+3) | ~100.00% | Proven analytically — see Section 5 |
| # | Chapter | Content |
|---|---|---|
| 1 | Executive Summary | Verdict, key numbers, scope |
| 2 | Game Rules | Infinite deck, BJ 3:2, dealer rules, insurance, side bets |
| 3 | RNG Algorithm Analysis | HMAC-SHA256, rejection sampling, card mapping, worked example |
| 4 | Game Logic Verifiability | Deal sequence, cursor ordering, split mechanics |
| 5 | Live Parity Testing | Seed management, epoch structure, commitment chain |
| 6 | RTP Analysis | Main game + PP + 21+3, anti-circularity, simulation results |
| 7 | Side Bet Analysis | Zero-edge proofs, probability tables, pay table design |
| 8 | Dealer Behavior Analysis | Markov chain, H17/S17 determination, bust rate verification |
| 9 | Optimal Play Engine | Basic strategy derivation, infinite deck differences, RTP computation |
| 10 | Edge-Case Analysis | Card distribution, cursor uniformity, conditional independence |
| 11 | Exploit Testing | 28-test matrix, attack surface coverage |
| 12 | Simulation Methodology | Fisher's method, multi-stream, Pass 1 + Pass 2 |
| 13 | Operator Trust Analysis | Commit-reveal model, cherry-pick risk, entropy assessment |
| 14 | Recommendations | Findings, future audit items, disclosure notes |
| 15 | Conclusion | Final verdict with evidence chain |
| 16 | Glossary | Terms, definitions, formulas |
| 17 | Reproducibility | Dataset hash, npm commands, dependencies |
| 18 | Evidence Appendix | Artifacts, screenshots, JSON outputs |
Mathematical proof that PP(27/11/7) = exactly 0% edge and 21+3(121.23/53/32/12/5) = ~0% edge under infinite deck. The multiplier sum 52/52 = 1.000 is algebraically exact. No simulation needed — this is a closed-form result.
Exact dealer outcome probabilities per upcard from first principles. Compare observed dealer final values to Markov chain theory stratified by upcard — catches rule violations at individual card levels that aggregate tests miss.
Formal proof that infinite deck makes card counting provably useless: P(next card) = 1/52 regardless of history. This is a positive finding — the game is immune to advantage play. Verified empirically via conditional independence testing.
Testing the HMAC chain itself, not just outcomes. Each cursor position (0–49) should produce uniform 1/52 distribution independently. Catches position-dependent bias in the hash-to-card mapping that outcome-level tests cannot detect.
For each dealer upcard (2-A), verify P(hole card = 10-value) = 4/13 exactly. Any deviation proves draws are correlated — the deck is not truly infinite. This test is specific to infinite-deck implementations and has no analogue in finite-deck audits.
The suited trips payout 121+3/13 = 1576/13 is a non-standard irrational value. We prove it was back-calculated for infinite deck zero-edge. We also verify floating-point precision: truncation at bet x 121.23 instead of 121.2307692... creates measurable edge over millions of bets.
The numbers below represent total amount wagered, not money lost. Blackjack at ~99.49% RTP with basic strategy means nearly all wagered money returns to the balance. The account acts as a float — money circulates through bets and payouts, with only a tiny fraction lost to house edge.
| Phase | Hands | Main Stake | Side Bets | Wager/Hand | Total Wagered |
|---|---|---|---|---|---|
| A | 3,300 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $99.00 |
| B | 1,000 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $30.00 |
| C | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| D | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| E | 200 | $10.00 | None | $10.00 | $2,000.00 |
| F | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| Total Wagered | $2,174.00 | ||||
| Metric | Value | Explanation |
|---|---|---|
| Total wagered | $2,174.00 | Sum of all bets placed across 6,000 hands |
| Expected loss (0% edge / zero edge window) | $0.00 | Under Duel's zero-edge promotion, 100% RTP — no expected loss |
| Expected loss (0.51% edge / outside zero edge) | $11.09 | $2,174 x 0.51% = $11.09 — the mathematical house take |
| Side bet expected loss | $0.00 | Both side bets are 0% edge under infinite deck (proven in Sections 4-5) |
| Worst-case variance (3-sigma) | ~$80 | At $10/hand, a 8-hand losing streak = $80 drawdown. Recoverable. |
| Minimum wallet balance needed | $100 | $10/hand + buffer for variance swings. Phases A-D run first at $0.01, building confidence before Phase E. |
| Recommended wallet balance | $150 | Comfortable buffer. Phase E runs 200 hands at $10 — balance fluctuates +/-$50 around starting point. |
| Phase | Hands | Main Stake | Side Bets | Wager/Hand | Total Wagered |
|---|---|---|---|---|---|
| A | 3,300 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $99.00 |
| B | 1,000 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $30.00 |
| C | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| D | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| E | 200 | $1.00 | None | $1.00 | $200.00 |
| F | 500 | $0.01 | PP $0.01 + 21+3 $0.01 | $0.03 | $15.00 |
| Total Wagered | $374.00 | ||||
| Metric | Value | Explanation |
|---|---|---|
| Total wagered | $374.00 | Sum of all bets placed across 6,000 hands |
| Expected loss (0% edge / zero edge window) | $0.00 | Under Duel's zero-edge promotion |
| Expected loss (0.51% edge / outside zero edge) | $1.91 | $374 x 0.51% = $1.91 |
| Side bet expected loss | $0.00 | Both side bets are 0% edge under infinite deck |
| Worst-case variance (3-sigma) | ~$25 | At $1/hand, manageable swings |
| Minimum wallet balance needed | $20 | $1/hand + small buffer. Most phases run at $0.01. |
| Recommended wallet balance | $30 | Comfortable for all phases including $1 Phase E. |
| Question | How It Gets Answered | Impact If Different |
|---|---|---|
| Soft 17 — dealer hits or stands? | Observe ~400 dealer soft-17 hands | H17 adds +0.22% house edge |
| Split cursor ordering | Phase C + Phase H split hands | Wrong ordering = card manipulation |
| Re-split allowed? | Phase H multi-split focus | Affects optimal strategy + RTP |
| Hit after split aces? | Phase H — split aces when available | -0.19% if allowed |
| Double after split? | Phase C — double after splitting | -0.14% if allowed (confirmed available pre-split) |
| Insurance payout multiplier | Accept insurance on dealer Ace, verify 2:1 | Non-standard payout = different EV |
| Colored Pair (11x) | Observe same-rank+same-color+different-suit | Already proven analytically — need empirical confirmation |
BLACKJACK MATH ENGINE v1.0 | PROVABLYFAIR.ORG | APRIL 2026