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): 0xdd835a151e3b49771de9d6ab158a1e64bd0ffda3f0bf0513556966e801cf8a4a
clientSeed: 0x46d82fa8bee5fff0238a04202df938b7fcdc02cb5ecf3a087627d8d0d60e83a0
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xa34e4c067c65a1a743684318911105f1414a7f1957bea79f971e3a678a0c6208
clientSeed: 0x9fe23b269985f76ed190cc88607e05bc903a24ff889007af8ca292d7a442ff33
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: 0xa56e7608c36d4a45d8a4697e894a7b592ae93aaeef27456904972d99ad110a38
clientSeed: 0x3c79539edb3ff1fa824353bad881ee73107050d23a7f00ec6ebf1be5b6f66f33
serverSeed (revealed): 0x062dee7495258bbfc986a23c979dde3e4f7c96372e507743df6642e91ddb0d4c
chainBlockhash (revealed): 6BkshMNmAcrL2zkzfLY6psydWM41sfzDsSekFG7vRmjj
chainSlot: 457712865
serverSeedHash: 0x5b53c9dc1b93187cb820a2c24cab17da75fe06cd10ba812e6c1ba7b3389922a9
clientSeed: 0xb22e4f203276978eb672301e500aa418f8eb357c97d0be588ff1491e05c3e962
serverSeed (revealed): 0x528dc285b832b724eec137d4025ea35ba59b1a365589043e7411ce8ad63b0198
chainBlockhash (revealed): 8QEEM3ZcVpG3zCc4xKmxYTD8bmkwbG1HUmGPQZi9Txmc
chainSlot: 457712864
serverSeedHash: 0xeae1d4e658e00244276e06569ffa8a6ff74ed8437003920105e6fe92b10d5002
clientSeed: 0x1ee5fa0d9cf0a4627e3d3013af825f0884c726252d3cdd114f7e391a0513c1e8
serverSeed (revealed): 0xd4dfcb42eeb2924a1a613f54121d1f12dab380db32011c7084ea92db13a3c612
chainBlockhash (revealed): 2gHbYTFqugW485LoUNjn4i2vLYc46MGDHxB6z3kgvStw
chainSlot: 457711507
serverSeedHash: 0x9d7a1ff624c1caa04dfae89a2f25d2e94fcbcfb26f6411704bd17c1809ad9061
clientSeed: 0x6c2e1d34e31630ea379f253216d5c2869157fa2b190f10d632815e1f15568b07
serverSeed (revealed): 0x7be00d14d89a08c211cad0a89a637896bd56dbb4e61f4e84ced9272ecc8994b6
chainBlockhash (revealed): E8CDVHKg4pTsWnimQCXDCZZc1wCG1VsvU6naUprkcXJA
chainSlot: 457710119
serverSeedHash: 0x9c660ae786b45864b5452a2a10c23608e02761962751e30e5e1f627b6ce72fca
clientSeed: 0x3fb9c5e1cde5694a476fa16b3aa0537d174d0eb13d9837f92270e602906197fd
serverSeed (revealed): 0xa6e15954dcc577ef128099ffeaa8ab2a597b93e466b763062fd5f9d7f0a060ab
chainBlockhash (revealed): 7UWnTpZ8JRnAtozU7fCoBuTJLZPmbALW26Y2K3CwyDbb
chainSlot: 457708737
serverSeedHash: 0xc0600f94410ab83f3c5c15a9e56de7c773fa0cca3ad67b5adc33cf2d7c5ed7e7
clientSeed: 0x04610945d8adb01c45d6a21622b16e9142b904feec8d20dcaad588060a026e98
serverSeed (revealed): 0xe0cada3b3a36bd5ec9ac023811613a676f4232db6c8dab9dc26d48c1e19bfa5a
chainBlockhash (revealed): 87HyqtX62uQdRXgkzXatHN6suKtc3tVGGpb56U98xUr8
chainSlot: 457707364
serverSeedHash: 0xef873e5017ad3d76dd960f45a22bef494e839504a02291013f7ea835c1b11323
clientSeed: 0x9d4d943cd94a9cb44df5297d3a6079c056c8c9b45954402ec726b4fa1f241d22
serverSeed (revealed): 0xc868ef9d00b1392cf7784dc6b7b82f1ef1336eddd3a53fc9bd7eec3bdd358411
chainBlockhash (revealed): 3DQ17x9iQuGQ8B4fZMVQLHKjb8UsvEnbtBjVtoVB3PVR
chainSlot: 457705968
serverSeedHash: 0xc321d09dd9a5cab222feb0955413dade05a3e805348871db819b84fd866328c9
clientSeed: 0xdbdcde42cdc5a66bd57838e3f9e124b42a8f86ca93efce84d16742abf1de6fcf
serverSeed (revealed): 0x02a6f0f708dcb15ee56fd52d1cb5e7a8bd8d943023ec7912b44971df7a447581
chainBlockhash (revealed): 4bs2yGdxjKcCbKtwWXM7nqwfashjQSgUxSYRzq334oqF
chainSlot: 457704593
serverSeedHash: 0x5f11b124a097e059f39b911b257c17c2e111ab4e317c653a24ea0d9958395c2c
clientSeed: 0x6b0566d2613fd2f1455ee12a13ad71c43a4b1601efbecb3d473ef41c78760e36
serverSeed (revealed): 0xd1b601f3fbf0c487e58b115ea79f4e37a632b69b8cd5831c8c2c0de33e95716e
chainBlockhash (revealed): 5STaf92Zof3hKQByG3czgiSU7nWH3SV7XMoipfpunefZ
chainSlot: 457703206
serverSeedHash: 0x03c457d7ed0951bc3442cb6963a0b83a64554ca10311646fa6a3587fddade67c
clientSeed: 0x999136646488fd73100a8b5e4864f53f49a1d4881f85782df2c44e12d0e4aae3
serverSeed (revealed): 0xa88a4cb30aab863d64cae8265496292b274be6e632e0cc3d565825a53f033a24
chainBlockhash (revealed): 5HwKQ6vFyrs8K1nHMQvxYFtKQfwwVdxuEBp5v9sXCDE3
chainSlot: 457701792
serverSeedHash: 0x1d51dac977055e6d28329185711f342b96733d059dcd68957fadc2dcbce3bdec
clientSeed: 0x8247d4e6d54cdae8fdcea4ac04270364b7370f0a31b890f51e35fd4b670d91b1
serverSeed (revealed): 0xc8cbb30f4a385596a6b35ce38cb6c8377b4901d82d8d21865f47459450e05f41
chainBlockhash (revealed): 3kNz7x4dGhzJZ9wjfcRE49qBz3U2gi8D6jcsVE7UJWYT
chainSlot: 457700406
serverSeedHash: 0xde027738f223a396722823f8b171bbf822cae85de44873677d5b1bce977e76b0
clientSeed: 0x1c2dd5f1c8267defe03b4955ee371ebd94583d7427b3c98b15f72bd7bc553240
serverSeed (revealed): 0xfe6fdd52899ab522864784e0a433e5b465f663b97d9085e851b7fa5df4fc4c11
chainBlockhash (revealed): 8pD55jrMbim1xUzAXVArNYmF39VFk3jXRoY2wBBWfRp6
chainSlot: 457699029