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): 0x2b35fac60b02136c35d62671db9e06bd6b856707aec0b1477765cd2b53a0f726
clientSeed: 0x7a9f6474f6f29b2d22d80a6fa7b535a1e4ced6bf9523005e387d12d3330dabd2
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x097cd5122ddce5afeec6d5b82c78b9ecfd4d4ff9daea0f44187c223d61f54a2d
clientSeed: 0x68b1d0d02f2382247cc3e18980fa40ceb9eeb6d1b50b25616950f3b6cfa42c0d
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: 0xa9e57abbbbb82dab759b14094e6f92bd3f8db428c1575cce33a46ec99ef2b6a5
clientSeed: 0x8228049fd60ab79df2b3ca82e2a42b8bd912c85e943a8c627b6d85cef98d9c7d
serverSeed (revealed): 0x688857d3e684265ccd31223191507d6bf92dd165e036f056ba23e191768aac09
chainBlockhash (revealed): GBzvpftDxfabsqqFi6a1Md6fqpp7KcDR8AhCPSZ95q9W
chainSlot: 457482129
serverSeedHash: 0xb197aebaef8030f70d1b6d486c13dae38f311a62efffeeef566230f93840413d
clientSeed: 0x812f0508c667aba212cec66209d07824451cb05bad2b4b1ea83565086ffa1b06
serverSeed (revealed): 0x8c59464174e29c2a24198f3e315101213ae38010aec84cf6c25e07cd08ce9b1e
chainBlockhash (revealed): 8NR2GHTuXqo3TDQWDzJYekavX4ioXUx421X6d5AHtQHP
chainSlot: 457480725
serverSeedHash: 0x244999c65b6555f2a8f0ea926cdf555b4ec6607f108c35d4b7db9d31b19982f0
clientSeed: 0x2868f4e76a6bd2dadfb562f4521c202c39384529982b7b6c73d29eceacf85296
serverSeed (revealed): 0xa6870e1012f553866ace7e5687643495d8757f732d886a868f697216ba02e20f
chainBlockhash (revealed): 8j6Nnvzck1DAXdFiA2LmGggBFWPhTKn9AbSdk9pEeJZG
chainSlot: 457479330
serverSeedHash: 0xad56ee9e621ecab2f043d2ad9eacf6d6e4754ba9db9c291388e943f19d069dae
clientSeed: 0xa87d84dcf5a8e947d63462fc65395830fdac14afe7937fb3aede1e8c0280a55d
serverSeed (revealed): 0xa496e4ee24f1fcd1a1ad4248377ebff861ac43360867b196d0e20843d1fbdf60
chainBlockhash (revealed): 91cKwGrBWE34aNw7znMt95RZRASeEeT1RHHwgbJockLX
chainSlot: 457479331
serverSeedHash: 0x41d908f3251a8b698ba3bc200e5d347155cf9835a28231a5afbb23c3a560150e
clientSeed: 0x49653baea9528eff2cf7a4f718e41e30e0c4b740184fa2b45735bdcef61e7354
serverSeed (revealed): 0x33d2204b3edf3879ab02956d766f1f569b04515770109b45e359d69dc692636c
chainBlockhash (revealed): 9dxNCrTqJ3iBrje3w2Y3fP9HoqL9JwKspeoDRQanUY7u
chainSlot: 457477933
serverSeedHash: 0x89ac0ebf79a681a412ff39c1ca428d93510610ef3c21658ec56d46a0510818c2
clientSeed: 0x48625d9c8ff27e35e54644331390363c83208d353f7174fcfd6e192c3ab6a535
serverSeed (revealed): 0xe0cdf4be0d68119a38cf4db62023618731a37559933eefbcd75ec28bdfb6a5f1
chainBlockhash (revealed): 9yBKwtyNKdoSPYexkuMdjc6UrR99nqYzwPwycJXrmBC
chainSlot: 457476559
serverSeedHash: 0xb9ba36f1dd43fe30bb40e6025735d44b6c29f00e4375e8856944a341fd02a979
clientSeed: 0xa6e9d0e81d885cff9cd8a90b4fef712dde030769aff9c787a8429dccf6cce00b
serverSeed (revealed): 0x8b8abeae95d381182881b825daa693b64b125d514630300b96f2aba040b0bde7
chainBlockhash (revealed): GLxYm5RivgHMLDYdWpRUdpizwTsiwnKcYLtJPLVfQJQ8
chainSlot: 457475169
serverSeedHash: 0xda6835829f476dac4ee6c2c31c9bb493d779b9903521cb052ad33d114417ec8b
clientSeed: 0xe85ff9a792660b694f93ce719a852907ecf4b581f5a9ba6735108f6443c0939a
serverSeed (revealed): 0x5e12639dfabcb329a853dea58552cf3a6735c72b2e389992adb831de44d7b11b
chainBlockhash (revealed): FLHisNgv7NWYpVzYp2f6TryVP6bgSeFVW9spV9RadrLS
chainSlot: 457473757
serverSeedHash: 0x1a0fb033d2d22f5765dd71e82e1d72332e209daae00b269ef662a659f51f1b6c
clientSeed: 0xd41085afba59ebefbee32fe73ea957f62ca84a7af24274ee3f1484945a0eb72f
serverSeed (revealed): 0xd3a63e8187da5995322f95aa4ffa71b9cf728f218a5e3d4651c9850404983e43
chainBlockhash (revealed): 9WYbc1AxoLdgKfJtzwTPf3Ted6nfiW3nUcufc3J6bP2e
chainSlot: 457472361
serverSeedHash: 0x4047234285f09086074b1b1892f5f492fec1f8939e5ccb2cacfa6df7c538e824
clientSeed: 0xeca73f4d9938e21c27ab031d3fede927ec1e5725a4b72c13d1697a1fe658110c
serverSeed (revealed): 0xe5db3b98a2159a14df30e61c47eea622e2c720da5e70d0f58c077c7209e13f61
chainBlockhash (revealed): 5qkZy3Pud6hD2mX9uk3HzGXBvmi4M2wuUfEMmcZUpxQN
chainSlot: 457470989
serverSeedHash: 0x79d7fe9637a38f95518ca5506f86e423610f5948e437be8716cf6741b147a49c
clientSeed: 0x5c51b5035f72ddd54a6448a3dd8b3e852ab09bc4ad9f15498d96bef9b9277ecf
serverSeed (revealed): 0xef977364647c5a996e92a3e6c0de1fbdc8cef8bf653937c3a3d9cf6b96da97bb
chainBlockhash (revealed): Ae84nZmm1SfJTMPDNQsPe1cSAnto1idUstTGxYcL1YUg
chainSlot: 457469597
serverSeedHash: 0xac79f717778a401385eeb517a4387c99cb2a2f4376b40b43b51370bf06818212
clientSeed: 0xd7061f621106693fe6377e0a98275d7acf17222f80e18c11546de2f02844153d
serverSeed (revealed): 0x285ffe54cc8ffe49735c9a332b804a728ff5c00400608318aa1754b4dfcef3b6
chainBlockhash (revealed): 4F5MxzaSuheumsVDKx5DkY2piyzLfTjrNED5JdoJ4is6
chainSlot: 457468212