On-chain randomness with Sui VRF for iGaming
Blog

On-Chain Randomness Explained: Sui VRF for iGaming

Suigar Team10 min read

Randomness is the load-bearing wall of every casino game. Flip a coin, drop a Plinko ball, spin a wheel: the entire experience depends on an outcome nobody can predict and nobody can rig. The hard part has never been generating a random number. It has been proving that the number was fair and untouched, especially when the house is the one generating it.

That is the problem on-chain randomness solves. Instead of a casino producing a secret seed on a private server, the randomness comes from the blockchain itself, complete with a proof anyone can check. On the Sui blockchain this is built into the network through a verifiable random function, so casino games can draw fair outcomes without ever asking players to trust a hidden input. This article explains what a VRF is, how Sui VRF works, and why it beats the old server-seed model outright.

It is written for operators and builders who need to understand the primitive they are relying on, but the explanation stays plain enough for any curious player to follow.

What a verifiable random function is

A verifiable random function, or VRF, is a cryptographic tool that produces two things at once: a random-looking output and a proof that the output was generated correctly from a specific input. The output is unpredictable to anyone who does not hold the secret key, yet once it is published, anyone with the public key can verify the proof and confirm the value was not cherry-picked. You get unpredictability before the fact and verifiability after it.

That combination is exactly what a casino needs. Before the round, neither the player nor the operator can know the result. After the round, everyone can confirm the result was the honest output of the process and not something the operator substituted. A plain random number generator gives you the first property; a VRF gives you both.

How the server-seed model used to handle this

The previous best practice, still common on crypto casinos today, is the server-seed scheme. The casino generates a secret server seed, publishes its SHA-256 hash as a commitment, combines it with a client seed and a nonce, 3 inputs in total, then reveals the seed afterward so you can recompute the outcome. The full mechanics are covered in the guide to server seed, client seed and nonce. It is a genuine improvement over a sealed black box, because you can at least verify that the revealed seed matches the earlier commitment.

The unavoidable weakness is that the server seed is still born on the operator's own machine. You can confirm the reveal matches the commitment, but you never see how the seed was generated, and you have to trust the operator in the window before the reveal. The seed is the one ingredient you cannot independently source, and it sits entirely under the house's control.

How Sui's native randomness works

Sui takes the seed out of the operator's hands entirely. The network provides randomness as a native feature: a decentralized beacon produces fresh random values that smart contracts can consume directly during execution. Because the randomness is generated and recorded by the network rather than by any single party, there is no private seed for a casino to manipulate. The details are documented in the Sui randomness reference.

In practice, a game contract requests a 256-bit random value when a round is being settled, applies its fixed rule to turn that value into an outcome, and writes the whole thing to a single public transaction in roughly 390 ms. The randomness, the outcome, and the payout all land on the ledger together. There is no separate off-chain step where a seed could be swapped, because the contract consumes randomness the network supplies in the same execution.

Speed and cost make it practical

On-chain randomness is only useful for casino games if it is fast and cheap, and this is where Sui matters. The network finalizes transactions in roughly 390 milliseconds for fees under $0.01, so drawing a 256-bit random value and settling a bet happens in close to real time. The properties that make randomness trustworthy no longer come at the cost of a playable experience.

Why on-chain VRF beats a server seed

The advantage is not subtle. Every weakness of the server-seed model traces back to the seed living on the operator's server, and the on-chain model simply removes that ingredient. There is nothing private left for the house to control.

  • Source of randomness: a server seed is generated by the operator; an on-chain VRF value is produced by the network, outside any single party's control.
  • Trust assumption: seed schemes require trusting how the seed was created; a VRF requires trusting only public, checkable math.
  • Verification timing: a server seed must be revealed before you can verify; an on-chain result is verifiable the moment the transaction confirms.
  • Tamper surface: a private seed is a manipulation point; with native randomness there is no private input to manipulate at all.
  • Record permanence: a server-side log can be edited; the on-chain randomness and outcome are public and permanent on the ledger.

How this compares to Chainlink VRF

The concept of bringing verifiable randomness on-chain is not unique to Sui. On other networks, Chainlink VRF popularized the pattern, providing smart contracts with random values plus proofs through an oracle service. It is the canonical reference point for what a VRF does in a blockchain context, and it proved the demand for tamper-evident randomness in gaming and beyond.

The difference on Sui is that randomness is a native network feature rather than an external oracle a contract has to call out to. That means fewer moving parts, no separate request-and-callback round trip, and randomness that is available inline during execution. The guarantee is the same family as Chainlink VRF; the integration is tighter and the latency is lower, which matters for fast-settling casino games.

Why predictability is the real threat

