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): 0x998596b323d3faf766c25e0854468a429a1f8947f3b1ee69b02185e38a913ccc
clientSeed: 0x4c131a290d1d06674b4f88289bce4f159094253150091a5d2fa21724af283db5
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x499ed16a1ffad7964ce85a417622d2d30bc71e81b7b2b9a64af764a51b79bc52
clientSeed: 0xa97cb790a25266ba3bf474cedd6d2b06271b8d378dc1f2e4a6c6782c3703bac4
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: 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
serverSeedHash: 0xd80b7d07a19cc878026895401a90a05ef3ceb42510f91e9474c063acf57fae6e
clientSeed: 0x7d03f5d620ccb0ef83d4a6ff67c09b1e9272f590b3d4e4260caf3761bee478ef
serverSeed (revealed): 0x4f410f799d9b1709e30a614aaf7212d282f86c38c6e7df886cecec9e58d8fb10
chainBlockhash (revealed): FgtmdbbgrtWL3TWG6wVnh5A981uXaJXLfxD4JdCTMbeZ
chainSlot: 457547484
serverSeedHash: 0x178226c82494f4f2c122ec64512202fd3144bb7d47ecf441bc25bc3e32ae40b2
clientSeed: 0x6d3e2e1f62c3f9730c9b394f3f178a3754dc860f2f166f8ea9b98018111c885d
serverSeed (revealed): 0xdc14281aa6c2dea0480b4853bce0d2c2d991c65fc1fbd4c27ea8821998f15bf7
chainBlockhash (revealed): HsZ2KtXTn6tu3pbKQjdSqWMfckti4uHGvw1edaep85fe
chainSlot: 457546084
serverSeedHash: 0x81b43adb287e03f56236f7feb8e0ed6da460baee4260037871d21284413e776e
clientSeed: 0xc88dd9cfc5d2e98c9bf329ea4dd486c40a9da124a39813e27633eef09ab1cef8
serverSeed (revealed): 0xfd55abfdbe149fd55de14209503037300aeb953b5692025432365946f5aaf619
chainBlockhash (revealed): HsZ2KtXTn6tu3pbKQjdSqWMfckti4uHGvw1edaep85fe
chainSlot: 457546084
serverSeedHash: 0x71c0a4ff17930a3eebd64b0e9a4670d1052b39826fdf7b63e9b90fcf1cdea080
clientSeed: 0x1112047972dba5dbef6fa103efce6f81e9764e49921af38d5e7292df2709b58f
serverSeed (revealed): 0x7e68d3508c853321786e42fbc2cbe5b6aeaa70c67af0c58ae6bff49c46e016ea
chainBlockhash (revealed): 3WCX45RwNCnndzHuPkBC7Q6yCp5WFhEA6EMeevtHXxRm
chainSlot: 457544689
serverSeedHash: 0x17ec7c573da703f0d51a7b2ffd7e6cfce0b450b5997bce6a784e7da37eb656e8
clientSeed: 0x90f7f411b6effbaedba34de446993826173fc96eee7f971bda087210a297af98
serverSeed (revealed): 0x78ce6c08deb5764226166c181201279b372f0904d38b17010ada819b2a024574
chainBlockhash (revealed): 9G7C7HSETD7iroAZhMpjZYogQ9osjnevBMysDcssmLGm
chainSlot: 457543290
serverSeedHash: 0x9fc755bc1f456601595c01a685d9640c92204ecaff1d7d0d5133c0ab4cd33dae
clientSeed: 0x9b717459dff5b4e00ddd85a17e35500ee65a933f6f099f49071420ba756907c2
serverSeed (revealed): 0x7e13deb522add30ae0d18217f2bc788fe4be5c3ad54f89d3eb6e1db8928239f5
chainBlockhash (revealed): BM7LzJ1WJSf7DGRAWUuXfQu1ujHeQpmKvz5G341mF8gs
chainSlot: 457541898
serverSeedHash: 0x4ea59b3eb60c14a1bbe322140c1350c1a28128facd19fab9e8cd4d9289cbab77
clientSeed: 0x4dc2f9f3ac9a546715993b7c90c61f4df69bb6f5ae9e1f83eb8e8593284913e4
serverSeed (revealed): 0x28a059b2f9bfee4a6a49eef21df29bc0e8af6b86169e460a479e59b56a30fb63
chainBlockhash (revealed): CMSFLRBP2uPBVNBRz1UL7fSocog6pXhCkxH2mvZvY1nV
chainSlot: 457540499