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): 0x247784c61c2c85f8adf6390820e20dcece1ff86bef05045a1b96555926faf63f
clientSeed: 0xc118e629ac399fde6c63c655ba2f2d5fcb504a313a0a5978ff5261598f9409ce
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x9577c54dd639fe00a61365c2f0070d3718d159d72cbe94b6675704a7a51d32f4
clientSeed: 0xf12e999ddc0d6b452fd395c61c06135286b1ed5ba3cdd4e3d8e197cb128ca6a9
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: 0xc40c8e734e171ed2212e08af416f7757892842d49f52518bb9e1c10881b9f4ac
clientSeed: 0xef68b6861f4559a1ddcd703454f5e9010b1ab7a3c4dee8affd31081c737c38fd
serverSeed (revealed): 0xe1a0bc6119f4502f6443a7a70153f6b5273cccb0541d1da61e196a5dc1578a59
chainBlockhash (revealed): C4U2M4dfyoZ5h46Eif19L9ckhZARHc2ZYLbu7vneTw4a
chainSlot: 457758503
serverSeedHash: 0xf4d90843768f0096211e34421bcc31b9538acc01a476d3bcb9282a77dfe904df
clientSeed: 0xb02489c4c98a3eb2625f41e338cecfa246191e0176272411e6fe11981dbd9b0f
serverSeed (revealed): 0x0b094cfb565af4b277d04f607db7c3ad432807bfd002b01397294df510205572
chainBlockhash (revealed): 9d9Vknhor2CVaCPnv4LPPKyetVTf1c1q1NhWer3WxbLx
chainSlot: 457757103
serverSeedHash: 0x0d1a6a2b2fbe2cc20a4c919b760195afca08897a8e1abdbdf30dfcc219aab19b
clientSeed: 0xf05e8d1dd810a1e2f14a90167a3eccde62b7cf1a6dae5aaa3bcf3273f3276a24
serverSeed (revealed): 0x441a68307b1d5e730fba80904669fbc12f34f92dd9976eb6614d1cc2d0fd9483
chainBlockhash (revealed): 64hNoUcrMLj2qU4S4Qc5yQEiJuR5wURAGsthRbCRNCGz
chainSlot: 457755722
serverSeedHash: 0x207579e05fda38f1b98f21f9940931e07799f9cc8c7801fefc7dabae1386f141
clientSeed: 0xe086974fd89b5470853dc3842c8bca3e56577717b947392c96686a03e603d27c
serverSeed (revealed): 0x93eb340fb0008f373376c5e3ebc434ebf8bcb5575cb56098ddbaf2e38a42d572
chainBlockhash (revealed): GrtgZDPZDC16zkKQCcW7qTsN1ET4x8aKysrWpGYjndPj
chainSlot: 457754342
serverSeedHash: 0xc33b9f0bee1d8ef650e7bb0edf4590c78691858044925625a443267c625e5b5c
clientSeed: 0xb8c8332d08b5616c0490147064b45371d422143399f61ce507f2e26ba578c576
serverSeed (revealed): 0xf787a90d0005e8903de7e12396588a5452734073d236e86a22318bc1c8fb0a25
chainBlockhash (revealed): JD76oXAW4j5cLtrq62pq4eqg6xksetyfMxJ8roE1k71E
chainSlot: 457752951
serverSeedHash: 0x0910871ec4eb4bed91ca958152b038dbfe261e45c17b08d83b74b09bc9e8f545
clientSeed: 0xfa60a86eea02fa2eb54581650ec936d1f09605c6906ff5c942718539dfa466c1
serverSeed (revealed): 0x5f433b6866285cc688bb51b0ed64be3ecc670ecf8c503d7bcc86019446763d0e
chainBlockhash (revealed): 2qKNHR3fPLf4hFu92sgkFutznCFg3v7RiATqz6tKXFNP
chainSlot: 457751554
serverSeedHash: 0x331b50d3166e69e3a8d08472d7246b5be68a0b81aef27d871644bc85b24352a8
clientSeed: 0xf1131effccb350296c9eb5cc3415a4a6404ae2b12d4d76d2b9300f6a0e2ec202
serverSeed (revealed): 0x283dd92a3606d69701c3e3b144789d572ffc7510ae9c4c8d47029c880f133d12
chainBlockhash (revealed): 6fjtc2YmBB6CLJz4CtUcJYYxVq8mb2ZbFjTD4LFkR2E1
chainSlot: 457750171
serverSeedHash: 0x8dcc53a9b2db0314df10eb4558acb64e452de4bf46c364a46b520be9c4663af9
clientSeed: 0xb23aee2c034a4619d34bcc36cf027338c1ab56925a1f99babea19035bebb17da
serverSeed (revealed): 0x6b74bcaf90f51c42f98748d8be94734bc2416c6f7168d2a5ffb75044bcaa26c2
chainBlockhash (revealed): 7bCKJtREwjMC6eDqMob78L8cy43HmQyqSeXtG8aii7nX
chainSlot: 457748787
serverSeedHash: 0xd52d917637c0fee1c50b3ec5c6f835420182f942835b5efba1fc5625b7740bbe
clientSeed: 0x5d5f0ca0ecd3bef20aa8446f74c635d5dafa949ce7fe0ba90be36e0fbc7e4665
serverSeed (revealed): 0x003b6abe4598c8ff3903c165635638b3675b83acbb6a2a3ae116702dd691c820
chainBlockhash (revealed): FDCbJtFsJJ4ii1s1KKFRmKaPoWu9nrKFg9gn4BR1MWWm
chainSlot: 457747410
serverSeedHash: 0xb19944a7fbec8864659f274df7ca888c1c0177c9090f1a8674d16731eedc443d
clientSeed: 0x83f44ef04b794982d5407bdec2627fd0414efdd58e9cfe8139199723dd725836
serverSeed (revealed): 0xed0f862c706d032558917cc0a202dfa7fd6f0dd5d9ed05a1cee2d7a82e642393
chainBlockhash (revealed): 3SHY1Pk3J38DkMVjkssi93e4pqhu6eRUkAHCqkjyABDd
chainSlot: 457746033
serverSeedHash: 0x2b7c1750be2a8041b8b870727b2ace4629b0b21dee9c2f0fe096a7e350ddf6a1
clientSeed: 0xe23247a1490d56f3b94e35a7a89e1638afd20af4574c8df45163b02eb930301e
serverSeed (revealed): 0x92ca9b911ec99c1ba2df5f3e791a373fda6adbe425fdff7f5fbba055f8a519c8
chainBlockhash (revealed): 8qaz7KsgEFaAHDzDURQUDj3FDVkSMMwFUtJBaiEFczmv
chainSlot: 457746034
serverSeedHash: 0xe43e03f78b4bc51c2b4a6668717231b91e027950f6d783717a1d5cfc00bef826
clientSeed: 0x724f875926b77d3ca8d24790cb665210acd175f0a856a570e904899abeb6165a
serverSeed (revealed): 0x04fa6b89ad8bd55fcd6794cdab2412239ffe9e4508c10fa968c38e6c0a837a16
chainBlockhash (revealed): DCDhEr4dcnKyupNVEZx3bGD2gf29CswNTQZGN5Pe3jrG
chainSlot: 457744653