DEV Community

ton-whale
ton-whale

Posted on

How I Actually Verify RNG Fairness in Blockchain Poker (Step by Step)

TL;DR: You don't need to be a cryptographer to check if a blockchain poker game is fair. I'll show you the exact process I use before every session, with the tools and commands you can run yourself.


The Moment I Realized Trust Wasn't Enough

I used to play on traditional poker sites. One night, I lost seven consecutive all-ins with 70%+ equity. Pocket kings lost to A-5 suited. Aces cracked by J-10 offsuit. You know the story.

Statistically possible? Sure. But I had zero way to confirm the deck wasn't stacked against me. The RNG was a black box, and the site had no incentive to prove otherwise.

That's why I switched to blockchain poker. But here's what most guides don't tell you: provably fair isn't automatic. You have to actually verify it. Here's my exact workflow.


Step 1: Set Your Own Client Seed (Don't Skip This)

Most blockchain poker platforms let you set a client seed. This is your personal contribution to the randomness. If the platform controls both seeds, they could theoretically predict outcomes.

My process before every session:

  1. Go to account settings β†’ find "Provably Fair" or "Seed Settings"
  2. Generate a new client seed (I use openssl rand -hex 32 in terminal)
  3. Copy the displayed server seed hash
  4. Save it in a text file with a timestamp
# Example: Generate a truly random client seed
openssl rand -hex 32
# Output: 7a8b3f2c9d1e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f
Enter fullscreen mode Exit fullscreen mode

On ChainPoker, this takes about 30 seconds. The server seed hash is displayed before any cards are dealt, so you can verify later that nothing changed mid-session.


Step 2: Capture Pre-Hand Hashes

Here's where most players drop the ball. They verify once and assume everything's fine. I verify per hand for high-stakes games.

When a hand starts, the platform shows a dealer seed hash. This is a commitment to the randomness that will determine the cards. Copy it immediately.

What I track:

  • Hand number
  • Pre-hand dealer seed hash
  • My hole cards (visible)
  • Final board

After the hand, the platform reveals the original dealer seed. I hash it myself to confirm it matches:

# Verify a revealed seed (example)
echo -n "revealed-dealer-seed-here" | sha256sum
# Should match the pre-hand hash you saved
Enter fullscreen mode Exit fullscreen mode

If it doesn't match, the deck was changed after the fact. That's a red flag.


Step 3: Run Statistical Tests on Hand Histories

Individual hand verification is good. But the real test is aggregate statistics. A rigged RNG might pass single-hand checks but fail over thousands of hands.

What I check monthly:

  1. Card distribution: Are all 52 cards appearing roughly equally? (Expected: ~1.9% each)
  2. Pocket pair frequency: Should be ~5.9% of hands
  3. Flop pairing: Should hit about 32% of the time
  4. Suit distribution: Even across all four suits

I export my hand history (most platforms support this) and run a chi-squared test:

# Simplified example
from scipy.stats import chisquare

# Count of each card rank in 10,000 hands
observed = [742, 768, 755, 734, 781, 759, 748, 772, 745, 760, 751, 738, 747]
expected = [769.2] * 13  # Equal distribution

stat, p_value = chisquare(observed, f_exp=expected)
print(f"P-value: {p_value:.4f}")
# If p < 0.01, something's fishy
Enter fullscreen mode Exit fullscreen mode

After 8 months on ChainPoker, my p-values consistently hover around 0.3-0.7. That's right in the "fair" zone.


Step 4: Verify Your Own Calculations

Don't trust the platform's verification page. Do it yourself. Here's the exact algorithm most blockchain poker sites use:

  1. Combine server seed + client seed + nonce (incrementing counter)
  2. Hash with SHA-256
  3. Convert hash to a number
  4. Map number to a card (modulo 52, with rejection sampling for fairness)

On ChainPoker, you can see this mapping in their documentation. I've written a small script that replays old hands from the seed data to confirm the cards were determined correctly:

// Simplified card mapping
function seedToCard(seed, clientSeed, nonce) {
    const hash = crypto.createHmac('sha256', seed)
        .update(clientSeed + nonce)
        .digest('hex');
    const value = parseInt(hash.substring(0, 8), 16);
    const cardIndex = value % 52;
    return cardIndex; // 0-51 maps to specific card
}
Enter fullscreen mode Exit fullscreen mode

The Red Flags I Watch For

After hundreds of sessions, here's what I've learned to spot:

🚩 Platform won't let you set your own client seed
Walk away. They control all randomness.

🚩 No pre-hand hash displayed
They're not committing to randomness before the deal.

🚩 Seeds change mid-session without notice
Should only change when you request it.

🚩 Can't export hand histories in bulk
You need data to run your own tests.


Final Checklist (Print This)

Before each session:

  • [ ] Set new client seed using openssl
  • [ ] Copy and save server seed hash
  • [ ] Verify first 5 hands manually
  • [ ] Run weekly chi-squared test on 1000+ hands
  • [ ] Compare pre-hand hashes for any hand you suspect

Blockchain poker isn't automatically fair. But with these steps, you can actually prove it's fairβ€”or catch it if it's not. I sleep better knowing I've checked the math myself.

Start with a small deposit on ChainPoker to test their verification system before moving serious money. The verification tools are in your account settings, and the process takes about 5 minutes your first time.

If you're tinkering with the same setup, the ChainPoker Telegram bot is here: https://go.chainpk.top/r/geo_auto_202606_t_20260519_131037_7228

Top comments (0)