How-to guide

Provably Fair Games: How They Work

The cryptographic technique that lets you verify casino games haven't been tampered with - how it works, which casinos use it, how to verify.

Editor TBD
Senior Casino Editor · Researcher covering crypto gambling and on-chain finance
Fact-checked by Fact-Checker TBD - Reviews license validity, bonus terms, and geo-restriction claims
Last updated:

Provably Fair Games: How They Work

The cryptographic technique that lets you verify casino games haven’t been tampered with - how it works, which casinos use it, how to verify.


What this guide covers

Provably fair gaming is a revolutionary concept that gives players the power to mathematically confirm that no one - not the casino, not a hacker - changed the outcome of a bet after it was placed. Instead of blindly trusting a “random number generator,” you use public cryptography (hashing and HMACs) to audit every single round. This guide explains the behind‑the‑scenes mechanics, walks you through performing your own verification, and highlights common misunderstandings. While most crypto casinos employ the same core seed‑based system, we also touch on on‑chain fairness models where relevant. By the end, you’ll know exactly how to keep a casino honest, even if you never write a line of code.


Prerequisites

Before diving in, have these ready:

  • Basic understanding of cryptographic hashing - You don’t need to be a developer, but knowing that SHA‑256 turns any input into a fixed‑length, unpredictable fingerprint helps immensely.
  • A modern browser - Chrome, Firefox, or anything that can access online HMAC/SHA‑256 calculators.
  • A crypto wallet (optional) - You can verify games without depositing, but if you plan to play you’ll need a wallet that supports the casino’s chosen network (e.g., TRC‑20 for Tron, ERC‑20 for Ethereum).
  • A reliable random‑string generator - Useful for creating your own client seed (we’ll explain why that matters).
  • A few minutes of focused time - Manual verification isn’t instant; rushing leads to mistakes.

Step‑by‑step: how to verify a round

The process below uses the most common algorithm (HMAC‑SHA256 with server seed, client seed, and nonce). While the exact string formatting can vary slightly between casinos, the principles are universal. We’ll use a dice game that produces a number from 0.00 to 99.99 as our example.

1. Choose a provably fair casino and open a game

Pick an operator that openly documents its fairness method. Look for a padlock icon or a “Fairness” tab in the game interface. Reputable casinos will display the hashed server seed before you place any bet.

For this guide we’ll assume a typical casino that generates a random server seed, hashes it with SHA‑256, and shows you that hash. The casino also lets you set your own client seed.

2. Set (and record) your client seed before betting

  • If the casino provides a client seed for you, change it immediately. Use a random string of at least 16 characters - you can create one by mashing your keyboard or using a password manager.
  • Copy the newly set client seed and store it somewhere safe (a text file works).
  • After you set the client seed, the nonce (a counter that increments with each bet) resets to 0.

Why this matters:
If you let the casino pick the client seed, it could theoretically pair it with a server seed that produces a particular outcome. By setting your own, you break that correlation. The server now has to commit to its seed without knowing your random input.

3. Record the hashed server seed for the session

Before you place a single wager, the casino will show a long hexadecimal string labeled something like “Server Seed (Hashed).” This is the SHA‑256 hash of the server seed that will be used for the upcoming rounds. Copy this hash and save it. You’ll need it later to prove the casino didn’t swap the seed after seeing your bet.

Example of a typical hashed server seed:
8a7b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2

It’s critical to capture this before the round because once the bet is resolved, the casino reveals the unhashed server seed, and you must be able to confirm that hashing it with SHA‑256 produces exactly the same hash you saved.

4. Place a bet and note the round details

Bet any amount on a dice roll (or crash, or whatever) and wait for the result. After the round completes, the casino will expose:

  • Unhashed server seed - the raw string that was committed to earlier.
  • Client seed - the one you set (or the casino‑generated one, but you should have changed it).
  • Nonce - the counter for this specific bet (usually starts at 0 and goes up).

Write down all three values. Some casinos also display the game outcome (e.g., a dice roll of 52.31) and the formula they used. Keep that info handy for comparison.

5. Verify the server seed hasn’t changed

