Verifiable Randomness Explained: How Developers Prove Results Aren't Rigged
Any application that produces random outcomes faces the same trust problem. Lotteries, online games, raffles, and loot systems all ask users to believe that the server did not quietly pick a convenient result. Users cannot see the code running on the backend, so a simple "trust us" is rarely convincing.
Verifiable randomness solves this by letting anyone check each result after the fact. A good real-world example comes from gaming: platforms such as BloodyCase publish their provably fair model at https://bloodycase.com/provably-fair, so players can confirm every outcome with the same cryptographic tools developers use daily.
In this article we will look at how verifiable randomness works, why it is built on hash functions, and what developers should watch out for when implementing it.
Why "Trust Me" Is Not Enough
Most programs generate random numbers on the server. The code may be perfectly honest, but from the outside there is no way to prove it, and that uncertainty damages trust.
The Problem With Hidden RNG
If the server generates a number and only shows the final result, it could theoretically run the generator many times and keep the outcome it likes. Even without bad intentions, bugs or weak generators can introduce bias that nobody notices.

PRNG vs CSPRNG
Standard pseudo-random generators, like the classic Math.random, are fast but predictable if someone learns their internal state. Cryptographically secure generators are designed so that future outputs cannot be predicted from past ones. Any system that involves real value should use the secure variety, but even that does not prove fairness on its own.
The Commit-Reveal Pattern
The most common solution is a commit-reveal scheme. It relies on one key property of hash functions such as SHA-256: it is easy to compute a hash from data, but practically impossible to find data that produces a given hash.
Step 1: Commit With a Hash
Before anything happens, the server generates a secret value called the server seed and publishes only its SHA-256 hash. This hash acts like a sealed envelope. The server can no longer change the seed without the hash revealing it.
Step 2: Mix In User Input
The user supplies a client seed, and each action increases a counter called the nonce. The result is calculated from all three values, often as HMAC-SHA256(serverSeed, clientSeed + ":" + nonce). The first few bytes of that output are converted to a number and mapped to the required range.
Step 3: Reveal and Verify
Later, the server reveals the original seed. Anyone can hash it, confirm it matches the commitment, and recompute every result. If even one number differs, the user has proof of manipulation.
| Component | Who Controls It | Purpose |
|---|---|---|
| Server seed | Server, kept secret until reveal | Main source of entropy |
| Server seed hash | Published in advance | Commitment that locks the seed |
| Client seed | User | Prevents the server from precomputing results |
| Nonce | Incremented per action | Makes every result unique |
Other Approaches Developers Use
Commit-reveal is simple and cheap, but it is not the only option. Depending on the project, developers may choose:

- Verifiable Random Functions (VRF) — produce a random value plus a proof that it was generated correctly. Oracle services offer VRFs for smart contracts.
- Public randomness beacons — independent networks publish new random values at fixed intervals that anyone can verify.
- Block hashes — easy to use in Ethereum contracts, but validators can influence them, so they are unsafe for high-value outcomes.
- Multi-party commit-reveal — several participants commit secrets, so no single party controls the final number.
The right choice depends on how much value is at stake and whether the logic runs on-chain or on a traditional server.
How Users Verify a Result
A good implementation makes verification easy for non-developers too. The process usually looks like this:
- Copy the published server seed hash before playing.
- Set or note your client seed and the nonce for each round.
- After the seed is rotated, take the revealed server seed.
- Hash it with SHA-256 and compare it with the original commitment.
- Recalculate the result using the documented formula and compare outcomes.
Many projects also provide an open-source verifier so users can run the check in their browser with a single click.
Common Pitfalls
Even a correct design can fail in practice. Watch out for modulo bias when mapping numbers to a range, never reuse server seeds, rotate seeds on user request, and document the exact algorithm publicly. Transparency only works when the rules are clear and reproducible.
Final Thoughts
Verifiable randomness turns fairness from a promise into something users can test themselves. With a hash commitment, a user-controlled seed, and a nonce, developers can build systems where cheating is detectable by anyone. Whether you are writing a game, a raffle, or a smart contract, adopting this pattern is one of the simplest ways to earn and keep user trust.