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): 0x5ba078d9ec93e481e21c79f8d0e824f60b2b590da6a668c45e574edff0e3ebe1
clientSeed: 0x0b73d8be43e791406b708803dde0064ba3599285f992841868741c210e7a0789
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: 0x6a0e79236bddf201ebd43329def6b24b13305b5a9155a4f6a50068d9e4bf9936
clientSeed: 0x8f9f5aee7a11507ac9a03e6f3a63813176d334bd16b1b8a598fbd24bd075126b
serverSeed (revealed): 0x4f55628b8fd43d5764f6e0b73568d61786524417769e2628250c2352a1d932f6
chainBlockhash (revealed): 6uNM8j4Fij8mbk1i6zwDzPgzudmEXftHwmtwFVaiGZa6
chainSlot: 457493211
serverSeedHash: 0xc6b8bcd9741e7a11589b1386d55b3b62366f19db498ae58722dc356c0559e6bb
clientSeed: 0x23e7d2e63e98fd2a1ca2a57f5e55621ef9447c75e4470b524b14e0624cb6f093
serverSeed (revealed): 0x4a5952d386f6b41d8b8972e5cf453835b89042ff281712a7982cf556ce9f8f5f
chainBlockhash (revealed): 9feRe8J8gYikGgzP46e9qo6wNJ9U5d4fFaBeHezxRZKr
chainSlot: 457491821
serverSeedHash: 0x9dc236893d8dc89392996b01271ccc959496c0d9111c667cfb14f508863ba5c3
clientSeed: 0x3cdc3f39c61c17640d25b85cde7754fe55ff58fcdfccee6b45578e42a7983271
serverSeed (revealed): 0x41c5cea46b0b025b988f116976fa38ce0d6fac7e45f0852276bc7df31de3b5c6
chainBlockhash (revealed): DEKDAtyiAwspLJRpnzSfBqjvWVdN7G3S6nxfr1Q2J9bZ
chainSlot: 457490435
serverSeedHash: 0x2ddc90121f6277ab4e2c55841c0e81cba97dc5d9ca72211d482d7de5efae1434
clientSeed: 0xf83e7fc3dac00f877e4df309de7cfeefafab9e3b6ef7405f6651afd08dc86ab2
serverSeed (revealed): 0x77c5a7190f38e70af3f82ce2d68a142c159442942e7cde6edd7aea8ac64e5175
chainBlockhash (revealed): Ewst2km2xw5FHY8zN4hHXeb9o3KvojXeYHRBis4Xm1rx
chainSlot: 457489042
serverSeedHash: 0xf72137fc2801eeaa3caeb9623443ab7d6e579c3c8165aaee5e721b24ae519ceb
clientSeed: 0xa3a037f056e70e57fe6ee93f7e1c46f407c817a7c934704971064b4ed7f1b74b
serverSeed (revealed): 0xb0e9814f4d3f7891cc5641253e3784fa28dba90dc8f6e56f46f2b228a4497ab8
chainBlockhash (revealed): 9FJhdvPKqqqsSRnyDiW7e2FAU3RfTdM5YHDE2nDhcRk1
chainSlot: 457487658
serverSeedHash: 0x8a6df10d710076500eb75681e7e79bff3146f3093d903b3e0cb8fb1790612ea7
clientSeed: 0x92a13bd2ea19a6fe8b596cc61a5fb976d13fb2f6149df6526ae3e722dceacc3f
serverSeed (revealed): 0x58249bcc1f342dc057bd13ab0db757e284b5cc880d36143580df86328d5d2d8e
chainBlockhash (revealed): 4dEXjR78uBokFpJ1k9gUnWeWmuTc4fvMxqRuMNGA9mKt
chainSlot: 457486282
serverSeedHash: 0x48122c53617e5138b3cc5dbc5de14c14c9f019dbe2d340febff689c184745085
clientSeed: 0xbf7ed304e4f7e006585716e6be5f0a435292851017db0c89bad640e2c4935cca
serverSeed (revealed): 0xf8f4786263d49b93972f78dd649ab57cc691d0e53a4c0c2b9080bb9bdab0e909
chainBlockhash (revealed): FdCTgDx495ougvAhn4tzUoPedSfxen7GZ2eqHA1HunH2
chainSlot: 457484883
serverSeedHash: 0x2b35fac60b02136c35d62671db9e06bd6b856707aec0b1477765cd2b53a0f726
clientSeed: 0x7a9f6474f6f29b2d22d80a6fa7b535a1e4ced6bf9523005e387d12d3330dabd2
serverSeed (revealed): 0x734ff37b0c4150f53de170668f8ad5ace2ec6c9348a64cb0a7e87beaeee6d62b
chainBlockhash (revealed): 2qMW5TfbnHYFdA18cY1U92TVPn3unUMETJ9EmjqeTsN3
chainSlot: 457483508
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: 0xad56ee9e621ecab2f043d2ad9eacf6d6e4754ba9db9c291388e943f19d069dae
clientSeed: 0xa87d84dcf5a8e947d63462fc65395830fdac14afe7937fb3aede1e8c0280a55d
serverSeed (revealed): 0xa496e4ee24f1fcd1a1ad4248377ebff861ac43360867b196d0e20843d1fbdf60
chainBlockhash (revealed): 91cKwGrBWE34aNw7znMt95RZRASeEeT1RHHwgbJockLX
chainSlot: 457479331
serverSeedHash: 0x244999c65b6555f2a8f0ea926cdf555b4ec6607f108c35d4b7db9d31b19982f0
clientSeed: 0x2868f4e76a6bd2dadfb562f4521c202c39384529982b7b6c73d29eceacf85296
serverSeed (revealed): 0xa6870e1012f553866ace7e5687643495d8757f732d886a868f697216ba02e20f
chainBlockhash (revealed): 8j6Nnvzck1DAXdFiA2LmGggBFWPhTKn9AbSdk9pEeJZG
chainSlot: 457479330