A provably fair casino game publishes the SHA-256 hash of its secret server seed before any bets are placed. Later the casino reveals the seed, and players recompute each result from that seed, their own client seed and a bet counter. If the recomputed results match, the casino kept the same seed throughout and could not have changed an outcome mid-round. The house edge stays as it is, and only the casino's in-house games get this check (tech-insider.org developer guide, tech-insider.org casino guide).
The inputs and the commitment
Each bet draws on three inputs, according to the casino guide:
- Server seed. The casino generates it and shows players its hash before play. The developer guide draws 32 random bytes for it and publishes
SHA-256(serverSeed)as the commitment. - Client seed. Players can change it.
- Nonce. The casino adds 1 to it with every bet, so each bet under the same pair of seeds produces a different result.
The casino reveals the server seed after play. In the developer guide, the reveal happens when the player rotates to a new seed, and every bet placed under the old seed becomes checkable.
From seeds to a game result
The developer guide turns the inputs into a result in three steps:
- It computes HMAC-SHA256, keyed with the server seed, over the message
clientSeed:nonce:round. Each HMAC yields 32 bytes. Theroundcounter starts at 0 and goes up when a game needs more bytes than a single block holds, as a card shuffle does. - It reads four bytes as a base-256 fraction:
b0/256 + b1/256² + b2/256³ + b3/256⁴. The result is a numberfbetween 0 and 1. - It maps
fto the game:- Dice:
floor(f × 10001) / 100, for a roll from 0.00 to 100.00. - European roulette:
floor(f × 37), for a pocket from 0 to 36. - Crash:
0.99 / (1 − f), rounded down to two decimals, with a floor of 1.00x. The 0.99 reflects the guide's default 1% house edge.
- Dice:
A worked example
Suppose the first four HMAC bytes for a bet come out as 200, 16, 64 and 128. The conversion gives:
f = 200/256 + 16/65,536 + 64/16,777,216 + 128/4,294,967,296 ≈ 0.78149799
Each game mapping then uses the same value:
- Dice multiplies by 10,001 to get about 7,815.76, then rounds down to 7,815 and divides by 100, for a roll of 78.15.
- Roulette multiplies by 37 to get about 28.92, for pocket 28.
- Crash divides 0.99 by 0.21850201 to get about 4.5309, which rounds down to a 4.53x multiplier.
Anyone holding the revealed seeds can repeat this with any SHA-256 library and compare the output against the bet history.
Checking a round after the seed is revealed
- Before betting, copy the hashed server seed the casino displays.
- Choose a new client seed.
- After rotating seeds, hash the revealed server seed with SHA-256 and compare it with the copy from step 1. A mismatch means the casino swapped seeds.
- For each nonce, recompute the HMAC and the game mapping, then compare each result against the bet history.
How much bias the number mapping adds
The developer guide warns that taking a raw byte modulo the number of outcomes skews results. The figures below count the inputs mapped to each outcome under each method:
- Roulette from one byte,
byte % 37. A byte has 256 values, and 256 = 6 × 37 + 34. Pockets 0 to 33 each get 7 byte values and pockets 34 to 36 get 6. That gives pockets 0 to 33 a probability of 7/256, about 2.73%, against 2.34% for the last three, which makes them 16.7% more likely. - Roulette from four bytes,
floor(f × 37). Four bytes have 2³² = 4,294,967,296 values, and 4,294,967,296 = 37 × 116,080,197 + 7. Seven pockets get a single extra input out of about 116 million, a skew of about 0.0000009%. - Dice from four bytes,
floor(f × 10001). Here 4,294,967,296 = 10,001 × 429,453 + 7,843. The 7,843 favored rolls get 429,454 inputs each against 429,453 for the rest, a skew of about 0.00023%.
A verifier confirms the casino ran its published mapping. To judge the mapping itself, a player has to read the formula and count, as above.
Where the house edge comes from
The developer guide applies the house edge in the payout formula and leaves the random number unskewed. The crash formula shows how this works out. A multiplier of m or higher requires 1 − f ≤ 0.99 / m, so its probability is 0.99 / m:
- Cashing out at 2.00x wins 49.5% of rounds. Each unit staked returns 0.495 × 2 = 0.99 on average.
- Cashing out at 10.00x wins 9.9% of rounds, and the average return is again 0.99.
Every cash-out target returns 99% of stakes on average. A provably fair check confirms the formula ran as published and leaves the 1% edge in place. The casino guide makes the same point about odds.
Provably fair seeds, certified RNGs and on-chain sources
Third-party slots and live games at the same casinos use certified RNGs instead (casino guide). Labs such as GLI, iTech Labs, eCOGRA and TST audit those RNGs on a routine basis, and casinos usually show the certificate in the site footer (next.io). The developer guide describes a GLI-19 or eCOGRA seal as evidence that an auditor checked the RNG at a point in time.
Games running as smart contracts take randomness from an oracle. Chainlink VRF generates each value with a cryptographic proof, and the chain verifies the proof before any consuming contract uses the value. Its docs say an adversary would need both the VRF secret key and the ability to build blocks on the target chain to strongly bias a result (Chainlink VRF docs).
| Method | Number comes from | What gets checked | Checked by, and when |
|---|---|---|---|
| Provably fair seeds | Casino server seed, player client seed, nonce | Revealed seed against its hash, then each recomputed result | The player, after the server seed rotates |
| Certified RNG | Casino or game provider RNG | The RNG, through lab audits | A testing lab such as GLI or eCOGRA, on a routine schedule |
| VRF oracle (Chainlink) | Oracle key applied to each request | A cryptographic proof for each value | The chain, before the consuming contract uses the value |
| QVRF (Quip) | Measurements on quantum hardware | A Merkle proof for each value against a posted root, then an audit of the measurements | The dispensing contract at delivery, then an off-chain audit |
QVRF for on-chain games
QVRF, Quip Network's randomness service, lists gaming and lotteries among its uses. A game contract requests random words and receives them later through a callback (QVRF docs). Before delivery, Quip's oracle posts a Merkle root covering the round's words on chain. The dispensing contract checks every delivered word against that root and rejects words already spent (on-chain randomness post). Afterwards, a sample of the raw quantum measurements is re-simulated on classical hardware and scored with cross-entropy benchmarking, and a Toeplitz extractor condenses the audited samples into near-uniform bits (quip.network/qvrf).
The first version of QVRF has these limits:
- Centralized. Quip operates both the oracle and the trustee. Splitting those roles is in development (quip.network/qvrf).
- Operator influence. The oracle reads a round's words before posting its root and can decline to publish it. The trustee decides which committed word serves which request (on-chain randomness post).
- Delayed checks. The audit of the quantum measurements runs after delivery, not at the moment of delivery (QVRF docs). On-chain verification contracts will let a contract check a transcript directly, and they are in development (quip.network/qvrf).
- No lab certification yet. quip.network/qvrf names no testing-lab certification for QVRF.
- Not a VRF. Despite the name, the docs describe QVRF as a physical randomness source with a verification record. The standard VRF security definitions do not apply to it.
The docs also say the request interface and fee model are still being finalized.
Next step
To weigh QVRF's trust model against a game's requirements, read the QVRF docs, then request access at quip.network/qvrf. The post on provably fair NFT reveals applies the same commit-before-reveal idea to NFT collections.
