How Provably-Fair Casino Games Work
'Trust me' is not a fairness model. Provably-fair gaming replaces blind trust with cryptography you can check yourself, and this is the deep dive: the exact protocol Llamabet runs, from seed generation to a BLS-signed commitment frozen on the Sui blockchain to the recompute-and-compare loop that proves any outcome was honest. If you want the plain-English overview first, read our provably-fair casino explainer — this page is about how the machine actually works, step by step.
Open the verifier →Step one: the house commits before anyone bets
Everything starts with a server seed — a long random secret generated on the house side. On its own a secret seed proves nothing; the trick is what happens next. The seed is run through SHA-256, a one-way cryptographic hash function, producing a short fingerprint that reveals nothing about the seed itself but changes completely if even a single character of the seed changes. That fingerprint is then published to the Sui blockchain before any bet is placed against it. On Llamabet the commitment is not a tweet or a database row: a Move smart contract verifies a BLS signature from the house deployer key and freezes the hash into an immutable on-chain object. Frozen objects on Sui can never be modified or deleted, so the commitment is timestamped, signed and permanent. From that moment the house is locked in. It cannot regenerate the seed, tweak it, or quietly swap it for a friendlier one, because any substitute would no longer match the published hash.
Step two: you contribute a client seed
A commitment alone leaves one theoretical attack open: if the house knew every input to the game in advance, it could grind through candidate seeds until it found one that produced a losing deck for you, then commit that one. The fix is to make the outcome depend on something the house cannot know when it commits — your client seed. Before play you can set your own client seed to any value you like. The final game hash is derived from the server seed plus your client seed plus per-game data such as a round counter, so the house would need to predict your contribution before freezing its commitment, which it cannot do. You do not need to be clever about the value; randomness is not required on your side. What matters is simply that your input enters the math after the house side is already locked on-chain.
Step three: hash bytes become cards and rolls
Combining the seeds produces a fresh hash — a string of bytes that is unpredictable in advance but fully deterministic after the fact: the same inputs always produce exactly the same bytes. A public algorithm then maps those bytes to game outcomes. For blackjack, Llamabet builds a fresh four-deck shoe by walking through the hash output and using each byte as an insertion position in the growing deck — a deterministic shuffle that any independent implementation will reproduce byte for byte. For roulette the hash bytes reduce to a pocket number; for dice, to a roll. The crucial property is that there is no hidden randomness anywhere in this step. Randomness enters the system only through the seeds; once they are fixed, the entire shoe is fixed. The dealer's hole card, the card you would have drawn had you hit, the next five cards behind it — all of it was determined the instant the seeds met, before the first card hit the felt.
Step four: rotation, reveal, and the verification loop
Server seeds are not immortal. Llamabet rotates them on a schedule: a new seed is generated, its hash is BLS-signed and committed to Sui, and new games run against the new seed. Once a seed is retired it can be revealed without compromising any future game — and that reveal is your moment. Verification is a two-step loop. First, hash the revealed server seed yourself and compare the digest to the commitment frozen on-chain before your bet; if they match, the seed in your hand is provably the one the house was locked into. Second, feed the server seed, your client seed and the round data back through the published derivation and confirm you get the identical deck, pocket or roll the game showed you. If both checks pass, the game was honest — mathematically, not reputationally. Llamabet ships a self-serve verifier at /poker/verify that runs this loop in your browser, so you never need to write code to audit a hand.
A worked example, end to end
Walk one blackjack hand through the pipeline. Before your session, the house generated a server seed and froze its SHA-256 hash on Sui — an object you can look up on any Sui explorer, with its creation time attached. You set a client seed and bet 1 SUI. The backend hashes server seed plus client seed plus game data, walks the output bytes to build the four-deck shoe, and deals: you catch two cards, the dealer shows a seven. You play the hand out with hit, stand, double or surrender, and the result settles to your wallet on-chain. Later the seed rotates and is revealed. You paste it into any SHA-256 tool: the digest matches the earlier on-chain object exactly. You run the public shuffle with the same three inputs and out comes the same shoe in the same order — including cards you never saw. Every card of that hand was fixed before you clicked bet, and you have now proved it independently, with no permission from the house.
Why neither side can cheat
Run through the attacks. Can the house change an outcome after seeing your bet? No — the seed was committed to an immutable, BLS-signed object on Sui before the bet existed, and any replacement seed fails the hash check. Can the house pre-select a hostile seed? Not usefully, because your client seed enters after the commitment and scrambles any pre-computed result. Can the house simply deal from a different deck than the committed one? Only by producing outcomes that fail your recompute — detection is guaranteed for anyone who runs the loop, which is exactly why honest operators publish the algorithm. On the other side of the table: can a player predict the next card? No. That would require the unrevealed server seed, and SHA-256 is one-way — recovering a seed from its hash is computationally infeasible. The scheme is symmetric in the best way: the house cannot cheat after committing, and players cannot see the future before the reveal.
What provable fairness does not protect against
Honesty about limits builds more trust than hype. Provable fairness guarantees one thing: the outcome was not manipulated. It does not remove the house edge — a verifiably fair blackjack game still carries roughly a 0.5% edge against perfect basic strategy, and a fair roulette wheel still takes its 2.70% or 5.26% depending on the layout. It does not shield a bankroll from variance, and it does not stop anyone from chasing losses; set a session limit and never wager money you cannot afford to lose. It also does not secure your keys — self-custody means wallet hygiene is on you. What it does close is the one risk unique to casinos: the rigged game. On Llamabet that risk is not managed by reputation or a regulator's stamp. It is closed by mathematics that anyone, anywhere, can check.
Frequently asked questions
What is a server seed and client seed?
The server seed is a secret the casino commits to (as a SHA-256 hash frozen on Sui) before your bet and reveals after rotation. The client seed is a value you set yourself. Combined with per-round data, they deterministically produce the outcome — and because you control one input after the commitment is locked, the result cannot be pre-rigged against you.
How do I verify a Llamabet bet myself?
Two steps: hash the revealed server seed and confirm it matches the commitment published on Sui before you bet, then rerun the public derivation with the server seed, your client seed and the round data to reproduce the exact deck or roll. The in-browser verifier at /poker/verify automates the whole loop.
Why publish the hash on a blockchain instead of a website?
Because a commitment is only as strong as the place it lives. A hash on the casino's own server could be quietly rewritten after the fact. On Sui the commitment is a frozen, BLS-signed object — timestamped, immutable and outside the house's control, which is what makes the guarantee real.