The danger in casino randomness is rarely that a number fails a statistical test. It is that someone with privileged access can predict or influence the outcome before it is locked in. A server seed is the textbook example: whoever generates it knows it first, and that head start is precisely what players cannot rule out. Predictability, not poor distribution, is what lets a dishonest house tilt the odds.

A VRF attacks this directly. The output is unpredictable to everyone, including the operator, until it is produced, and the proof guarantees it was not selected from a menu of pre-computed options. When randomness is consumed inline during the settling transaction, there is no moment where any party sees the value early enough to act on it. The threat model that haunts server-seed systems simply does not exist.

What this means for operators

For an operator, native on-chain randomness removes an entire category of liability. You do not run an RNG, you do not manage seed rotation, and you do not have to defend how your randomness is generated, because you are not the one generating it. The contracts behind Suigar games were audited by MoveBit on 2025-11-10, so the randomness and settlement logic carries a third-party signal. For the broader build picture, the Sui casino software overview ties the randomness primitive to the rest of the platform.

It is also a marketing asset. "Randomness comes from the chain, not from us" is a claim a server-seed casino cannot make, and it is exactly the assurance a crypto-native audience responds to. That single property anchors the pitch behind a white-label casino on Sui: verifiable randomness turns fairness from a slogan into something you can point at on a block explorer.

Where players see the difference

All of this cryptography would be academic if players could not feel it, but they can. On a native-randomness casino, every settled round links to a public transaction showing the random value, the outcome, and the payout together. A player does not need to understand VRFs to benefit; they just need to know that the result they saw is the result recorded on a ledger nobody can edit.

That visibility is what converts a technical guarantee into trust. The same property that lets a developer reason about the randomness lets a skeptical player confirm a single bet in a block explorer. The primitive and the player experience point at the same record, which is exactly why on-chain randomness is more than an engineering preference.

Implementation checklist for builders

  1. Understand the randomness source. Read how Sui exposes native randomness to contracts so you know what your game is consuming and what guarantees it carries.
  2. Consume randomness at settlement. Request the random value inside the transaction that resolves the round, so the outcome and randomness are recorded together.
  3. Apply a fixed, public rule. Map the random value to an outcome with deterministic logic that is identical for every player and every round.
  4. Emit clear events. Publish the outcome and payout as events so players can verify the round in a block explorer without reading raw state.
  5. Lean on audited contracts. Build on infrastructure that has been independently reviewed rather than reimplementing randomness and settlement from scratch.

Frequently asked questions

What is on-chain randomness in simple terms?

It is a random value produced by the blockchain network itself rather than by a casino's private server. Because the network generates and records it, no single party can predict it beforehand or alter it afterward.

What is a VRF?

A verifiable random function produces a random output, on Sui a full 256-bit value, together with a proof that the output was generated correctly. The result is unpredictable in advance and verifiable after the fact, which is exactly what fair gaming requires.

How is Sui VRF different from a server seed?

A server seed is created by the operator on their own machine, so you have to trust how it was made. Sui's native randomness comes from the network, removing the private seed entirely and the trust gap that comes with it.

Is Sui randomness like Chainlink VRF?

The guarantee is the same family of verifiable randomness. The difference is that Sui provides it as a native network feature rather than an external oracle, which means tighter integration and lower latency for fast-settling games.

Is on-chain randomness fast enough for live games?

Yes. Sui finalizes transactions in roughly 390 milliseconds for fees under $0.01, so requesting a random value and settling a bet happens in close to real time, fast enough for interactive casino play.

Can an operator predict or manipulate the outcome?

No. Because the randomness is produced by the network and consumed during the same transaction that settles the bet, there is no private input the operator controls and no point at which the outcome can be substituted.

Do players need to trust the operator at all?

Not for fairness. Players can verify the randomness, outcome, and payout directly on the ledger. The remaining trust, around things like interface and support, is separate from whether the games themselves are honest.

The takeaway

On-chain randomness solves the one problem the server-seed model never could: it removes the private seed the house controls. A verifiable random function gives you unpredictability before the round and public verifiability after it, and Sui delivers that natively as a 256-bit value settled in roughly 390 ms for under $0.01, fast enough and cheap enough for real-time casino games.

For builders and operators, that means the fairness of your games is no longer something you assert. It is something the network enforces and anyone can check. That is the strongest foundation a casino can stand on.

Sources and further reading

Sui on-chain randomness, Sui documentation.

Verifiable random functions, Chainlink VRF overview.

Smart-contract audits, MoveBit.

Sui platform documentation, Sui docs.

Gambling involves risk and is intended for adults only. Operators are responsible for compliance, age verification, and responsible-gambling practices in every market they serve.