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): 0x030b341aae3a0742bfd44c162bb6e4972d9fcec2d95dc0e7f431d74e47872fcd
clientSeed: 0x5228eb08eab7667dce2a08a1256892bafdb70cb9b6e82bd136db7345b1dd78c3
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x913447eda50451bab17783cb5c794d612816b7511638dd24704462f6b9c2a777
clientSeed: 0x4e870a317ade340378d889488dfb2f8b23d2cffa42242ec782a1eb8bb9334cff
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: 0x25627b65cf0d8e331603ab5147897bcec66efb0ee6525e3bda6b8a3ef7581877
clientSeed: 0x814365bcb080862b78d449f8b38562e930a8971d2a30228426ecefe8f750dc24
serverSeed (revealed): 0x14be561017996cae3f63062ed84d21b99eec8d0ea1c4b77886476f0646973828
chainBlockhash (revealed): G9qgFa7saM3T5wUn1iAE5mivx1yWC5tzDjrPqtQ9NVXk
chainSlot: 457929085
serverSeedHash: 0xda466e013455b2c1ccf70a6b29605b2090b769a3d96383dd0ee4c98b1d8c0de2
clientSeed: 0x57c2ed0e68cad1554da86699062693698d1ad416fcee2a8adc7687199bae73a7
serverSeed (revealed): 0xdc3810a3408ac3c2d60d59f32b680d48a441a9b7f98d99a249b6ec9cb7b98b60
chainBlockhash (revealed): 4Kk4ybiAfuXJ7bMQrBgqHUN9mKSTqX821AYfbspSG1sa
chainSlot: 457929084
serverSeedHash: 0x2550597469abe5bd057537079304c97837acbc76a8ca8bb6b6f6b276ad9ff366
clientSeed: 0xd0135c66dbc86ba5045d913e1d8e50d316e5da3a01e747dbb8a17a27f6106489
serverSeed (revealed): 0x7a151bd675567604bf985ff2381753016d18ca60a2586f21012517ff73cef1b5
chainBlockhash (revealed): 2qiMJVw8tgGoir2VVi8h2xmc995sWN12VHxE5qusa7d8
chainSlot: 457927707
serverSeedHash: 0x24b6ec3a3d061aa8d69bf7889214eb23d3bf2aa9f34feaeaef1795d6c693a4e9
clientSeed: 0xf269cbc5d9dc54ccdf162df6d2a7b7edeb575ad5a9c75dc0fd6185b3bcc2d306
serverSeed (revealed): 0xb25dce13ca06030b83614191048e6a7d313d604ab4f3a2e9bf70e684857b7d97
chainBlockhash (revealed): 9gGtTUzHsH3yQ2JZ6LPYQsk7521xAHbF2TzVdrShghpP
chainSlot: 457926305
serverSeedHash: 0x62a85f4ff686a90d0f896335c9c44cd0161ffa3ca841a40849d3186332c1f5c9
clientSeed: 0x6a637671ad42239e8bfb176ca666bb4dfd645810bd1b305cfe6cda3dc5fe28ec
serverSeed (revealed): 0x03b0b53108e7d6dc380a3ea939d9de33e50387f5a4eec6f8b00ccdf3c7c42d28
chainBlockhash (revealed): 3LkvLuFghtFBwDPXpQiqvTbTTNG55gnoJkU4jmAFKhYT
chainSlot: 457924910
serverSeedHash: 0x46a4c3b1a0311f8cedf980e8ceef8e6c5c5b0f90c7711c5725632f7041bb7798
clientSeed: 0xf1ab6e53f2a8f8e8336f48f95af79b6cd12cd5a05d1960e9402fac860879a528
serverSeed (revealed): 0x88e9b196e5526ca5970b2b4a3b94c8eb2119d49ec94150b647b4a6e620997fb5
chainBlockhash (revealed): 6JSESoQUmA2JvwdhvqCReg7jDs5aj5XY8new3X6nMsaw
chainSlot: 457923530
serverSeedHash: 0xa29847d85cdfed3994fd691f90fbcd7cb383d15c5d1c287004618d38ef71c8ee
clientSeed: 0xd8e81b9a9251ab0f07f9b1008bff3ef6b6c39394a90c2113db17fd98616d4e98
serverSeed (revealed): 0x6bc161025ffca6c374d0eb9d829d3052812c2e62dd9520c8749a6c2d6137d739
chainBlockhash (revealed): 3aYYVkpKqt8yvUJhG2oHGFx1WtfyDteZcDqnQwDYfYPN
chainSlot: 457922141
serverSeedHash: 0x521295495e03a932817ff90e8bbfb6b6afd87ab2e485748f69c6a54e3b15e42f
clientSeed: 0xaeb8d1e67362513a6c7fc7ded2a8c6590ef87f0ef29d2265bd306cca579caa48
serverSeed (revealed): 0xc584ef95de7ea233d349bf6a8956825339d6e264431e34a67dbf6ea3b4ac0dd1
chainBlockhash (revealed): FJnhSRgxLrJN82VJn8uNL8KAv3s4j3M9PtnbFBZ1B5s6
chainSlot: 457920760
serverSeedHash: 0x8be619fb1af0ebdd3126bbfb511d3696bb758368e7d9bf2fc394e3c4c4923fb5
clientSeed: 0x0c96f93f4680613a0a64aab01b9a289ae2a0d1791e8cb9c630489059bb441aff
serverSeed (revealed): 0x83025f06b13e1d3383dee5a26d0fdadb085b78d3c012f0ebaff720e63cca5045
chainBlockhash (revealed): 2rx8KRBQa458ZoXYp2MRBG2zg3CHJhDXyQPQB1AzTPEp
chainSlot: 457919369
serverSeedHash: 0xb258f59e3a8021080f8f1c9fe3541f796162312f7d8311baeb7438fded6e9743
clientSeed: 0xf921ad31347177f98b5a57760cace97ab7947ddd1e7b139c9a5946972f618b1b
serverSeed (revealed): 0xae417c85285764ab66b77dcfb00766324cc9f5b2708ca95a068b88672e2089f9
chainBlockhash (revealed): 7jgnCyGTzba6K43tSRP7DarzFe26NS7TsqXWE1bYd5eU
chainSlot: 457917983
serverSeedHash: 0x34bd4afd4df53cbcc1e2f9cc7008103da7f3983cb3c028d70bca10f21703c8d7
clientSeed: 0xd3ed9fe2413c8b24981bbbca883938a496217182f0f924eb42c4a9a7f7406a34
serverSeed (revealed): 0xf2ef6114c15e83041769e679b35c290512087260f6808f94f87baf935fee5ecf
chainBlockhash (revealed): 5E5QqZd95MnDxEwGusWY68cVyHgvw7GT4hVyY4jcHNE4
chainSlot: 457916596
serverSeedHash: 0xb60a29e86343c17c8ab6b260bf8c77bcbb3e2e70b925c90fe53021226714a53d
clientSeed: 0x167285d7462ba3af67cc2e705343bf3031a3505b903c3e1142103ce1c643db89
serverSeed (revealed): 0xee8cdc3942f9c96b521598ce384dc142812907e2290e9700b3f7ee141af9d113
chainBlockhash (revealed): 9YKssFcp6nnMiz1jydcbWAotVgrbEMmvqWqWdG41GXoc
chainSlot: 457915202