Provably Fair
Every game commits first, then rolls with entropy from the Solana chain. Here is exactly what that does and does not protect you from.
How a round actually runs
- Commit. When a lottery round, duel lobby or case battle is created, the server generates a secret
serverSeedand publisheskeccak256(serverSeed)straight away, next to the publicclientSeed. For duels and battles this happens before an opponent even exists, so nobody can pick a seed that targets a known player list. Lottery rounds commit before a single ticket goes on sale. - Close. Entries lock: lottery buys and sells stop at the closing tick, a duel needs both stakes in, a battle needs both players matched. Case battles also freeze a copy of the case's drop table at match, so later case edits cannot touch a battle already running.
- Entropy. Only after the inputs are locked does the settlement worker fetch one Solana blockhash and persist it together with its slot. Battles fetch theirs at match because the live per-round reveal starts there. The fetch only accepts a slot strictly newer than the chain tip recorded at commitment, so a game created and matched inside a single slot waits for the chain to move. A blockhash from after the commitment cannot be known at commitment time, which is what breaks seed grinding: the operator can try seeds all it wants, the final input has not happened yet.
- Derive and reveal. The outcome is one hash over
serverSeed,clientSeed, the chain blockhash and the game id. At settlement everything is revealed: the seed, its published hash, the blockhash and its slot. You can re-run the math yourself in the verifier below and check the blockhash on any Solana explorer against the published slot.
What we can still do, stated plainly
- The worker that fetches the blockhash is ours. It keeps trying until a value lands in a slot newer than the commitment, and exactly one fetched value is written with the settlement claim, so it cannot be quietly swapped afterwards. Attempts that fail or land too early simply retry, and a compromised or dishonest server could still time or retry that fetch. That is a single point of infrastructure trust, and no purely server-run scheme removes it.
- Your account, your balance and the payouts live in our database. If the whole stack is compromised, fairness math will not save you. What this design removes is protocol-level steering: grinding seeds, re-rolling after seeing entries, or adding tickets once the draw entropy is known.
- Rounds settled before this upgrade (visible in the reveal: no chain blockhash) used only the two seeds, and are still verifiable with the legacy formula.
Formulas
Winner-take-all lottery draws:
target(tier, attempt) = uint256(keccak256(serverSeed || clientSeed || [chainBlockhash] || drawId || tier || attempt)) mod totalTickets; winner(tier) = first entrant whose cumulative ticket count exceeds target; the single tier-1 winner takes the whole pot (legacy rounds paid up to 4 tiers; collisions with an earlier tier re-derive with attempt+1). Rounds settled after the chain-entropy upgrade include the 32 raw bytes of the revealed Solana blockhash (base58-decoded) between clientSeed and drawId; legacy rounds verified without it leave that segment out
Duel coin flip:
winnerSide = uint256(keccak256(serverSeed || clientSeed || [chainBlockhash] || lobbyId || 0x01 || 0x00)) mod 2; side 0 = lobby creator, side 1 = opponent (join order); rake = floor(pot * 0.5%). Duels settled after the chain-entropy upgrade include the 32 raw bytes of the revealed Solana blockhash (base58-decoded) between clientSeed and lobbyId; legacy duels verified without it leave that segment out
Case battle drops:
value(round, slot) = uint256(keccak256(serverSeed || clientSeed || [chainBlockhash] || battleId || round || slot)) mod 10000; drop = case dropItem whose cumulative weight range contains value; slot 0 = creator, slot 1 = joiner; winner = higher cumulative drop total; exact tie splits the pot after rake; winner takes the pot minus 5% rake, not the opened items. Battles settled after the chain-entropy upgrade include the 32 raw bytes of the revealed Solana blockhash (base58-decoded) between clientSeed and battleId, and derive against the drop table frozen on the battle at match; legacy battles verified without it leave that segment out and use the case's current drop table
Seed commitments
serverSeedHash (commitment): 0x49045c0ba5b6275f6b39dbc2b42c5bdf8732a4738c4f85d84022f89c8cd7dc61
clientSeed: 0xd8a5f9c754db8cb0fbc51553d9ebb0a8d23a0f004187e065dc00da4b14d4b515
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x2ef09591eb786361648bd499f23731fef37ff84a10c11c8fa5d02e2900e89252
clientSeed: 0x9e9b9d63918c1d75b35b1d96b1c3e46b82c90311dcd3858af1d63fb0c61609be
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x24d5e14176236ff7fcb2d4db69870149192d8369adf799313bff22ad8d10f7ef
clientSeed: 0xe7ee2dd6d3bc1b68ccb2f80429ab27cbe9d8c0870cb67e94d0f69f68444a4120
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): n/a
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
chain entropy: not yet, arrives with the draw
serverSeedHash: 0xffa67fdd6bfcc8ddb062b227c096a15af762f2bec6c684a29066ef5bb8e2034a
clientSeed: 0x44ae4ead7ef0b13bc063c029a28391f54d2de7314e85de1ae8d2bd5ca3d0cca9
serverSeed (revealed): 0x27b39aefb68452adce24ca6b9f0141d723afcef4f44f6e5eeb38252452c73499
chainBlockhash (revealed): EMFwtT9Zeq4mkmSYAVyTGhpaAsuGCU21MmRTD9csAMZb
chainSlot: 457594797
serverSeedHash: 0x16f7bb99812835ff154b28e2c1ec96b6ebd4de12cf2221393229417687a0bdcd
clientSeed: 0xe6f0f18fe13b1ba6120568860da618a9d99f075179109ea2147261c5835a72ef
serverSeed (revealed): 0xa0713feaeceeefbc21bb41a0593e2c91217fd011f5d80e3345cec5b46aeafe7d
chainBlockhash (revealed): 83VygQTm27zRPkaEtRaqqSnwgtjuR8foLzYxQrbLDDyT
chainSlot: 457593406
serverSeedHash: 0x0cd724173f183b6fee3234aa0bfa3e80924c86ff5f5377298516f224d70908c1
clientSeed: 0x93f41e597fc0716d9954442772e09c02b691b3039e4ea2563e84912e40cab979
serverSeed (revealed): 0xe081746475502a2703f8886defb02526496e2e148f14f78a4824f3b3106ea086
chainBlockhash (revealed): 3vqdRmLbrWdxCfFitMDXoB5Fq8wRP6uMeLRDNKWQtEfu
chainSlot: 457591996
serverSeedHash: 0xc41d5288491d94cd2e44593141087c8771d933887507138269ffdad8540d9be1
clientSeed: 0x47e831298d0faa70d43c89ce96150309383c5f84aa4a6d1a458fe854d6c32044
serverSeed (revealed): 0xba4024b13f6030e15a1f8c232630ed8919b360e6e32fbf2d584c4ba09cb6fd96
chainBlockhash (revealed): 7sUGkHazdzkQnL3ijnywaUjUdbaK28BFy8HBQc4Ur2aZ
chainSlot: 457590607
serverSeedHash: 0x4f8b802014492ffc44a5bf9c1033f5443080dc96e33041d81512560c68e5d7ad
clientSeed: 0x9eec447a8664f273ba66a15805099da85884bed1eb79616969256c2eaac6517a
serverSeed (revealed): 0x986c617d7c4968a796e72998443adcc52de7aa8f1ce4494190f448f6b741ddb5
chainBlockhash (revealed): GL8vvfoRdiFBayKPJ9NVhqCGa1u9eT7qcnikSwN5zYFi
chainSlot: 457589228
serverSeedHash: 0x6ea5af53df69dd025f5c3dad2e937d10cd11b0a5155f2717079b70f39e7c8e9b
clientSeed: 0xc9b91417892eab90fc085c63317f8aa81f117321e417a3f63a225b9534543353
serverSeed (revealed): 0x5849b7a841b505fe26630421413112ad4a58401d5cc4e18a5f3557d4cee5c47a
chainBlockhash (revealed): 84uhGq8pdQfzzySRVNA127Zf5NpMV2eSDQsNV6umLV8C
chainSlot: 457587822
serverSeedHash: 0x3a94a763d5dcf8c7a58d9e1245c29e801222430728597b9f7e936970159b416f
clientSeed: 0x6172b3ad2a08f803984ef46db96e3719e3daf4336f4e5ba86aa79b1b7b9ea49a
serverSeed (revealed): 0x9a6d898cd47adc7a972de483cc5013024bc953ed0cc74c3d0da3b64f528b759a
chainBlockhash (revealed): AftNjCxqukMJUnGwcDnnPEfyR2PqXLtQwSk44FD6H61d
chainSlot: 457586420
serverSeedHash: 0xc2837e20e5fa5916ec27066404c973e1c2f26aa1b2221db66ea66ae5910cb02b
clientSeed: 0xffc83805388cc608283733e3060a2b9922b6065a825794cfaba4dc857022f760
serverSeed (revealed): 0x3ba74c8982f3d49676189d19991661b4ce48708f388e450184eb855d49bc11d1
chainBlockhash (revealed): FSnNGhCUpru884puWw739QdpQx3SZUXMqKJUNue9wMTL
chainSlot: 457585037
serverSeedHash: 0x12518518a759ef19bb27a27a87666b6cb5447aa3ef62ce2fb5e79765b0bd6c7c
clientSeed: 0x763039b504209def5118b3869a94e28a8714a070be40eef386bfac3b9c0b866d
serverSeed (revealed): 0x634bb6027b441984f85a429b3a357fcc6a550f2bbb8f06d0496110d79d9a1520
chainBlockhash (revealed): 6P5XF1LA4N4H2dzoxT63B2An2ao9HkfHH7tJ4VwDKSGj
chainSlot: 457583647
serverSeedHash: 0x8115b6d429cce02d36c8a8cd57f100b907153d57f8cc4a0723b66c75c22757b7
clientSeed: 0xb9c649453f5c67865ed5fd520c9ec1212a4b9aba34c1eb413e77b6c160d91130
serverSeed (revealed): 0x2a2fa4432cc1c402d5ef51a6e243072d782c09b41555196dde0501281fa7a57f
chainBlockhash (revealed): EWfYx7uyBG52p6GLCuFX8NnxZd79874TUVF5axLVB1m9
chainSlot: 457582255
serverSeedHash: 0xb4909d0c2a84f25314c890a0a2f58a45fa48418cca27a23de0a599fdec220382
clientSeed: 0x9401ff3744b0a6537e643f54c76936983d69bdeaa07215a64ac11233769c3907
serverSeed (revealed): 0x97a6499b904dcaa2b5fe596cc7b8a84808945eee80daf696633e3cd0f0c8eb45
chainBlockhash (revealed): 7EsEtSpeSE2My8ubP9WjoXUPdDq4wkHMihHcPeFT3z3p
chainSlot: 457580851
serverSeedHash: 0x31bda280aeb254fe606aafaed4037b02249a3034e8f17c4986cb9eeac965a8bf
clientSeed: 0x650d82e473d4f4963cbae41a4a0840ec46a63c2e501752708ed9a7340ae811e0
serverSeed (revealed): 0x5d0d4d824db3ce99800a8379f97b3d00814fa4ba7eb983ce0954779320ba6fc2
chainBlockhash (revealed): 8P7qNp6cfGiwKhzHUFvhrZnL18QYm9eLxQqpEvMEQXMH
chainSlot: 457579447