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): 0xc68c804f2c0d05b10e355ea69dad9bb46562fd55a1c9687d5e7e78c4d70c444c
clientSeed: 0xc69798562a49297f4a6963aaca794358a156a25a79cde64f2e160f83826951ac
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x758af80fe75d21b32cca03fb7f5eff7eeaeb7a364dc4ea142a1a97568047b73b
clientSeed: 0x42b35d41269c152e85375867a88ba05567128fe766619589a03e3e8865a5b610
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: 0x9d6e817299bc86679998ab57361b65f271d7218e50cbf2254221a136eb0a10b7
clientSeed: 0x6f3d8e4f1e37b9ecc7d49e7c580c23205841503b6e47a3b9fa0a8eb9b1c24c38
serverSeed (revealed): 0xc11dd55ab99356e62e918b5a9167f9ad81ef07db5b7cf9b3fda83744888ecb84
chainBlockhash (revealed): 8aPYYE6uMxec6vsM986NxMMkV19diXeHNTDdR23KH83t
chainSlot: 458381231
serverSeedHash: 0x232065fddf022649e7b37232c5943a3b52d860c30b9b10f7f84f6fb9b1215d12
clientSeed: 0xaff61bb7375d9c3a8df78962e90e9813a3042136b076138382104ec51848570f
serverSeed (revealed): 0x0f004313b9caa95da6c0492097c5cdc77eea4ff975183af01f1d4bd80ede30b6
chainBlockhash (revealed): 3ccxsPUxa23pbPYh1BnUztwtNiSPLmt1f5K2mZNrWdFZ
chainSlot: 458379850
serverSeedHash: 0x9b959a2f56a3a5d88075686885620f4c20cb593ef9541b942576e08d128ac9d7
clientSeed: 0x5a2cac286f8be3f25609587098fccc02e2b1136ec1775667846dcadc72074ddf
serverSeed (revealed): 0x3beabbc844988725a26fb4bafe6d1002fa3e07b04ee70938b88b26f81d15b684
chainBlockhash (revealed): 4yGpsVz3vgsV2zNbPmvGtDvtRQpU6zmbv1quJU8TbUCK
chainSlot: 458378452
serverSeedHash: 0xedf45c0902057a05fdaaf33ffb605101538c927165bdd5201da8000b92c43a3f
clientSeed: 0x6618130ab6e4c7182767cd573be948a673f3bf8faa9be0c9758d5cbf5d0eb50c
serverSeed (revealed): 0xeda14b367f808b9b053a49477677f4de415ca55a10573ca92c154203b95516e2
chainBlockhash (revealed): 8SKv3jB51Wp1utNfkWjRHUgmKZVBhzSFvN4MaGBV15zH
chainSlot: 458377059
serverSeedHash: 0xf19029d823f49d75012be1f140aa4d5a57b02d7083b2c89bbae211eeada09f70
clientSeed: 0x2a695d46b7759970e38495afb64da46bcf78691dfc64ff3748b49163fc328cab
serverSeed (revealed): 0x307bbc93bb902262d5c7efc6ecb500eab8766add7c4693b7ee7969c666911721
chainBlockhash (revealed): 6MteDi9bQqhYNUGjNqEttchaj5MhE9Nn2htEbC5QS22e
chainSlot: 458377060
serverSeedHash: 0xf748030d6ad2a3b9398892546b02819766ecae1aff76edd6198749eab22cdf46
clientSeed: 0x2b074db3ec6ca2a5d7de806175e0c9c6e0ccc26af2bb0eec2c0bac9b89ab9a33
serverSeed (revealed): 0x5bd4c42acb51b11c76c3410765cf761ad659c8f1dd2534e2c7d544bc2900b26f
chainBlockhash (revealed): EfFMCY8guois7Resrdb7sw9Lp2AmNVwrxfhdk6Ts17pn
chainSlot: 458375672
serverSeedHash: 0x64692c7846c2042e9b89fe44f3ba22c40893766851457c162b4a73f037e9c832
clientSeed: 0xd60e47c516aedc86c044faf2bacbc2fcf4dba8b8406013ef71a712761ce3feb4
serverSeed (revealed): 0xec26d99920303a3435e62cd75666946bccb8093e3fd1a2637a2b72a6f3ccadf4
chainBlockhash (revealed): 4fx9RehBKV8qQgCDXjFFcmUnjKQCKpFYw3DKPhVkadQD
chainSlot: 458374277
serverSeedHash: 0xaf069138b4f507570f35db8902f92274c46b7ee1ffbe31015e168f7a3484a707
clientSeed: 0xc13ab8f924855b6440dc8c8e3ef096d00ef525057378f3858cae3e24462f6b1e
serverSeed (revealed): 0xf8720e026dda9e16ad46386243b48da4c03e34d9b67904f3ce3f1efa67adce04
chainBlockhash (revealed): HySaHdF7pTM4d9iKEdXWfCYQnJk7bSaruRSZSkZKdNEa
chainSlot: 458372898
serverSeedHash: 0x5bc2abb732c28c4d5731be5182b3b60227d7fde13419931dea3ed985a82f1e6d
clientSeed: 0xabfe8233316ae1024ded48219df39b4b7cec212dfd37613151513c246a9a3daf
serverSeed (revealed): 0x4ae569a0cb5a35db728e55a561ee2e2af681095a4672ba0926d56a6b823d4bde
chainBlockhash (revealed): zgA9gBo2U9rziYDURARMrWAV9dLW826sJPoze9b7WwV
chainSlot: 458371513
serverSeedHash: 0xaff7fc4c0a234378744f7b90fc007e60e701bc93463a623699318c4dc19b5fd8
clientSeed: 0x2b4d0e8d55649f6055f71ad829ec5ab91015d1af062c0973e352f65893576df4
serverSeed (revealed): 0x134ee6bcf1fa19078c3e704c3d8ea031ab0af853fc30678e907a245953ea01d3
chainBlockhash (revealed): A7VAxxZp4iGz6DKDqzGTDGtuPCtwGfCREYxJMwUbscSB
chainSlot: 458370129
serverSeedHash: 0x7d8cea2ef12e65d0e6ef41ebe871d8d10dd26257fa81469b2e1f9b1a316a640c
clientSeed: 0x07aff34243786124c29251a0a1ca5e93b25735e4b839ab705943ef0c5badda88
serverSeed (revealed): 0x336eabdd68aec70ebc0381a66514371fb15f13bc960f2f1e43cb45d680937bce
chainBlockhash (revealed): 69dsLRYb3ZhniHXLv3zQ9RcpMVFRBe2ao9hfgXh7sFfT
chainSlot: 458368732
serverSeedHash: 0x4044251e7faa13fb96d8c2a1002a1f703173499e52cbcef9702f6b462b098a60
clientSeed: 0xedd439bd2c2356412521b733fa2ed2ebd5c4d8e70fc98abb5b667c129c2d1cc8
serverSeed (revealed): 0xc9147c6180fa69fb10857885be1df1f9f26c74de31ffda314a821097bbd78218
chainBlockhash (revealed): TkTa4vwUA66GcZFTqHuBxNwcYyEwrz7Aq2gVSXN5pKd
chainSlot: 458367342