The provably fair algorithm is the cryptographic answer to the oldest question in online gaming: how does a player know the operator did not rig the result? The answer is not a promise or a policy document. It is a commitment scheme built from standard hash functions, where the outcome is fixed before the bet and anyone can recompute it afterward. This is an engineering-grade walkthrough of how that scheme works — the seeds, the hash functions, the commit-reveal flow, and the steps a player takes to verify a round independently.
The trust problem in online gaming
In a land-based casino, the physics are the referee. A wheel, a deck, or a ball provides an outcome that neither the player nor the house can casually manipulate after the fact. Online, that physical constraint disappears: the result is a number in a database, and the operator writes the database. The game may be perfectly honest, but the player has no direct way to confirm it. This is a structural trust gap, not a personal one, and it exists even for well-regulated operators.
There are two established ways to close that gap. The first is independent certification: an accredited testing laboratory audits the random number generator and the game math, and a regulator licenses the operator. The second is cryptographic verifiability, where each individual round can be checked by the player against published data. The strongest implementations do both. Provably fair is the second approach, and to understand it you need to understand two primitives that predate the casino industry entirely: cryptographic hashing and keyed hashing.
Those primitives are standardized and public. SHA-256 is specified in NIST’s FIPS 180-4, Secure Hash Standard, and HMAC is defined in IETF RFC 2104. Nothing about a provably fair system is proprietary magic; it is applied cryptography with a specific protocol around it.
Commit-reveal: how the outcome is fixed before the bet
Commit-reveal is a two-phase protocol. In the commit phase, the operator generates a secret value called the server seed and publishes only its hash. In the reveal phase, after the round is over (or when the seed is rotated), the operator publishes the original server seed. A player can then hash the revealed seed and confirm it matches the commitment published earlier.
Why does this bind the operator? Because a cryptographic hash function is deterministic and pre-image resistant. The same input always produces the same output, so a revealed seed either matches the commitment or it does not. And given the hash, it is computationally infeasible to find a different input that produces the same hash, so the operator cannot wait to see the player’s input and then swap in a favorable seed. In effect, the operator signs a sealed envelope before the round and cannot change its contents afterward.
Importantly, the hash also prevents the opposite abuse. Since the server seed is hidden at commit time, the player cannot calculate the upcoming result in advance and bet only when it is favorable. The scheme protects both sides: the operator is locked into its seed, and the player is locked out of the outcome until the round resolves.
Server seed, client seed and nonce
A single secret is not enough to produce a fair outcome, because if the operator alone controlled all the randomness it could grind seeds until it found ones it liked. Provably fair systems therefore combine inputs from both parties plus a counter. The standard three-variable model is:
| Input | Who controls it | When it is revealed | Typical form |
|---|---|---|---|
| Server seed | Operator | Only after the seed is rotated | 32 random bytes (64 hex characters) |
| Server-seed hash (commitment) | Operator | Immediately, before play | SHA-256 digest (64 hex characters) |
| Client seed | Player | Always visible; editable by the player | Player-defined string |
| Nonce | System | Always visible | Integer that increments each round |
The client seed is the player’s contribution to the randomness and can be changed at any time, which prevents the operator from knowing the player’s input in advance. The nonce guarantees uniqueness: even if the server seed and client seed stay the same, incrementing the nonce produces a different outcome for every round. Together these three values are the complete, reproducible recipe for a result. The open-source provably-fair-app project on GitHub documents this exact three-variable model and provides a worked dice example, which makes it a useful reference implementation to read alongside this article.
How the provably fair algorithm hashes with SHA-256
The typical derivation is a keyed hash. The server seed is used as the HMAC key, and the client seed and nonce form the message. HMAC, standardized in RFC 2104, is a construction that combines a secret key with a hash function to produce an authentication tag. In a game context it is used as a deterministic, keyed pseudo-random function: without the server seed nobody can reproduce the output, and once the server seed is revealed anyone can.
Two different hash usages are involved, and it is worth keeping them separate:
- SHA-256 for the commitment. The hash of the server seed published before play proves the operator did not change its seed later.
- HMAC-SHA256 for the outcome. The keyed hash of client seed and nonce, using the server seed as key, generates the raw bytes that map to a game result. Some implementations use HMAC-SHA512 instead, but the structure is the same.
The resulting digest is a stream of bytes. A game then consumes those bytes and maps them onto its outcome space: a dice roll in a range, a card order, mine positions, a Plinko left/right path, or a multiplier in crash and Aviator-style games. The mapping function differs per game, but the randomness source is identical, which is why a single verifier library can often support many game types.
Video: how SHA-256 turns an input into a fixed 256-bit digest, step by step (source: YouTube / RedBlockBlue).
Step-by-step example with a real round
The following is an illustrative worked example computed from the inputs shown, so you can reproduce every line yourself with standard tools. It is not a production round from our platform; it is a demonstration of the arithmetic.
Inputs:
- Server seed:
d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2 - Client seed:
player-chosen-seed - Nonce:
0
Step 1 — commit. Hash the server seed with SHA-256:
SHA256("d1e2f3...d1e2")
= e2885f2c8169688374d0c54d6431a85b1c6dc0112259142f1e7674516abdde30
This 64-character digest is what the operator would publish before the round. It reveals nothing about the seed but locks it in.
Step 2 — derive. Compute HMAC-SHA256 with the server seed as the key and the client seed and nonce as the message, using the format client_seed:nonce:
HMAC_SHA256(
key = "d1e2f3...d1e2",
message = "player-chosen-seed:0"
)
= a103c485fcfe5c659e57f296a3a5074a98595b4c68c4d6db53d0d9ca41e27407
Step 3 — map. Take the first eight hexadecimal characters, a103c485, convert to an integer (2701378693), and divide by 2³² (4,294,967,296) to get a value between 0 and 1: approximately 0.62896374. A game would then scale that number into its outcome space. For a coinflip, for example, the value could be compared against a threshold; for a crash multiplier it could be transformed by the game’s payout formula.
Step 4 — reveal. After the seed is rotated, publish the server seed. Any third party can now run steps 1 and 2 and confirm both that the commitment matches and that the recorded outcome follows from the derivation. Different games and operators may use different delimiters, byte offsets, or mapping functions, so always verify against the specific published specification — but the commit-reveal skeleton is universal.
How players verify an outcome independently
Verification is a two-check process, and both checks are necessary. The first is the commitment check: hash the revealed server seed and confirm it equals the hash that was published before play. If it does not match, the operator swapped seeds and the round is invalid. The second is the recomputation check: feed the revealed server seed, the client seed, and the nonce into the documented algorithm for that game and confirm the output matches the recorded result. If the commitment passes but the recomputation fails, the operator left the seed alone but misreported the outcome.
A system that performs only one of these checks is only partly provably fair. The commitment alone proves the seed was fixed but says nothing about whether the reported result follows from it; recomputation alone assumes the seed is genuine. Together they cover the two realistic attack surfaces: seed substitution and result misreporting.
Verifier tools and what to check
Because verifying hundreds of bets by hand is impractical, most provably fair platforms ship a verifier, and independent open-source verifiers exist for common algorithms. Whether you build one or use an existing tool, the checklist is the same:
- Confirm the algorithm and delimiter match the operator’s published specification (for example
client_seed:nonceversusclient_seed-nonce). - Confirm the hash function used for the commitment (usually SHA-256) and for derivation (HMAC-SHA256 or HMAC-SHA512).
- Confirm how bytes map to outcomes for the specific game, including any byte offset or cursor.
- Confirm the seed was rotated and the correct server seed was revealed for the rounds being checked.
- Run the verifier client-side, so the check uses only public inputs and does not depend on the operator’s servers.
For operators, treating the verifier as a first-class product feature — documented, deterministic, and independent — is what turns “trust us” into “check us”.
Edge cases: seed rotation, nonce reuse and who controls what
Most real-world disputes come from edge cases rather than from the core math. Seed rotation is the most common: the server seed can only be revealed safely once it is retired, because publishing a live seed would let players compute future outcomes. That means verification is naturally retrospective — you verify a completed chain of bets after rotating to a new seed. A well-designed system shows the commitment for the current seed and lets players reveal and check previous ones.
Nonce handling is the next trap. If a nonce is ever reused with the same server seed and client seed, the same input produces the same output, which is both a fairness problem and a transparency problem. Nonces must increment reliably and, in a concurrent system, atomically; a race condition that reuses a nonce is a genuine bug, not a cosmetic one. Client seeds are the third variable to reason about: players should be able to change them freely, and doing so starts a fresh outcome chain for that seed pair.
Finally, be precise about who controls what. The operator chooses the server seed and cannot change it after committing. The player chooses or accepts a client seed and can rotate it. The system increments the nonce. No single party controls the full input, which is the entire point. Any implementation where the player’s input can be ignored, or where the server seed can be regenerated after seeing the client seed, is not provably fair regardless of how it is marketed.
Provably fair versus certified RNG: what regulation says
Provably fair and certified RNG are complementary, not substitutes. Certification is an independent audit: a testing laboratory reviews the random number generator’s source, seed generation, and statistical output, and confirms the game behaves as designed. eCOGRA’s RNG certification process, for example, covers source-code review, statistical analysis of output distribution, seed generation, resistance to prediction, and periodic retesting. Labs such as iTech Labs perform equivalent RNG and game-math testing across regulated markets. To see how those certified return figures translate into commercial decisions, read our operator guide to RTP, house edge and volatility.
Provably fair adds a player-level audit trail on top of that. Certification asserts that the system is statistically sound; commit-reveal lets an individual player prove that a specific bet was not manipulated. Regulators typically still require the certified RNG layer, because certification is the mechanism they recognize and can enforce, while provably fair strengthens trust and dispute resolution. For a technical operator, the sensible architecture is both: a certified RNG foundation for compliance, and a provably fair layer for transparency.
That transparency also pays off elsewhere in the compliance stack. An auditable, tamper-evident outcome log supports the transaction monitoring and account controls described in our guide to KYC and AML in crypto crash games, because every round has a verifiable record rather than an opaque log entry. If you are designing the surrounding infrastructure, our explanation of what a remote gaming server is shows where the RNG and seed logic sit, and the full picture is in our RGS architecture guide. For the vocabulary, see the entries on randomness and hashing in our iGaming glossary.
Frequently asked questions
Is a provably fair algorithm truly random?
It is deterministic given the inputs, which is a feature rather than a flaw: determinism is what makes independent verification possible. The output is unpredictable before the round because the server seed is secret and the client seed is player-controlled, and it is uniformly distributed when mapped correctly. Certified RNG testing still matters for statistical quality; provably fair adds verifiability on top.
Can the server cheat?
Not undetectably, provided the protocol is implemented correctly and both checks are performed. Changing the server seed after committing breaks the commitment check, and misreporting an outcome breaks the recomputation check. Any single party that controls all inputs could bias results, which is exactly why the client seed and a reliably incrementing nonce exist.
How do I verify a round?
After the server seed is revealed, hash it and confirm the digest matches the commitment published before play. Then recompute the outcome using the documented algorithm with the revealed server seed, your client seed and the round’s nonce, and confirm it matches the recorded result. Use the operator’s verifier or an independent open-source one, ideally running client-side.
See how our provably fair engine works
Provable fairness is an engineering standard, not a marketing line. If you want to review the commit-reveal flow, the seed lifecycle and the verification tooling behind our games, our team can walk you through the docs and the code-level detail.
How our provably fair system works · Explore Coinflip · Contact us