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): 0x2ebcac3c21292156a6d7e1614a8bbec70700e675acf5bf3cbaefab152f5a46cc
clientSeed: 0xab80ddb6d347711904b9280acf7df2ec94feb9b0a55f2019be12a4b66cbc7367
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xae3acf5452025039062ae4216fe9a6e8e91cdd04cb2acc1e2522a255391c8736
clientSeed: 0x83662ebb635e24f73c0ca56760d385448ab993cdb793d4fe0eac34dfa9960391
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: 0x5d8c523561ab5d677a342722647e3ff7558a50bb9e252698896136abd6f915c2
clientSeed: 0x0b874a4ac3050cb7e4005dc61c42eb5bd712263f019d8f77f4006ca9bb01cc46
serverSeed (revealed): 0xda444324fe24d4e232307a311b28caec278a74e45d31b70f55c3643ea005646d
chainBlockhash (revealed): oTJ3iefx7v81zHdwoTjBDwEJdYVGL4n6vBjQZeZUTXK
chainSlot: 457522387
serverSeedHash: 0x64b921beaa454fab1ceb5264e4d8dfd207052b88b51a7a55c74b5dffe2d62c88
clientSeed: 0xd2c1458b13ed3011dc481e77c49ccf4f23db7dfec120fad157f0dfb707b26425
serverSeed (revealed): 0x214fc8caa1300fa37990fe3c78a3978d8f37ab2f3e5dd3ce1b649c44101937b7
chainBlockhash (revealed): 6kXugNXar2KYdC3JmTdBKmcof7KvJHJ47LiivbKAn3a9
chainSlot: 457521005
serverSeedHash: 0xad3c102a6fc5a2cc0fef8b482134f466cd18e9e261f370456a89476e600ca153
clientSeed: 0x356ea6721d1a79e5f0ec7720a217e3ae1992cd7d9fab0bc2235902ba1f3ef669
serverSeed (revealed): 0x3c59286f6b8a91d90bd833370ff384b1e8a9843d8ef199604ba12a8dc45dacbd
chainBlockhash (revealed): 9GPpqRJhfeXC2uYG9r5ke9Lwm6PjszYSxe8otHVLkyb5
chainSlot: 457519607
serverSeedHash: 0xc989d912c4f4ffeda9eed632f68171adf33947065313e3188b5da84314066b77
clientSeed: 0x81a3a8d2014e048a98c50273717ac0a1abc00ad4df11ba9d5217069d1f324452
serverSeed (revealed): 0x13fe1ed9b10f50eea427061b00a8f6c5f50ba3a833018973e85e53bdff7a037e
chainBlockhash (revealed): BP9vwF3VKNWqqxQWntfxRvcyGUjhCNaVe9YdRBpWc7RD
chainSlot: 457518212
serverSeedHash: 0xc038537f27f6b418dcdf346f64e8a78d080e1bf15bf61a794281aba4b8cde31b
clientSeed: 0x0660ba4a39e6e9bf04d1e0af5c26a4d9989d205004f21d5ea2afe11f2e56c22a
serverSeed (revealed): 0x3ae15e61d676cfb7450dc5582bd49ffa12a36ede55d530a3d8049f1a22e9225c
chainBlockhash (revealed): GkNUdd3m9sEbnv2kmbP4LKUbSW44S38hMntJraQfd8sb
chainSlot: 457516821
serverSeedHash: 0xa98faf96eaf41c8fc5567450b214a30530b3fdd9992bb97938d6c292f379a5aa
clientSeed: 0x248820794c49524d29002f4e0d1980dec42df475638430224aa08b00f394979d
serverSeed (revealed): 0x843c9aa44e676a5ee48075046ec5c9ca50e4361581b7440c10d0883e34b29a4d
chainBlockhash (revealed): JjjpUSCB1JdfqZX8uFZPGXFTF7cWiumAP1uuLDVPJHT
chainSlot: 457515429
serverSeedHash: 0x1752ac173edda80c3d9b87ab077f84f6d0eed41a069b4b4fe011526df7627ced
clientSeed: 0x3f44b2a5cb9e64acf8151071e295b7f7bb3c8ca6a32d141c9b8edb12e3a35688
serverSeed (revealed): 0x49da1d7599dbf66fade595fc098970bf90830d2d1446902aebfc35b3c41909b6
chainBlockhash (revealed): 4FUE2KhG87skZkzRbA4br8fj83rgxjwcQExUhsz9V8FF
chainSlot: 457514047
serverSeedHash: 0x87225bd19f1a0628134566529e93d7f537e35515eeef245d24bab1e592c7f30a
clientSeed: 0x2c3459ca99f118ecf318c31e714af38675b69e76aa8b492bc06e23192350def6
serverSeed (revealed): 0xeb36d19ca908eda9c39711c4ce9369f80ae4afb435a23b587388df3b01971037
chainBlockhash (revealed): 3873fE57oFKWkGhvZexQk1ibgSvNYgDKCTzZYETJmh4u
chainSlot: 457512660
serverSeedHash: 0x0ddbd914a6c4ac982c32c12de079b96554e7ed93ca466203ec2d8b749caa0674
clientSeed: 0x8a1bbefe967cdab60af77a509fbf0ee753c3c753ff9bc3e5f4bbb81d7f7c66e4
serverSeed (revealed): 0xd4ebfa536c10a9a4ddfe444354c5230f291f8fad5a18d47ad547f7fc59730d2d
chainBlockhash (revealed): 7Ap437e6DTV56vPLnaMH4kA7zKYsWdeanAjEUMHS7ug4
chainSlot: 457512659
serverSeedHash: 0x18525a05b8bc56e518940be9b1e48c3324357da45929957b51d0e6cbe62370f5
clientSeed: 0xfa54ef5b3e8d31186b8c7fe1aed68c5d743f7b4ff4b63253ae8d21375d7b8ea9
serverSeed (revealed): 0xd527574359b284cff19b2b679f322548c6ceb352c24e914f0087957b6aa3257d
chainBlockhash (revealed): CsCED48qKm3aHrSBtsAUFpq3VbQMf9V3YGASNhnarxNh
chainSlot: 457511268
serverSeedHash: 0xa80570dd3dda1bc09b8c92790cce7f6a9bb749a2bcb41ec58b11514ccc792431
clientSeed: 0x59c1356bb0aebebe68341f1065b0344714fa839e9d31352c926d85c18553ba7c
serverSeed (revealed): 0xea93804eb86decaf3cb793c1f0fb7e8c01e9a1f37fdcb3156f433dba7c4b0960
chainBlockhash (revealed): gZX67PEn5Sg2d67mdEjg8hPBQAkCEES5cFNECnaaWAd
chainSlot: 457509887
serverSeedHash: 0x5e2cd9ec237c8b7e9e7dd63e52a45af4c215e3cccca02b0ac62f67a8ee8a7acc
clientSeed: 0xc47535f17d64853510c506a6011e567d1f3cc2e073f12fc8fe327b5a2390e0d8
serverSeed (revealed): 0x12c1d8f4578e8af7125b1c76d91f8bd8a2f1ab99e0d462752bb9c0a61d01c740
chainBlockhash (revealed): AYb2jP2Mk6DVx4Y2pGfbDqgGvZAidXH9uLYK3yS84iwq
chainSlot: 457508495