This is the “commitment check.” Take the unhashed server seed you just received and run it through a SHA‑256 hash function. You can use any online tool (search “SHA‑256 online”), a terminal command (echo -n "seed" | sha256sum), or a dedicated script.

Compare the resulting hash with the hashed server seed you saved in step 3. They must match character for character. If they don’t, the casino altered the seed after your bet, which is a red‑flag. Stop playing immediately.

6. Recalculate the game outcome manually

Now for the fun part: proving that the displayed outcome was deterministic and could not have been faked.

Common dice formula (used by BC.Game, Stake, and many others):

  1. Form the message string by concatenating the client seed, a colon : , and the nonce.
    message = client_seed + ":" + nonce
    Example: myRandomSeed123:7

  2. Use HMAC‑SHA256 with the unhashed server seed as the key and the message string as the data.
    hmac = HMAC-SHA256(key = server_seed, data = message)

  3. The HMAC produces a 64‑character hexadecimal string. Take the first 8 characters (some casinos use the first 5; always check their documentation).
    Example (shortened): b7c3a45f...

  4. Convert those 8 hex digits into a decimal integer.
    hex "b7c3a45f" = 3082543711

  5. Perform a modulus operation to get a number within the desired range (0-9,999 for a dice that resolves to 0.00-99.99).
    result = integer % 10000
    e.g., 3082543711 % 10000 = 3711

  6. Divide by 100 to obtain the final roll.
    roll = 3711 / 100 = 37.11

If the number you calculated matches the outcome shown in the game (37.11), the round is mathematically proven fair.

Worked example with dummy values:

  • Server seed (unhashed): serverSeedExample123
  • Client seed: playerSeedX
  • Nonce: 3
  • Message: playerSeedX:3
  • HMAC‑SHA256 of that message using the server seed as key (pasted into an online calculator) yields:
    d8e2a1b4c6f7a9e0b1c3d5e7f8a2b4c6d7e9f0a1b3c5d7e9f1a3b5c7d9e2f1a4
  • First 8 chars: d8e2a1b4 → decimal 3633316276
  • 3633316276 % 10000 = 6276
  • Roll: 62.76

For crash or other games the maths changes, but the core idea is identical: a known, auditable transformation of the HMAC output into a game result. Most casinos publish exact code snippets you can copy and run in your browser’s console.

7. (Optional) Use the casino’s open‑source third‑party verifier

If manual calculations feel tedious, you can often use an independent verifier. Sites like DiceSites.com offer a generic provably‑fair checker where you paste the three seeds and get the outcome. Just be sure the tool is genuinely independent - verify against your own manual check at least once to build confidence.


Common pitfalls and fixes

Even with transparent math, there are ways a player can be fooled or make mistakes. Here are the most frequent traps and how to avoid them.

1. Trusting the casino’s built‑in “verify” button without cross‑checking

Pitfall: A rogue casino can make its in‑game verifier show whatever outcome it wants, while actually using a different, hidden seed pair.
Fix: Always perform at least one manual verification using an external HMAC calculator. If the casino is legitimate, the results will match perfectly. If not, you’ve uncovered a fraud.

2. Forgetting to record the hashed server seed before playing

Pitfall: Without the pre‑bet hash, you can never prove the unhashed seed existed before your wager.
Fix: Take a screenshot or copy/paste the hash the moment you open a new session. Some casinos also publish the hash to a public blockchain (timestamped) - even better.

3. Neglecting to set your own client seed

Pitfall: The casino chooses a seed that, when combined with a pre‑computed server seed, gives outcomes that look random but are slightly unfavorable over time.
Fix: Every time you play, change the client seed to a long, random string you generated. This is the single most important step for true self‑custodial fairness.

4. Misaligning the nonce

Pitfall: If you play multiple games or the casino uses a nonce that doesn’t match your manual count, your calculation will produce the wrong number.
Fix: Always use the nonce displayed by the casino for that specific bet. Do not try to count bets yourself - backend‑side, some non‑game actions can increment the counter differently.

5. Assuming the house edge disappears

Pitfall: Provably fair proves the outcome wasn’t tampered with, not that the game is winnable long‑term. A dice game that pays 1.98x on a 50/50 bet still has a built‑in 1% house edge.
Fix: Read the game’s rules and understand the return‑to‑player (RTP) before you play. Fairness ≠ profitability.

