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): 0x41bfeaa1e3bc299363999fa5c177a60b838f386e30b0752878b77d2551c2e50e
clientSeed: 0x22cf1c2172c67eace1aed43374b45243d8f46204953fa07174225acca6eeeaeb
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x31bda280aeb254fe606aafaed4037b02249a3034e8f17c4986cb9eeac965a8bf
clientSeed: 0x650d82e473d4f4963cbae41a4a0840ec46a63c2e501752708ed9a7340ae811e0
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: 0x8483a2b504a5eb62dd3be0720e53be577dd616cc94c2c44a431b27b005a735de
clientSeed: 0x897df09d5c642210b4030c7a6361afd2b719507029e37f955977b326340a5abc
serverSeed (revealed): 0x2931fc6dfab6a23467964bb025b1a30a19f3a7996b15c77b4a475e91863c91d2
chainBlockhash (revealed): 9AX2GopUpCzntJcWjx9f9hQsJSCTWXnUKX8ec5zaJdtX
chainSlot: 457562758
serverSeedHash: 0x499ed16a1ffad7964ce85a417622d2d30bc71e81b7b2b9a64af764a51b79bc52
clientSeed: 0xa97cb790a25266ba3bf474cedd6d2b06271b8d378dc1f2e4a6c6782c3703bac4
serverSeed (revealed): 0x30360dd13d7afb9930540b91a5ee4d8b3e8b4467239e7d6b7c9219473b138427
chainBlockhash (revealed): 9w36Cn47idm7tCn2GW7NomNvv4hcBWiAXkAXMfiHU7nU
chainSlot: 457562757
serverSeedHash: 0xbae56cd2ee21d62f88a745dd33f4e47c2a81388585f5bcd0a5a6958992793b23
clientSeed: 0x203706de7b7d0472005db7f81ae97d489759c1174f3c3380302fb6dbb211115e
serverSeed (revealed): 0x345ae6639342aa1a2db38f321b775dc8b1ee77192bcd2962c65b45bd0fdd560c
chainBlockhash (revealed): 9TqSeM69yPRYcKbWeV9pEWkidjbyf4mFxrnK4cLEaM3o
chainSlot: 457561363
serverSeedHash: 0x272a6f46f1151c74551d4b2a3ed12781954ba42a9e94c51c9fc393f1c7e7fba9
clientSeed: 0xfb1678cd2cfd3b168472499746959c1aa78ee7222e108cec771bc579775e85e1
serverSeed (revealed): 0x579a1f85198e4cedf344a96bc1f17585fc1ff4effbe212d396b52d0bade808d3
chainBlockhash (revealed): EZdWLTj9nNdGWAnGvfwhoEZe3WLnebsFu7ZomkDJweCz
chainSlot: 457559984
serverSeedHash: 0x5fd045f7ca565d6a3d6584f12ca2b21bb30b3ae062351327e95442c21e3e13a0
clientSeed: 0xd8ea0cbff82228bfa7c7333dc87cd3297c057ba46b0bf2a7630d5b7d96bd0480
serverSeed (revealed): 0x17d07fef73c943bccc822b29eb7822e32749280393275464082ebd32aa03972f
chainBlockhash (revealed): 9UQHacPr56sq7Uuwp3QmnCJgbmXprv943K4Js2KDu4tu
chainSlot: 457558584
serverSeedHash: 0xca353657ef65d5278b0e98d4e56d926d7a21d623e4f44c8b4505d33c6e9204ef
clientSeed: 0xdea5f0718585028c5e83f2e08e3d84a1dbed828139fc797c5af91b33c7a96255
serverSeed (revealed): 0x3a2a6d7619809c1f25c3ba72fe3ed6a087f2d8b1b38d4606241b67d303e33814
chainBlockhash (revealed): 7kehEX2DVNpPFkuvCVc5Lc5fUUC4unsdd4uHHpr8HKZc
chainSlot: 457557191
serverSeedHash: 0x998596b323d3faf766c25e0854468a429a1f8947f3b1ee69b02185e38a913ccc
clientSeed: 0x4c131a290d1d06674b4f88289bce4f159094253150091a5d2fa21724af283db5
serverSeed (revealed): 0x95830f6412d00a8c8f6eb1e62b6ce88807797400d2660be5bc6c1f44c529517d
chainBlockhash (revealed): 3UTc9sYR1YqxfMgAPnSPyi6sFkVLG2YXePSzMRNfMJRT
chainSlot: 457555804
serverSeedHash: 0x1a4eedb1ecd39eab8721b12993ae1fe4f54bed0b253eaa5f0067e30a66c1dc39
clientSeed: 0xe166e6441f8da5819bbed74ddda7f281ddb7fad52f6a80a1fecd7ab294facb87
serverSeed (revealed): 0x9f697aac8333745e8cde4b943165191de1f982edb43004c86cf2479f0c745f9b
chainBlockhash (revealed): Bb5FGaKMKn2Vxvboh3Bd8aNQtSCVgNeuQwFAwtoPkVg2
chainSlot: 457554420
serverSeedHash: 0xa9f78cb6f3c4e759f57cf833bb9a1c86afcb43dc951003ddb90ae4b364344b6c
clientSeed: 0xb2323bd9619bfc6aa269b7cda60926a609c855a8cd0c8baf9991b9bd67592ac2
serverSeed (revealed): 0x4ba5948cfbf3ba5e6557c93dc90992c6473b8a3785d79d1b75dfe50a7c8a4caf
chainBlockhash (revealed): D8uMpfFcEBiV8E1F5QXfS9dn5oWQVE7yzJja4hBs9KcA
chainSlot: 457553029
serverSeedHash: 0x63d8524dd39f9bd7bf55975d532f02a4788ce45526af78c984bfc51683b3dd3b
clientSeed: 0xf4550885185661925dfb8fe67be2ecbedbb628e1b1797e6d607c94fd9639ab32
serverSeed (revealed): 0x4df62a93d3799b1eb774be703f6a0ec22fddd26908e580c4427735d6e063a1ae
chainBlockhash (revealed): 7qwfJkUTCfue8KbFfEnePogxvnGoPfk2eX66QtoVAoUP
chainSlot: 457551637
serverSeedHash: 0xe0eaf292282f4b291cb597c02b3e3c4aba5171f1b8cf453fb69b3d01832b2c7a
clientSeed: 0xb373a13aaf5d7ab0ac3f489ab59983f574818aff1609b808a4362f49561bb3dd
serverSeed (revealed): 0x7ae46bc6bd089e4d200d3da2ae91814e21c1b43b61d42f68996b8be5c2abf8fd
chainBlockhash (revealed): 4cgozc5nvWGoijb4ftm2Bx5vCfywZXTB9tNkc2d5Crp8
chainSlot: 457550251
serverSeedHash: 0xa726a32a3ab4050c66ab1ca60f0b2300d6665ebc1a292d17ddd38d20dad8a55f
clientSeed: 0x881042a9a7179d7590b55e7121057def88dd2c54cc8534770662c799fe04f81a
serverSeed (revealed): 0xa6cf8a2a806b0b78f0eb57030378677fb3b16031194a2afbe16174604dfe6cfd
chainBlockhash (revealed): 9oCD9LK9z6fPVTptuhyUKaCbfPW89JLJCva25jmkqwcN
chainSlot: 457548869