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): 0x72a629e561d12a4c8dc6b7acf101e003d115e8a343edb3c7383d7fd355df77eb
clientSeed: 0xbff259f7996041284c6cb620527ff4f87b5a0faca837a456d0021f2d68ed94c0
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x845c0032c5cd1343a49717b893f98cd3714380b7204f4f4fc421bee45e243941
clientSeed: 0x71db4f9795ed61efe8b664391ec06e7be842c418326f07920508387852925387
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd449f4dc8f4994cc7c58d5ee3451cc40a65f0076a822926c1139ddd40bea0bb3
clientSeed: 0x784fc8db8aa524dc91467d096b5b9c554b245854bd8a025f940d258928a9b57f
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1de14308e3055e32d9036594b402fa7d4b23e064f19f926e2e66b8e23301aa1a
clientSeed: 0x19af35baedda7731037af3be6faf601530cecb36afc236f3791b09e792b82184
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x01dfbfc34b6cf7db0f8bab5729dd06b5f7073f700f4f1d621384b1c44c082fa2
clientSeed: 0x83e7eb3f6ad75801504e5a9b0da9f3fd3a96f2eed2ada1cc411b1a9d5b02d170
serverSeed (revealed): 0x67232b880b42245f7e87013c747b61111f58c709a09f9473d4e0e4cd2de89275
chainBlockhash (revealed): BZyLwDmcWFTBPV3SKUo5Y9veSfvQPVoKdUaeGkgqMqMr
chainSlot: 458469865
serverSeedHash: 0x90c5083807f98c55b1a0d76322881b983c73edb0c875cd937f17dbd22941f57b
clientSeed: 0x0b52af255af588e78aa1afb3de113e7bb92b71c46b13204d4fb7c30f30cfd1f4
serverSeed (revealed): 0x7d43fc1804268f40fc7d3cfa3286f730bbca28eb8b80e28059a028f2655e0bbf
chainBlockhash (revealed): CRTnADjavbSJ7814ExqhD6GBwudmG6PdoBMc8HijYLqY
chainSlot: 458468481
serverSeedHash: 0x599e8decaf3a6908a8aa4542deb5b26b8d89b48e11130bac72a481d4e1dd3422
clientSeed: 0x26755c472fb90f5f47dfab537bb5381d4b86ae2026c24eee834e844ed5bc1fe0
serverSeed (revealed): 0x776e44bdd00243e2a322318e0f79dbd507667916254a58d6e89efdc879ea7537
chainBlockhash (revealed): 4wwJBqZyTUy3G83QxJRDC8A341pZy3T62bXdiBwUx8DP
chainSlot: 458467092
serverSeedHash: 0xe53cba814ae135c2fd5468b4261cb0d542899fed2183e7b55b0175c129337770
clientSeed: 0xf5327283ebb5c68813b504411df40c6eb8d1c8b52404278339c3135d0895481d
serverSeed (revealed): 0x074c3e81239d51ae7552c8b56de9ef40586689c413f310202ebe686415bfd4ae
chainBlockhash (revealed): 4FP5TZEs7wu5uGrFcT3AiLaAN8wjeiCam6HuHJUqUVVk
chainSlot: 458465696
serverSeedHash: 0xd117b33e04b83daf1fbe28881f499e52e5d02d2fd3b65e6c3f929e9c5f20ca5c
clientSeed: 0xaaac67c1a8161b5714669ae4d5abdbf54075355103c4314228cf888012d42675
serverSeed (revealed): 0x43149a2e47688fc2eb02043c498cace988ce847bf98c06d28b884fca7448eafc
chainBlockhash (revealed): Ax6M2a6r76D9b2mDub99XvTjaXZyivegRiMhhqgHYGjF
chainSlot: 458464315
serverSeedHash: 0xc79d14217346dbabff5f2440ccaeeda461e6c2d03504bd3062642f617c9e098f
clientSeed: 0xed5a182a9c8e0f66fbeaf3bd80e4ec41c2ba626532871d37c34d154435bf4abd
serverSeed (revealed): 0xe05ec287a886cff787cc1868511beb4d9eb8701ef9afe924889f5b9b41cb1ebf
chainBlockhash (revealed): 8TFNRhTN2gokvSdLWopHtESPjyHG62weiESQ5GbopuAt
chainSlot: 458462920
serverSeedHash: 0xd623d58b7a6badb303ed6720c502c6454320ee76346e0ce97c780099e59c6c9c
clientSeed: 0x3fce0a25db8586c20bc6ae48ab6a01a91bd6872e0b4f2f991816551a7f854c6f
serverSeed (revealed): 0xb8b15319c51f3a73900b4dedfaae6863880742e6d8919bc4824c1f2a8c0c2952
chainBlockhash (revealed): BU2fF9EMK6CqCQNb2i3Fw6Q4KVEyrRFEGzZkuS7va1Hv
chainSlot: 458461529
serverSeedHash: 0xcc1122556bfa2b47b97384ad66becf0448d8d408d6a7d68b9b5dd55c8f0fc75c
clientSeed: 0xebf6dbeb49ea3c0f9138650c356473cfaf99b76d069700360d3eb3c4e46272b1
serverSeed (revealed): 0xcaf065d48a100990a81838cbde62fa1835ad75a4b4e6ab21fb046c7f4f295324
chainBlockhash (revealed): DvQdTDPLo1RkpUM1DiBzQFBSNKkAsgvYZhb2Rrdbxbzh
chainSlot: 458460154
serverSeedHash: 0x1cdc6be09db284bb5085c68231f97ac94286989cd0c440a38f778518a802073a
clientSeed: 0x52c5c7d36f003b658061323ee60dc33bb60aafe64552b45dc3ea0d04b92ddd02
serverSeed (revealed): 0x50398218e9917daf1605ab53fcafa9eb26592169fb4231758fab365c5aa2bc24
chainBlockhash (revealed): DvQdTDPLo1RkpUM1DiBzQFBSNKkAsgvYZhb2Rrdbxbzh
chainSlot: 458460154
serverSeedHash: 0xe0a68952a9ac0832923f6552aed3a37663c77036d61143f62753cb8d81040a18
clientSeed: 0xba05a82ffd98481ece82adb2341ada27a428f9bb6e04d58c151a06adc6ad320e
serverSeed (revealed): 0xa0f4716ef99f93a4d4637da3d660aac0fa04bd4b6c55401f2a3ac288b4b5e0cf
chainBlockhash (revealed): 5chXHhja8TueGegJQgCw8nh7aJm58tgoyUAP5J7mvR25
chainSlot: 458458768
serverSeedHash: 0xccb02ca91ac9f9c2e500f6e118e10f8f74406500fa16f717f03681d99c4e5196
clientSeed: 0x1ff379ee215fd19d219962f7a9b5417aed570a516a1c0b912b0348ec5046bd6f
serverSeed (revealed): 0x869f71319d0329e49c379db7eaae1c872b684fd047dcaf96af1e3c2e140b2a5d
chainBlockhash (revealed): GRM3MrvWXpj8GXr45fpzwZUKvC92JKqzupRsHrm6itDg
chainSlot: 458457383
serverSeedHash: 0xd8f5fa1809e4f4bb1df99312b1c3e88c526e165dd3eabc671be417086ea84a9f
clientSeed: 0xf5403d1341c9bb87f29a35a7bef3f943f7e0d2c2d70898099f89c4bea5db925c
serverSeed (revealed): 0x9a3226d3fc56a010b60ac4645a73a6cbab54552d4abdc3c9ebcc7f894b89d310
chainBlockhash (revealed): GQA3fFfdwNfHnZqBSgboefre26kVafLGQaCViumd8Lvz
chainSlot: 458456008