6. Confusing on‑chain transactions with off‑chain seed verification

Pitfall: Some new casinos claim “provably fair” because they use a smart contract for payouts, but the randomness still comes from a hidden server seed.
Fix: Ask if the entire random‑number generation and settlement logic runs on‑chain in a verifiable contract. If only the deposit/withdrawal is on‑chain, you still need to do the seed‑based verification outlined above.

7. Not re‑verifying after a session reset

Pitfall: You verify one round and assume all subsequent bets are safe. The casino could change the server seed (or its hash) between sessions.
Fix: Each time you start a new session (or the casino rotates seeds), capture the fresh hashed server seed and a new client seed. Treat every session as a new verification task.


Related casinos

Vetted operators that offer genuine provably fair games can be found on our Casinos index. Among the most transparent are:

  • Stake.com - An industry leader with extensive documentation, open‑source verifier scripts, and the ability to change client seeds at any time. Their dice, crash, and plinko games are independently verifiable.
  • BC.Game - Supports over 100 cryptocurrencies and publishes all game formulas. The casino’s own verification tool is modular enough that you can inspect every step of the calculation.
  • Bitcasino.io - One of the longest‑running crypto casinos; while not all slots are provably fair in the classic sense, their own‑brand table games and dice are fully auditable.

Disclosure: Some links on our site may be affiliate links. If you sign up through them, we might earn a commission at no extra cost to you. This does not skew our recommendations - we only list casinos that pass our fairness and security evaluation.


FAQ

What exactly is a client seed?

A client seed is a random string that you (the player) provide to influence the outcome of your bets. Because the casino cannot predict the seed you will choose, it must commit to its own server seed before you bet. This two‑party input ensures that neither side can unilaterally control the final result.

Do I need to verify every single bet?

Strictly speaking, no - verifying a handful of random bets throughout your session is usually sufficient to catch foul play. However, if you are a high‑stakes player or just supremely cautious, verifying every round is the gold standard.

Can the casino still cheat if I use my own client seed?

Only if it can break the SHA‑256 hash (computationally infeasible) or if it secretly changes the unhashed server seed after the bet and presents a hash that also matches - but that would require finding a different seed that produces the same hash (a preimage attack), which is practically impossible. That’s why you must always check the hash linkage yourself.

Do blockchain network differences (TRC‑20 vs ERC‑20) affect provably fair verification?

For classic seed‑based, off‑chain randomness, the answer is a flat no. Verification is done on your local device using the seeds, regardless of how you deposited.
However, for fully on‑chain smart‑contract games, the network does matter. An ERC‑20 dice contract on Ethereum may require two or three transactions (commit, reveal, settle) that can cost tens of dollars in gas. The same concept on Tron (TRC‑20) costs a fraction of a cent and confirms faster, making it easier to verify interactively without bleeding money. The fairness underlying logic remains the same, but the barrier to entry differs.

What if the casino refuses to show the unhashed server seed?

Leave immediately. A legitimate provably fair casino has no reason to hide the seed after the round is over. Without the unhashed seed, you cannot perform the verification, so the “fair” claim is meaningless.

Can I verify provably fair games on mobile?

Absolutely. The same online HMAC calculators work in mobile browsers. The hardest part is copy‑pasting long hex strings, but there are even mobile‑friendly verifier apps for major casinos.

Is provably fair the same as being regulated?

No. Regulation deals with licensing, player fund segregation, and dispute resolution. Provably fair is a technical proof of randomness integrity. A casino can be provably fair but unregulated - or heavily regulated but relying on a traditional (unauditable) RNG. Ideally, you want both.

Frequently asked questions

How long does this process take end-to-end?

Depositing crypto: usually under 30 minutes. Withdrawals: 10-60 minutes after operator approval.

What if my deposit doesn't show up?

Wait for required confirmations, then contact operator support with the TX hash.

Can I reverse a crypto transaction?

No - irreversible by design.

Which network has lowest fees?

TRC-20 USDT and Solana are typically lowest.

Is this guide updated?

Yes - every 30 days. See the timestamp above.


Updated on a 30-day cycle. Last full re-check: .

Compare