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): 0xe2b722330c54daa1face5d218b08ac3977a57696c959158aacf67e833a95ad98
clientSeed: 0xf310a5ffea60351fe90b82d94117b27e272be430fafca276c8dc418e37b2f120
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xf19029d823f49d75012be1f140aa4d5a57b02d7083b2c89bbae211eeada09f70
clientSeed: 0x2a695d46b7759970e38495afb64da46bcf78691dfc64ff3748b49163fc328cab
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd449f4dc8f4994cc7c58d5ee3451cc40a65f0076a822926c1139ddd40bea0bb3
clientSeed: 0x784fc8db8aa524dc91467d096b5b9c554b245854bd8a025f940d258928a9b57f
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1de14308e3055e32d9036594b402fa7d4b23e064f19f926e2e66b8e23301aa1a
clientSeed: 0x19af35baedda7731037af3be6faf601530cecb36afc236f3791b09e792b82184
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x291bacea843bee9ef7e269804eee803d10eb8f57d512675a88df00c090c9bb27
clientSeed: 0x9e03e6839401dc74f6a929f71e5ca7a156206971ca56b3f7cf81aac85157223e
serverSeed (revealed): 0xdb286779590655d7d7f718ecc04b4bc2fe6ac1acbe4e79e7b0fb382a1242cd40
chainBlockhash (revealed): HtssSd4nJR14dryTXpNTHtSL4RCXLfqnDoS8RDC7hMjB
chainSlot: 458361811
serverSeedHash: 0x2cfc3500a5d38b9b431d6282321ebb21c29b41e11ee5c505e68192e25215681b
clientSeed: 0xf156dc1504111cc5ffd4193f97d189af5579bb2e29ca2d641d2ddde316d340e5
serverSeed (revealed): 0x977f7842441d0d124944a82348f002d653296ec0e78a96396f4a77c9eafb10fa
chainBlockhash (revealed): 5V3AMx91gGYqp29AxWidXkzPG44xdvWsbZF18PgdaQFE
chainSlot: 458360430
serverSeedHash: 0xb24ad301eb1c7fa668a5eecdd428a3debbbdf890336228eabbc5c429699c7828
clientSeed: 0x292aa2bc5b5639455c31ba14352927d41047c62b345c73e384ca9d989f1dfec2
serverSeed (revealed): 0xbf6edefadbecd06a5a24eb252acfa9279aaa9a5f175a041f98a45373b866ad4c
chainBlockhash (revealed): HkuUnLCzYGhG2nmUFLgR8fRXhyW7PmQfxWR7WG2PAuCG
chainSlot: 458360429
serverSeedHash: 0x8d717f3e4a07f9539e24997b01e3ae5e5f4970c349abe1fba854a3dcff758e53
clientSeed: 0x71ebd129a9cbd70416f68760783d3e294e527e2b58840a1f033dc9364eb8feee
serverSeed (revealed): 0x6bb6fd76ff5f250fe38ba971535fb3d508801e7024eb823dd04ae71fc6fb9787
chainBlockhash (revealed): wH2A6chjHEWQhyCTmzDf62N8PGfshY13yGPL8i1hZRF
chainSlot: 458359046
serverSeedHash: 0xaf214829af1b22617a30765a6493408d8b8c20f223841e7eb46f200bb8807c31
clientSeed: 0x6ee4f500a87f1de99e26bf99acc3b97d2b3da50c84745ac1bb786ce04cfbc9f1
serverSeed (revealed): 0x9ce74aca17c0f2ec716fb6d78bd689b6425588bb38bcd7ba58f7660dd5a62599
chainBlockhash (revealed): 3XLDoCSWRM1aSxQRaYzxZ9SP4V3YXo9wPzj8FBDhWdWz
chainSlot: 458357672
serverSeedHash: 0xbbf8991b56aca8721ce13a0c02dccfa2549b3f91d5eb5aa910c5fddf4328ddba
clientSeed: 0xd61a5f0fb6403466ef633819a33dbc7481387ff501f6176ee7e584b532eb47ed
serverSeed (revealed): 0x1581b72776081d14fc9492918fce85ee6631fb49a7d4e6b4144953cb897e2a5a
chainBlockhash (revealed): 34v7t3cQec8ewSXkhkeuAaF8LK11HH1DCDYHvbuBErhj
chainSlot: 458356282
serverSeedHash: 0xcefe5a7e51ea42c9a92a897e0ff4e1d9ba723cde6174e807c87329456b3c4a76
clientSeed: 0x29b271acf0ac6d80e7134242e3b6de67d9e1086fd56397b1787cd3f0ec071850
serverSeed (revealed): 0xa705642abf6c9bbc4675df5462c8377725999d43e361a1f569dcdc798794f06c
chainBlockhash (revealed): A2QTD5oMsJSb9Lw29JJsfph9SuNPFmA9ATV3RoGiAsW3
chainSlot: 458354891
serverSeedHash: 0x4faae41b0c0a34e796ce508ec691c82bd8813df21578f7d353b084cfe7b46d17
clientSeed: 0x85367972459b3948cf20f28628265e6030d84b73b5ef699dc0ae3ef02e72547c
serverSeed (revealed): 0xe888f4a5a71351a394d3a380626553d9e8e1fb69aafcf352f3f70b39962e1686
chainBlockhash (revealed): h9SGayDig6ABRwSYr1Z9bVJHDuSUbggbAmkatn46hA7
chainSlot: 458353510
serverSeedHash: 0x6ad688c5e5897b86d33657288a9ea2fb257d623bb0bc133bfb1cab79bcb2a161
clientSeed: 0x93093f45d844b893dc3a4603e4baf9635a2bf92a9f54b0351ce01775321adaae
serverSeed (revealed): 0x63bd6734c71e630ee000429e630363050e1b1aa5840eb65362afb6ece08c6069
chainBlockhash (revealed): FScuuR9rp1vAqCcprqJiZs3YLHUo1ndewUCNrqq7H5au
chainSlot: 458352122
serverSeedHash: 0x1a988d3930cd78042bf8c361644382a1ba6105237402e254b193b28a0a53eab9
clientSeed: 0xf5a91c7954553c0913f88a76052ec33aacf55a0103aaa2d380057f66af06bded
serverSeed (revealed): 0xd1f520fb1ec9074747497308f5da723f116ea712e389fd7959a5e87ac7150db7
chainBlockhash (revealed): 8skVjwvvyn2b2uZdGzFAUM6YgHazmdPrRftbu6UVLquq
chainSlot: 458350739
serverSeedHash: 0x6dd16fa331273c084530a3b8793910afda4586e997683a51ba839fcd1e8da2fb
clientSeed: 0xee70f44c5b50d8e0b47df311848b9269f8b5bdedcd706d9d77b602b47aa46cc9
serverSeed (revealed): 0x1ed5a5fdb9e22e2c8a67ea0f30a8b0f9be177cb4185782c767a1f8c19b90de48
chainBlockhash (revealed): F9HD4Lpn6w8BfiMgD12rHkYMYhQp99Q7Yjy4mMYj2YSB
chainSlot: 458349354
serverSeedHash: 0x0f455dfcfb95dfc5808b446653c990ed6e4d54e175a7a53026179534900ebe40
clientSeed: 0x9f852efe9e997129dd481e2969becfaa6bdaddc91a50352476de25942b7087ae
serverSeed (revealed): 0x8ae38e3930f150a33255b4ba3657f9aa58c272cf5b6385146a5b3af1c75b0128
chainBlockhash (revealed): 8ZQ7ZUoHzL7SpwCCDVWZQ2HaaYxx3uAYBgUcFYukNAUW
chainSlot: 458347980