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): 0x0ad8d35f141ee68b41e549d06aeba4c7b06fc62615946ccde34f8da49900e2a6
clientSeed: 0xf2d78a70d755bf6af23d5a73f6f8d483a56f3088e817e52dd40d8bd56da1177c
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xa34e4c067c65a1a743684318911105f1414a7f1957bea79f971e3a678a0c6208
clientSeed: 0x9fe23b269985f76ed190cc88607e05bc903a24ff889007af8ca292d7a442ff33
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: 0x931ead74a40e7f5994e111c7f515be620974657f8a74bb7904bb6d1a327a6332
clientSeed: 0x9b1fba443aac2eab0eb2521280493d911c2a738b160461696d09de34270459f5
serverSeed (revealed): 0x126e2b4f51bed78c33cfc131f1d1e8127022e817bd1d1a3d7e03b79db80cb50d
chainBlockhash (revealed): 56abhy7RdPAoV4sJdacB3gtVffzg4YMhqcTrPjDHm8Vo
chainSlot: 457721118
serverSeedHash: 0x888ac73ebebdc4e2cdd5b428e579da837f0a59cba81c026b07548d144dd10608
clientSeed: 0xaacefaca46ea8e5ecc6fbb4633431dc17297c1d4fed67ece41edb2a96cfab2a4
serverSeed (revealed): 0xef2759efed06c4944471139970a10849c72dd2cd5a5cb92c53324de1b7cfd58d
chainBlockhash (revealed): F83yh9t8gMghrZYm9TesLNDV8nq9ftzhsMsKyYP4ktJA
chainSlot: 457719734
serverSeedHash: 0x98899e74d14e67818b96c6f4920d7785db3554342e8a0199e661eb83232c85f2
clientSeed: 0x1dbb7e1f0f525e60372d8765b22441b34e7175d285576618566b6e28189f8e73
serverSeed (revealed): 0xfd9992c6e27d1058b0d6b2836b687579dd8718dce3a844681af5576d1c4af541
chainBlockhash (revealed): 8DcLciHSS11aCLhbKkcXC9cCzcStJsDyCdDHQqWeGjnC
chainSlot: 457718354
serverSeedHash: 0x8762735c5593e72cd00f5d68911429db63cc3dbbec49024f65813caea3eea1eb
clientSeed: 0xf9cbb67373376508bcb5902c0e9e829fabea6adb6280232420d39fa62074856e
serverSeed (revealed): 0xd7a4b60b5b26ad819de9d5e7bbd73e1701487813a102861f09df5a79759d8b88
chainBlockhash (revealed): BSwFrguVcGg3ZfEfXgVLnkLDiSXznjiXDB7pY5xZKdCE
chainSlot: 457716980
serverSeedHash: 0x5d7f1bdb45ab9c93248cf309f64e5b2e97baf9ed8e46292a36597e12e6d93ca2
clientSeed: 0x0561be133c40b979b862bad907931d61829bfe91ee93c0e0a83ad938c1d8c64a
serverSeed (revealed): 0xd710c4d0f5f43a568e228fc7b8739a1364f62a753615fab3cde540d0d41ae97c
chainBlockhash (revealed): 5cuBsidZXFWLRRajeHzVFgQyma5A8Jk9NLLgrUt4F8EP
chainSlot: 457715587
serverSeedHash: 0xdd835a151e3b49771de9d6ab158a1e64bd0ffda3f0bf0513556966e801cf8a4a
clientSeed: 0x46d82fa8bee5fff0238a04202df938b7fcdc02cb5ecf3a087627d8d0d60e83a0
serverSeed (revealed): 0x40640e3f76b4ba1760dff70a8854a35578a298ce04677dc7d27a5ec9eed6b9f6
chainBlockhash (revealed): 4rYj3bEjHNtRvzA1Xb1sqxpzrq8NqJHVsj5a3spz8kMt
chainSlot: 457714211
serverSeedHash: 0xa56e7608c36d4a45d8a4697e894a7b592ae93aaeef27456904972d99ad110a38
clientSeed: 0x3c79539edb3ff1fa824353bad881ee73107050d23a7f00ec6ebf1be5b6f66f33
serverSeed (revealed): 0x062dee7495258bbfc986a23c979dde3e4f7c96372e507743df6642e91ddb0d4c
chainBlockhash (revealed): 6BkshMNmAcrL2zkzfLY6psydWM41sfzDsSekFG7vRmjj
chainSlot: 457712865
serverSeedHash: 0x5b53c9dc1b93187cb820a2c24cab17da75fe06cd10ba812e6c1ba7b3389922a9
clientSeed: 0xb22e4f203276978eb672301e500aa418f8eb357c97d0be588ff1491e05c3e962
serverSeed (revealed): 0x528dc285b832b724eec137d4025ea35ba59b1a365589043e7411ce8ad63b0198
chainBlockhash (revealed): 8QEEM3ZcVpG3zCc4xKmxYTD8bmkwbG1HUmGPQZi9Txmc
chainSlot: 457712864
serverSeedHash: 0xeae1d4e658e00244276e06569ffa8a6ff74ed8437003920105e6fe92b10d5002
clientSeed: 0x1ee5fa0d9cf0a4627e3d3013af825f0884c726252d3cdd114f7e391a0513c1e8
serverSeed (revealed): 0xd4dfcb42eeb2924a1a613f54121d1f12dab380db32011c7084ea92db13a3c612
chainBlockhash (revealed): 2gHbYTFqugW485LoUNjn4i2vLYc46MGDHxB6z3kgvStw
chainSlot: 457711507
serverSeedHash: 0x9d7a1ff624c1caa04dfae89a2f25d2e94fcbcfb26f6411704bd17c1809ad9061
clientSeed: 0x6c2e1d34e31630ea379f253216d5c2869157fa2b190f10d632815e1f15568b07
serverSeed (revealed): 0x7be00d14d89a08c211cad0a89a637896bd56dbb4e61f4e84ced9272ecc8994b6
chainBlockhash (revealed): E8CDVHKg4pTsWnimQCXDCZZc1wCG1VsvU6naUprkcXJA
chainSlot: 457710119
serverSeedHash: 0x9c660ae786b45864b5452a2a10c23608e02761962751e30e5e1f627b6ce72fca
clientSeed: 0x3fb9c5e1cde5694a476fa16b3aa0537d174d0eb13d9837f92270e602906197fd
serverSeed (revealed): 0xa6e15954dcc577ef128099ffeaa8ab2a597b93e466b763062fd5f9d7f0a060ab
chainBlockhash (revealed): 7UWnTpZ8JRnAtozU7fCoBuTJLZPmbALW26Y2K3CwyDbb
chainSlot: 457708737
serverSeedHash: 0xc0600f94410ab83f3c5c15a9e56de7c773fa0cca3ad67b5adc33cf2d7c5ed7e7
clientSeed: 0x04610945d8adb01c45d6a21622b16e9142b904feec8d20dcaad588060a026e98
serverSeed (revealed): 0xe0cada3b3a36bd5ec9ac023811613a676f4232db6c8dab9dc26d48c1e19bfa5a
chainBlockhash (revealed): 87HyqtX62uQdRXgkzXatHN6suKtc3tVGGpb56U98xUr8
chainSlot: 457707364