Rolling the Dice On-Chain: Trustless Randomness in Web3
Authors: Andreas Xydas (Twitter, Linkedin), George Sextos (Twitter, Linkedin)
Why Randomness Matters in Web3
Randomness refers to the absence of a pattern or predictable structure—something that feels truly spontaneous. We encounter randomness in countless ways in the real world, from the swirl of a fingerprint to the flip of a coin or the shuffle of a deck of cards. These chaotic, unpredictable elements play an essential role in how we ensure fairness, surprise, and variability.
But in the world of computers, true randomness is surprisingly difficult to achieve. By design, computers are deterministic machines: given the same input and environment, they will always produce the same output. This predictability is great for consistency, but it presents a real challenge when building applications that require unpredictability. Especially in blockchain environments where transparency and determinism are paramount.
In Web3, randomness becomes even more critical, since it’s the key to trust and fairness. But how do you introduce randomness in a trustless, decentralised environment where every node must agree on the outcome?
Unlocking Possibilities: Use Cases for On-Chain Randomness
A whole new design space for developers can be unlocked when randomness is generated securely and transparently on-chain, while ensuring users can trust the outcomes.
Here are some of the most impactful use cases for on-chain randomness:
NFT Minting: Randomness is used to determine which traits or rarity levels a user receives during an NFT mint. This ensures fairness in distribution and keeps speculation alive in collectible ecosystems.
Gaming Mechanics: From loot drops to dice rolls and battle outcomes, randomness powers core gameplay in Web3-native games. Players expect unpredictability to mirror traditional game design, but on-chain randomness guarantees it can’t be manipulated.
Lottery and Raffles: Transparent, tamper-proof randomness is essential for drawing winners in community raffles, giveaways, or lottery-style games where fairness is everything.
Generative Art: Artists can embed randomness directly into their smart contracts to influence colours, shapes, or patterns—creating truly unique, unrepeatable pieces every time an NFT is minted.
The Challenge of Randomness on Traditional Blockchains
While randomness is essential for many Web3 applications, generating it securely on-chain has historically been one of blockchain’s hardest technical problems.
Blockchains are deterministic systems by design: every validator or node must reach the same result when processing a transaction. However, it also means that introducing "true" randomness, an unpredictable value, without creating opportunities for manipulation is extremely difficult.
Here are some of the main challenges traditional blockchains face with randomness:
Predictability: Using public values like block hashes or timestamps makes randomness easy to anticipate or influence.
Validator Manipulation: Block producers can tamper with randomness sources to tilt outcomes in their favour.
Oracle Dependence: External providers like Chainlink VRF add cost, latency, and trust assumptions.
Because of these challenges, randomness in Web3 often became an off-chain afterthought, rather than a native, trustless part of the blockchain itself.
But this is where Sui changes the game, with randomness that is not only generated on-chain but also baked into the protocol’s design itself.
Sui’s Native Randomness: A Game-Changer
Sui recognised early on that randomness is a critical component for many Web3 applications—from fair gaming to secure NFT drops—yet traditional blockchains often rely on external oracles, introducing trust and complexity. Instead of following that path, it embeds native, on-chain randomness directly into the protocol. After all, if blockchain networks are already made up of distributed validators, why rely on an external network to provide randomness?
Imagine a room of people (the validators) sitting in a circle. At the start of the game (the epoch), they agree to each generate part of a secret number, but none of them knows what the final number will be.
Now, when someone walks into the room with a request (a transaction) and asks for a random number, each validator independently writes down a secret number on a piece of paper. They don’t see what the others are writing, and they can’t change their number later.
Once all numbers are in, they combine their pieces to form a single final number. This combined result is the random value used in the transaction.
Here’s why this works so well:
Unpredictable – No one knows the final result until everyone contributes
Unbiasable – No single person can influence the outcome
Fast – All this happens before the transaction executes, without slowing anything down
On Sui, validators do the same thing, using cryptography to generate randomness via Distributed Key Generation (DKG), initiated at the start of each epoch. During this process, each validator receives a share of a jointly generated secret key. When a transaction is ordered, validators use their shares to collectively produce a random value that is included just before execution. This ensures that randomness is fast, verifiable, and unmanipulable—securely embedded within the protocol without relying on any external system. Source , Source
Bringing Randomness to Life
Since the launch of native randomness on Sui mainnet, several projects have embraced it to deliver secure, verifiable outcomes across a variety of use cases.
Take Suigar, a fully on-chain gaming platform offering provably fair experiences like coin flip, dice, lootbox openings, limbo, and plinko. With fast and inexpensive single transactions, users can place bets, receive outcomes, and claim rewards—knowing the results are powered by trustless, protocol-level randomness.
Delorean Labs also leveraged Sui’s randomness to distribute prizes in its legendary Time Capsule campaign. By anchoring reward allocation to an unmanipulable randomness source, Delorean ensured a transparent and fair experience, showcasing how on-chain randomness can truly favor the user.
And of course, there’s DoubleUp, one of the most recognizable casino platforms on Sui. By integrating native randomness into its games, DoubleUp guarantees fairness for all players—eliminating the need to trust centralised servers or opaque algorithms.
Bonus: Take Fairness All the Way
When building provably fair games powered by on-chain randomness, transparency shouldn’t stop at the backend. Hosting your frontend on Walrus ensures that your game’s interface—the way randomness is revealed to users—is just as trustless and tamper-proof as the underlying logic. Projects like Wata and Cool-o-Cherries are already embracing fully on-chain deployments, creating experiences where nothing is hidden or modifiable off-chain. If randomness is your fairness engine, Walrus is your delivery guarantee.