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): 0x786d6487977dbe6ac9031cdd58a7fa14d0405aef319d0b5a790d5e5914de5835
clientSeed: 0xb37d84b896f539f1ab4a86941bbce161b2470b6041e856381da481a7da13c187
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x9a469debf4a8c94ab0f3d13ca691f783aaaba10560ebcdba9a0122e441b8bcda
clientSeed: 0x360e40dc5fe803f70beb56a4f68de71924b80c187ac3900b753b07982f6d3df0
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: 0x45b22cf66a4b2bfc94b987dd8d4a9042d38dc8b9139c54c8a98e35f7610a5875
clientSeed: 0x805f31e6e37a7e6e1f2310f6935b11a8b40bf34bb167e50feb7ca49bb94ea11a
serverSeed (revealed): 0x6c63c6738e21e763f3e54c3a8f1a664fa1005ed1cd1c1d7d20e6aa7a83a03b85
chainBlockhash (revealed): 8pMksWkTDjZ2HH8j3GTfXFYDZ6T56myCYnKaAfaXDCYP
chainSlot: 457891660
serverSeedHash: 0x825fef5524e33dd17de91aee14c1589c5ebd76819ed420ee656f42ce6aa89d43
clientSeed: 0x5fbd94fad0bd677993dcd89e1eec368d55d6bf75c5bba170c5fcc732088a1c98
serverSeed (revealed): 0xe5590d01d13c29957233adc92ab077d53a2f5a2c71fbfd6306c747bd02b602c3
chainBlockhash (revealed): DRUxWsugByQe7DMJotiQwhugKUM4yj5mLtMsLukeV9DR
chainSlot: 457890265
serverSeedHash: 0x43ac17fa1f83e1037f7eed1c6cb67161a5694d55f4e9e5333da404468a9d3222
clientSeed: 0x8e08c2259191b4c07884721ea4bd5d23f1b3df29cdfce28f07be5d4cb9512cdf
serverSeed (revealed): 0x207ec85b4498fde9d4cf98048788281214f8e8a87c37515daca97dc594c641be
chainBlockhash (revealed): 4QLwPD1ibprZLjhckuKhW5iDxGPaY3F1YSDFs36U7y7n
chainSlot: 457888872
serverSeedHash: 0xa958a73d1e6b830044a16d86c9c77bea896d21fc941c7d4398b601dfe26a5a70
clientSeed: 0x6b743fc9a93d6a716715d42483138d271a4516f9a0a027cfc02e0c9fb6942c80
serverSeed (revealed): 0x3a929e27fbb37e44d859c4dfee112aadfbb7900a78afb149faee6eb3a53bf189
chainBlockhash (revealed): EDvh1hzs2eSQKkc9fdypf4xR6WRciWVLNsQDsYLC8uq8
chainSlot: 457887499
serverSeedHash: 0x271cf5b43519d83ecb07202cb0fe7522bc46ad971e9b0a231598c599bbcb0278
clientSeed: 0x5a33604442a1c905b6cd64a247465cf7b7302949686e17e80b7583fe42139fa9
serverSeed (revealed): 0x6ebe8c097fd666c1532fef0514f97869129b1b7703dd4ab6f06045c689c5b5c7
chainBlockhash (revealed): BzuHju15ribEvMtEN7TDLDacc2Zsk9DVkdt67a6evGYS
chainSlot: 457886108
serverSeedHash: 0xa65d8b3148a5d510b50d7bbef33c8caf6d973a344823373b6d83c55100ddcef9
clientSeed: 0xba248da7e8f8fecb9c08ec86d4368ef8cb69c1bff10366168ff470cef9d85c0f
serverSeed (revealed): 0x8f72619755d4cb4782d29f01635fc6a9a3c51daca4e46c8b938ed805f9773ba1
chainBlockhash (revealed): 7kj98drg3VmzCgit1JgjBdxBQM27QPN2QCaP2bgaRk8L
chainSlot: 457884710
serverSeedHash: 0x7dd69e8d5b047c174df52892981ab2cb70b874202f1cc5ec2550d7dba8d56c50
clientSeed: 0xcc2e4eea6483bc653caa80998181270dc396d6bd6432f26cb6fa9e87bf96d8b1
serverSeed (revealed): 0x19b7acca3f59cf67b60b0cb7224381edaf503fd7901a2828363d9899ac733569
chainBlockhash (revealed): CBSw4964od5RpeLpPBj9jm3V7hGDfdSd4retqx7ixCD7
chainSlot: 457883312
serverSeedHash: 0x7a739b63bb006115cd359ca37c9fc1e8b0ceb523b0fe9853daaabdb95ecfcee3
clientSeed: 0xce2c221c67d41ba9865c054ae0bf34a43d8f8c33663ed62d9a93b5ff9f334e63
serverSeed (revealed): 0x6ede49c98fbf6b05423dd3c0d400039deff4248454fe83d3f514d0e3d92b77ca
chainBlockhash (revealed): EJULPTyeqGSCi9ExSy9sHtzhB91ZKFUeSqWuhTzU4m7C
chainSlot: 457881933
serverSeedHash: 0x014a759d27ca4dc53b6a81749ccf516005c40fbe7b98491f02cb5d0a63a59873
clientSeed: 0x20d948e81a4e9c4e099ec0d21c8e9c9ff452ec5e75bbca432a938a18ba666154
serverSeed (revealed): 0xf6a43e13dda77faded093c7fbac38508cbe60c3e3f0cbace37b5030d3956165b
chainBlockhash (revealed): 2hmopyTV2vBP4yvCnHgU8zxN75biNTCLnASy4wa8zvgZ
chainSlot: 457880563
serverSeedHash: 0x26f1c5d87a21ef0ef0931269e49c0cadcae8dae1733ee4e4a4a03ec1fef1436c
clientSeed: 0xa40de022fc3f703d011f4a05d95d8eea3eb4624087719fe9874a9766eed4f048
serverSeed (revealed): 0x990c0b406c11ed1f5d1c21e32113d296b90dfc10b863fd10409b3f5995f7bb94
chainBlockhash (revealed): EAcZpEkwp7jYsgQYU2ZNtB1y52DdUGQ1aRFzYssoZnKZ
chainSlot: 457879175
serverSeedHash: 0xd617ecf12a5f943494042c6cf8affa36c33d1fcca078af9e8346f46e71ce4419
clientSeed: 0xb03266a09a6a6d0aef7d8f254240d0ce88d3f307a00500f03f3ec45a9bdc595e
serverSeed (revealed): 0xca50e2027dbf2a64c7a34498cf9c18e9935a4848ff8e470068ae2363a4a594ca
chainBlockhash (revealed): EAcZpEkwp7jYsgQYU2ZNtB1y52DdUGQ1aRFzYssoZnKZ
chainSlot: 457879175
serverSeedHash: 0x85e00f782c37f6f377496ab1976f28094736b84402b6cbfd52679628da7fc6ea
clientSeed: 0x51275d4258c2cc6612e7fe5ba4e7769777bcf5cefc23f3b04374cabc1bd88202
serverSeed (revealed): 0xe21c57f3c4bba9c7df259ef3c9b1bd25a3f2ba60c4e5da0e743bb6090be840f1
chainBlockhash (revealed): BBC4hNhf8Wt1V9xasvkxjQe9zmCVvFArVZsTWeKDfLke
chainSlot: 457877796