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): 0x6dc12bd190fe44b37de36ebf47341f7141872a07f40ad27c49b44167f6e60449
clientSeed: 0xdcb7d3cb9ecfb450899b95232124505a11ba54e9972e5042046c2b4cdb2173c0
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xa9f63ed7ea79085369d7af301a7d15071ca7609fed6ca916d67e3505b0d11ad6
clientSeed: 0x57d7b156c552eeeb49766f92d4a1ca748e1c1506564008d007723c1451b67cf2
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: 0x640d51322c3c065010b0ef74c90be585bf9425d0987ba8dbbe51770a82d4babf
clientSeed: 0x539a2ce541795da80670f4e3d3acd3cebb63505ba6090f09da5109b47066a54f
serverSeed (revealed): 0xd03a17b615c13eb9fc301facd8f05275d63c5eaae3f4476fd4c5a14273faca8c
chainBlockhash (revealed): 21S7Hh6kPKPmCFf432XmgrLepxFKBFUvUfuQ7KHJoVwy
chainSlot: 457425354
serverSeedHash: 0x6b2fb5ea70974e934fd4d6a183b0668d8d2d1cb200d59b9139749f243ebff34d
clientSeed: 0x22e3c853fe1f425c5acca6ac9f0b2ea14b5ced990e0a746ab1aba26ced9f18ff
serverSeed (revealed): 0x44b48a1e2db8092c1e0ccda9ed5e51bd09f012b588c751a8e81b9a38fe973275
chainBlockhash (revealed): AZf2A9VRasGt9nS5TcfTH2CfkaYDAaPRvGeqkmemwfQX
chainSlot: 457423976
serverSeedHash: 0x3c813f5ac7304193de0230e1b11521ca7db0aed00136b010d8c8657d94a62780
clientSeed: 0x82435bb125409437b4c8a9915aed61181a93249f00591627662f5419c37ae75e
serverSeed (revealed): 0x1367ef4a807bc358973f71de9d6fd2ef78f44497ed144c22dcd26995fbf51c14
chainBlockhash (revealed): FY77Bw3PhMdwxpqeJMsRSVhXFrjoHFKZ185HR1E3y9DU
chainSlot: 457422596
serverSeedHash: 0x6806ef807059435ee559db763380677be732edeff938c9bb7606fbbbd7726186
clientSeed: 0xf67f7870c85454ee25a49cc205eb84ee3c6eb2570dec987190ac89df2a890a47
serverSeed (revealed): 0x84c1440e02d40d2b41fa3ccf1e26087f8867ababc697c91a529a02552694d8e9
chainBlockhash (revealed): DL5XHc8iWcvc8ud7KQWtuFd8AXAUYMWaKzpNLpcjfiMp
chainSlot: 457421225
serverSeedHash: 0x85995f2550ca7858ffc362044b8471c4d9df682e4403dd5ce35f52d08c7de994
clientSeed: 0x2c8e47e68704d4aa4bbe1d5f23098c4f31329504b39f9d8f65007bdb515992f6
serverSeed (revealed): 0x3e3c17e497345f5225a1d3efbe308cc9cd9094343309312207f751fe82f7385c
chainBlockhash (revealed): G3gi2VMDCUFaW9eu5rYRHwz2YhuggAh2eLh5maKv8qRz
chainSlot: 457419853
serverSeedHash: 0xd751e28b9e7540703c00bd36fb14ca2642ecd1f654402bf2eb869593f19a5e04
clientSeed: 0x37dd45eb2d136a388ce290f97a8ec427b0dfb7348505d3303272d256f9d17ab0
serverSeed (revealed): 0x8548fd9e4a8cd558f3f053922aa63d273ef17b4d6729babff955a6332bd58dec
chainBlockhash (revealed): 6eWtCqzepyjzYhgzrjVVYQN29Jg6UjCvbL3ES5gyVc3e
chainSlot: 457418468
serverSeedHash: 0x226cfe3059d7470ce50073e5ae94623b0b87e710702daaf60ae9b1ac33cda381
clientSeed: 0x286f92ae59399213eaf5d65d346a21165ae68645ae083302b96bf324065619d7
serverSeed (revealed): 0xe2ab13e3f66fecf8329ce84b471cc8bd5336ea94f3e632121edf493e7018bce4
chainBlockhash (revealed): Cg2jTY5GNNV4UWmvCsNqzaE15C3ZTGxaLbrxnZsgFWBM
chainSlot: 457417070
serverSeedHash: 0x1303b5cf0986d53751d6118c1ac3f31ad279ea51058fbbc66897219e418a5785
clientSeed: 0x502698d7a1c5032d63734fadb4aacdad73aa4121d6c46b4b1665335f35f9e6b0
serverSeed (revealed): 0x4c14b93dd473e9d8ce934040b6ef79492d607a3269f7f21ec523bd159d67d38b
chainBlockhash (revealed): 7zETzdGfzKrySS7endbdt5MZnTrpCUX1PHnKFGSENxbc
chainSlot: 457415670
serverSeedHash: 0xd64f828704ed2e3f930247c1f2da6e2ed228a6e4a60d38d65919b80367420a4b
clientSeed: 0x60a387b2d5d0715539b37dcbbcd96ae900d2a7bd4dfdd5b58ddc5ee8ae339718
serverSeed (revealed): 0x303eddfede22feef24b082f55625c79eb113389725a985e10525491f344a321c
chainBlockhash (revealed): 6eKYNrnkkMuLtrutWxdf1LX77ZrfhNg7sNxBUjw5qnaw
chainSlot: 457414284
serverSeedHash: 0x2814cec4f0e60f780dcbf2f8394bbdbb70f9af5346aac7844db9be071a9dbdbe
clientSeed: 0x006114206387934e145fe304a00e9389100aac8d05f4dc55911af6589070dd1b
serverSeed (revealed): 0x733cb90e0f91fc7b30620c589d817eea052bc9404b3a0da7d30aa932cdd160d5
chainBlockhash (revealed): JjQ2qD5Xw2Lf8V3CJKT5E67r5mWYRcVXi8vtsaR4n8k
chainSlot: 457412890
serverSeedHash: 0xc7b9614c82ec3528a13422ec2a073f6ae31ff0f3c3648058b6d5a81613f26c20
clientSeed: 0xcfc7dca6c8173907a3279ee318b923e352348f06abd35f97e104ee055a18d3fa
serverSeed (revealed): 0x98a599ad847241ee5efe4c3b153b1bd4d0dfec88e1861410bd4e3aef313d7a99
chainBlockhash (revealed): 3hGnCYmjiM2AN4z4jnUsertAuGkeAEGAk9YfBifUKa5v
chainSlot: 457412891
serverSeedHash: 0xcbe8091cd4af0959ccf2f818979f43ab944ac1827e918c0ff0671eeb98c2bef5
clientSeed: 0x87466b371732ab51fd7a8c577c440bc623b2a6558944dac79ce174210d50c9fb
serverSeed (revealed): 0x2b5188662552fef0e7c6b8ad2301146f9fac26b93eaeb32b00b71de9e651e0e6
chainBlockhash (revealed): HqrBUGuNyRFae3QPLDR5AeYj1kBpbj5MS9U4RT9HepC2
chainSlot: 457411482