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): 0xdf12ff71fc3a864799749bf629bed37a68ea2058598d39e66b7747a1fa243335
clientSeed: 0xf6ca80533cfa53af0d380aa011ecf4c0dcd4238434a9771ba8474cacd7d7055d
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x81b43adb287e03f56236f7feb8e0ed6da460baee4260037871d21284413e776e
clientSeed: 0xc88dd9cfc5d2e98c9bf329ea4dd486c40a9da124a39813e27633eef09ab1cef8
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: 0x1b390d16ba3b13ae9f3235cbbff97850664058af233085195d6233495570f7bb
clientSeed: 0x92c29d4a876a9f8da5f013d7c5c3bd8fa7e5f3d7266a2d4c598730f039b75142
serverSeed (revealed): 0xccb5fb5458726e179e15719357a1b8c1d50587b7a717f24edaa214f781c70958
chainBlockhash (revealed): E9cwtBQgByYYPX8j28rMVQGpZ1s3uQmQJVsZt6kay6eF
chainSlot: 457530734
serverSeedHash: 0xe0073dfa11c5938471eec60d497f148b8f6bc4127ee8e8ae145f2a957f07cb38
clientSeed: 0x94538d7480c2c069471ba9901ae76c383e8fc98b3b94c8a285beafa9c77c5a1b
serverSeed (revealed): 0x97e7532b25b2ffa07f910cbdd1c132a58510e5377f9804ca6177178e2bfd80f9
chainBlockhash (revealed): DU4dnwCUYvuF5VtZ6euRfSN7fXNCZhHQjHXizFfdorXJ
chainSlot: 457529340
serverSeedHash: 0xae3acf5452025039062ae4216fe9a6e8e91cdd04cb2acc1e2522a255391c8736
clientSeed: 0x83662ebb635e24f73c0ca56760d385448ab993cdb793d4fe0eac34dfa9960391
serverSeed (revealed): 0xf6539b419ff5e37190a179a977dd39d45a5aad5d0b961dbefbd91ae85ecf2c94
chainBlockhash (revealed): DU4dnwCUYvuF5VtZ6euRfSN7fXNCZhHQjHXizFfdorXJ
chainSlot: 457529340
serverSeedHash: 0xaaa88d6002c9f6592ae48e30e25830113afb1307e58039cb62789d14a0444be7
clientSeed: 0x8a6ee858ce0ffcd65e6f8e1233049b8ba72a4773ccb85ba347f04652f7058568
serverSeed (revealed): 0xa5c3912a7b4fb2d39a0879abc64e541d102b8c1e9e246992590e7ac8283da05f
chainBlockhash (revealed): DGf26MmSYjSuda3vTiRzfdHBzRuWmtKtFQMEe7PDqwgZ
chainSlot: 457527935
serverSeedHash: 0x8b4bb09c8361b86ebcbfdd3b62a7e69e1b40ca71bd0afb85f30677659b6c006d
clientSeed: 0xd83d721ea83a12db2fdd8af4f724d548afceac329068c832f3b0cc028509866b
serverSeed (revealed): 0x2a0e42615c97a3888c8f00189fd8d65b7d4a71eb27c3655db906b4aae6358474
chainBlockhash (revealed): 75jZ31zLGyEJqZAm2aqCHSsZjrj8k28m4VCLoM7pqQKZ
chainSlot: 457526549
serverSeedHash: 0x2585337ccb8eaabefd2f78ad481649e0c8f98e95b64f1eee231f23b01ed7bc5a
clientSeed: 0xb7dd26737b9960d8490e7637afbd3d0173eebc3b0fe5a2841249f90fc3c10df4
serverSeed (revealed): 0x418cbc43caa7936e3ef68346cf0107278feb84abb04e271a35a357d9793b22bf
chainBlockhash (revealed): BVfpx1jAe2LSdeek5ggwLfjpv4rjZga33F7WHV8BEp5y
chainSlot: 457525160
serverSeedHash: 0x2ebcac3c21292156a6d7e1614a8bbec70700e675acf5bf3cbaefab152f5a46cc
clientSeed: 0xab80ddb6d347711904b9280acf7df2ec94feb9b0a55f2019be12a4b66cbc7367
serverSeed (revealed): 0x9fcf4b48a358a4d0b7e427ced1caeb7b33cb72130c2688f43c75d0393c2ba5e1
chainBlockhash (revealed): BK9T5xnHuETxL1GpT262QQeQogMUk9fsPocjvRuEGYKe
chainSlot: 457523770
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