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): 0xa57b3fa63074b47420b9d7151743e40c460e8be2b3fb4fac0f74fd50c22e70e9
clientSeed: 0xb8974bef0d3c6d79c31601533b7288c5b1b13f2a8d1ee898c200e2ded4afd2ca
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x71f502bb32569cba6c909d4d97eade6bed7a6182307c9349a636e2705920ded4
clientSeed: 0x77c3cdae831d602b70e58033be6ef1d301ac9d9d912e031cbeceb3544d272c42
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): n/a
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd141a9cdbb4df966a65cb0c74863245d48c910c0b171cf2afd18e7f0c1bc3214
clientSeed: 0x5131b2aa68e920aacc3e9368129b70d342ce7bc6b0dab05039d62e1b63f33b81
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x095a80f2e9230e204b3376272b000932d128b1e27ba6aea4bd61f73743fc71ad
clientSeed: 0xc368609772787587448d93dee182a2e34dbeefc924f5e312ade8e5a9e8f9d6f6
serverSeed (revealed): 0x1f46b37bb6debcc316e3aa60de0f81ba8da64f9661c1cff32bcb046d319c46c4
chainBlockhash (revealed): AnDp4uvU9B2vcYrbXL9MnJXoXVContc8k98sT44yozw2
chainSlot: 457995552
serverSeedHash: 0xa8b32724de44b23f6f0b4fef0790df45a228304e268f63057adde4444c8d8fb2
clientSeed: 0x5301815281079302d18d8a1defacac9b4fd9f00b6928e87373e580ae8a9cd144
serverSeed (revealed): 0x7407d729bd6d2b62bd82f7e0fc2cadbb449b3ed3e6815d5c568381acef47a539
chainBlockhash (revealed): AnDp4uvU9B2vcYrbXL9MnJXoXVContc8k98sT44yozw2
chainSlot: 457995552
serverSeedHash: 0x3771d90755ca610df411e98d6c194f547c5899ab0b7184e4ae446eecc4f2028d
clientSeed: 0xb5e88039f72c630c3df1deb92d7b1a9d80759f92b86727e7a990f8842b39c575
serverSeed (revealed): 0xd9344016d6e170efe3e65202e74c022d4a4ff8c9c64d20ce12ab3faf2e9dc603
chainBlockhash (revealed): C3XgxptpEKGKS1sgLsfmkgQwoGcouphhuyK9UTr1awxg
chainSlot: 457994168
serverSeedHash: 0xd99c377f2ea22d54a32569c7c427c15a0bf6204838938eed1ae3d04fc4979d54
clientSeed: 0x6779c02e9beb073f84a6cd069eb1fcba1597b7005c523c7a07aa3eac67356bdc
serverSeed (revealed): 0x4b27e38c6bcbc25abd59996959fe567427291f26458d16b98978577c4364461c
chainBlockhash (revealed): ATsuw4JW5qChT5vXVJuiXUwuuqnUg7XmV2qxkbkZPxnG
chainSlot: 457992805
serverSeedHash: 0x571f8716ee90ef6b4ef64b67f2bf9721723809ae73e696d00d762d81c81280a2
clientSeed: 0x6e855a1aa907c299a66ad2618b2e9c3c0d7dd92030e186641931d0f9642fb891
serverSeed (revealed): 0x95179b20cbeaca5d83077a00617c61b42e4df011a2f5860d3fc835b7df72eb48
chainBlockhash (revealed): DNPVaDAXcL27kFnZBerdLG2YPVzvN3oaCLzx3T9zFJ7K
chainSlot: 457991416
serverSeedHash: 0xe69cbbe6596809e73179386a54ba8f1b2f112e9b1cb970e97200270346daaf1d
clientSeed: 0x8442d7a1f1ccea1cb50a9a28d89ebbf0769cb0f68c976681f3bfbce3709afb2b
serverSeed (revealed): 0x4a889b4ed0d6a26e36b84673f71801e642935502eaf73964b9f8188de24af68c
chainBlockhash (revealed): CRVjUZrXa9cDAo76sYECeMgvL1x3YgH5KHEC6Wf94Mrx
chainSlot: 457990027
serverSeedHash: 0x9b172c7f9e2a43d61392c591b2048fa0e26e499a218e88a5935e5dfc85d14aa0
clientSeed: 0xb62f2f7c8560172589646ed32e24c15a3aeb2e6b6745303bc9b7304f73f6da50
serverSeed (revealed): 0xde9f7f68cb160c4b3db2341ce3596cd625bb097c642ee9e419838467da315b16
chainBlockhash (revealed): 3JbZcJzvi8YLtkybGzFPPedrsYrRSMERTEVBAfJ6DRH3
chainSlot: 457988646
serverSeedHash: 0xec39030d041c3456aa9ffd6d0287b0755944d19c464b256567197d0db71247ec
clientSeed: 0x5c9de61deec90ac665026689169b51e21a4c83facfdfe6e58c930d933f1fd2bb
serverSeed (revealed): 0x6d7ad58e7d96fbde1ab2939d7e53d54b779c08876dd73d98510b292cb1b12252
chainBlockhash (revealed): BxcLszUH4A7tTyNZFFqZQ9z7aR8wCe9vZwn5jFrtvEWz
chainSlot: 457987260
serverSeedHash: 0xc231521ac975f66d4d9b81fcad20e5fdd8a6fa5a709795dafdb0883ac6807ee5
clientSeed: 0x213637c47bef4eaced20c933d77c9db0c97c2aab94000815a3269fe072fae0cf
serverSeed (revealed): 0xf3f992a2e2a832fcd7750f162f7b080d8907b0f436a845450c82dd5523669376
chainBlockhash (revealed): 6wbjuB2W9r7om4J6BXzXVwvhvz9HNpEkQrTUNzYkTPHi
chainSlot: 457985876
serverSeedHash: 0x4c767446e74c273f3023fb3085269a01ebe3335e887cd357486734029bdd6427
clientSeed: 0xc4fef56ce34ed42507194b25ecef99bc64a92be04a5b79a32c3ab0a5896a2976
serverSeed (revealed): 0x6987f2a0e077106290d6723c147ae6d5c1a92c213deb755c4121a460c5d033a0
chainBlockhash (revealed): A4zTC1rGbBxjHHJf9FE9EDEjge3kSDdpuqc68fC5PS1X
chainSlot: 457984502
serverSeedHash: 0x9c615d650903dd7b6a09b48464b2625155e95f45623d101232bab27181ad0259
clientSeed: 0xb37ddb7dadd99f6ebdb9f404e3a2cec9de00a4fceb1d83b78f8f6a17c8c5020c
serverSeed (revealed): 0xa974c193dff1208ef2522db3e0e32b61bf54621e7d3a491054783ca97bbfcb61
chainBlockhash (revealed): BWJPN6TYMmWB3BkZZE1NupZMPe5XxotqymffGN7nsXe8
chainSlot: 457983115
serverSeedHash: 0x9bcdcee6444d180c538f1ab37ccc637c0f09ece509560883578dd56bfad32be8
clientSeed: 0xd437d3127aab30662c61f1f3d4688a49c8eb4c2e3fa08e6768adf171eee8f5b9
serverSeed (revealed): 0xee58a62a4e6e0081f9fabe283e8daaa67a3769ce1dab3d16e81a8a304380dfbc
chainBlockhash (revealed): AvvbjnDogXiUe72i9HzjEeYKCPQxwcRQTExpVQgpun9w
chainSlot: 457981745