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): 0xd33e7286a54ce2cd91f1c5cf56fdc6e092a7e7cdbef967a2d4e9863918b6af0b
clientSeed: 0xbbf17fc8a40f7e7af54d6050f03de57040add16c52f5c79434b95d9bba2699cf
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x26f1c5d87a21ef0ef0931269e49c0cadcae8dae1733ee4e4a4a03ec1fef1436c
clientSeed: 0xa40de022fc3f703d011f4a05d95d8eea3eb4624087719fe9874a9766eed4f048
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): n/a
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd141a9cdbb4df966a65cb0c74863245d48c910c0b171cf2afd18e7f0c1bc3214
clientSeed: 0x5131b2aa68e920aacc3e9368129b70d342ce7bc6b0dab05039d62e1b63f33b81
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x03670ebbff4c4246a3ab271d6231ff14c1c8d8e2edadd3e33fe29357060e43a2
clientSeed: 0x6130411cd95586b6fc40af905583fb6259c1a0ddc6cef684f0bb89214d7ed373
serverSeed (revealed): 0x9730697c5df3366fbeeeaacf4b29115d7651dccfced3f368ea444b122a2e8136
chainBlockhash (revealed): BNqzSzoxEiHitNF4tiELZppFji7a6a61qoTJZyNsP9Js
chainSlot: 457870834
serverSeedHash: 0x8a0e99479190615b3233219373252fb9cec3034a6d6de2b7afe1e8c1aad071ef
clientSeed: 0x8d90313a4ebd72ea992b5c8a3b1eb4a755295f52809926feb8855a292b3f9f14
serverSeed (revealed): 0x6730dc90e2363d4187275345f237ff9da6bc9f3a7a9e8ba12e656c982277877c
chainBlockhash (revealed): 8CyP5AVjPL7YnZCYbbXpRgcaWuYev6SrabjjJ96LMjuu
chainSlot: 457869462
serverSeedHash: 0xc21c43e1defa223929f60f0fe29ed1ebdde5b1d8409f97af3df00583e8108b18
clientSeed: 0x112e11851285b6fba3389534042acbe5adb071d5f548ae1da8eaca1794424965
serverSeed (revealed): 0xc5da18b74bfde017d15a22c4d3afb7f89e470be7b0098521f87a4533defe348b
chainBlockhash (revealed): A5Ymut7mzaa8NgxpNoQYdg1Db7kjcPjSC3vPd7DZaaGx
chainSlot: 457868080
serverSeedHash: 0xeafeda06f47f033624917d116fa5903b6d6b2390361fd41fa55fe626f3344c08
clientSeed: 0xde087e80ee695fc29f34e053a3f4ac846f0a4cd8b2cb089e655ad3698cfc6872
serverSeed (revealed): 0x9e22527e0c7e502296479dd864636078f426b2c4a66e4dfbea3f9038d24b549c
chainBlockhash (revealed): HVaWTd2gnpoK4Jcw4k77zKPmSTSybS38XEsY82fZLqjt
chainSlot: 457866697
serverSeedHash: 0x367fb32eba82546f72c54792bd2404b18941127ec1d444bf662878290c658265
clientSeed: 0x3bd2ac54bc11d749f9fbe9dc329f7296e7b54d7c3ed1d373a8ed14698068f39d
serverSeed (revealed): 0xe76ccf15093dd36cbf34ee4b70673852f897a8d4dcf3ceae4936d55228384e54
chainBlockhash (revealed): 9G7KCWvfc74r2gSvFM4vhDnLZqKpWngHz9SVmbMbeviT
chainSlot: 457865316
serverSeedHash: 0x90d87a044acd07bdba938ff1743dc6c18560565758ea29c1dbf8da98572baa3f
clientSeed: 0x18112f080c3106ae56ab3809f557367125f3090fcbb46a4af35f1b14333cf979
serverSeed (revealed): 0x095ffc3f892e7e40dd0963c5044631047ff29446f2ad6db72274b3698cdbf24f
chainBlockhash (revealed): FSopbPHiUdvE42fVtz8xzcnYPyr3WgRBk5anMxu1Fwjc
chainSlot: 457863939
serverSeedHash: 0x0283206ea012650897e2fe9c1f414479cfa76a1b8f74a3fa6bb56f8532d9f55e
clientSeed: 0x104e19baeade51fb3ecb44e3e1cffbdb9564b6536a089a1b94557fc0a7e21851
serverSeed (revealed): 0xcc5a581a700d5efd3d5798ad02690280c0d69497e5585bd2afed10f037d9dbf2
chainBlockhash (revealed): Azw2nK5CgMybnniL1WGUnZZawKztzQmziqnpUsHEdtc4
chainSlot: 457862552
serverSeedHash: 0xc026cf48810797c9baf9421fd326855807e6947264019603fcd6aed9cd81fa03
clientSeed: 0x5e3eab53dbb50a3a2687ab1399f1ea3201d1d4daf5e91102c2d062038857c30b
serverSeed (revealed): 0x4010b5c7d16e0705d2cbc1f61713af1e53f3f0c176a628c452f287c2bcd18e92
chainBlockhash (revealed): Azw2nK5CgMybnniL1WGUnZZawKztzQmziqnpUsHEdtc4
chainSlot: 457862552
serverSeedHash: 0xad70026bed425408d6b828b3e525939aedc8bf5c483c3910c979f581c7ba81cd
clientSeed: 0xb473bab584140858fdef86e55cce66e045798fb23e4071edf59423a0ffb54f70
serverSeed (revealed): 0xe8446dff809b7d156d282bd4d9409a36cbda858f03145be41b655265f60d8ba8
chainBlockhash (revealed): FDma42xRspj4jpqCxv5Di3eb3JySfHSa9phuy4EBWxfy
chainSlot: 457861169
serverSeedHash: 0x6980c0f003c4df3783fd2dcd4a8b6d89aa88fb9351ba36858abce98571ae4738
clientSeed: 0xd0fb7414eedcc7c23568f9ae9e69ac7a5898c5c1b9e07b54360116117766b074
serverSeed (revealed): 0xd4d5cb4343f9da0b3f9b2a4e7bc4e2f563dc2afc7abd6163a0fc7b6451e3d9c3
chainBlockhash (revealed): J4tuLvTy2p5bkCrJTQJYq42thJj2h9otiJKhRuV44Cbs
chainSlot: 457859785
serverSeedHash: 0xa483e47384a0f04f4d06004209546cd52719ed28a9f512f725036773da4b692c
clientSeed: 0xd423b90c810664b0943156a5f83d617395b1e4380395c0c801171727839a1839
serverSeed (revealed): 0x9a2ddc889b3a4c57424f3063ee1fcb45ceb1ec5ce4e70ba8ab2f8a6d7814ff8d
chainBlockhash (revealed): 5noqemrxcbqAytr53V2CMvu8soUmaCC8nEXyhgXTt74H
chainSlot: 457858391
serverSeedHash: 0x99148332baff8a34161268e748396b0cec428eacb31ecec807a39a8897cee254
clientSeed: 0x851aeefe3624d1e3e928f90e27d009515a97ef6721628c1eeea7b360e68ff26f
serverSeed (revealed): 0x7ff6a9f2037f0d2bcff9f19a0191dee967f2edff03cf8e38299d3f75e75f1fd6
chainBlockhash (revealed): CyLN7eHeuxxG51tX7WMtFGyU67BsUCUBjNvbSp1nv7Md
chainSlot: 457857001