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): 0x55121fa2dfdebd001ba1b9bb319d4f237bdb476d28fabf48bf6337c3e6f592e0
clientSeed: 0x29318001177e78b70786c5bd3dbbbe8ccbcc2068c052afd3c2719573b98b9f5c
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x79ea2f6f47dc8e5446c23c0db947e184b584f8f20afb6af33672ef4ad1066811
clientSeed: 0xa03055369cf0acbe57839978270ca1a9d752a9c720615e8c5712972e2c8f2c8b
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd141a9cdbb4df966a65cb0c74863245d48c910c0b171cf2afd18e7f0c1bc3214
clientSeed: 0x5131b2aa68e920aacc3e9368129b70d342ce7bc6b0dab05039d62e1b63f33b81
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1de14308e3055e32d9036594b402fa7d4b23e064f19f926e2e66b8e23301aa1a
clientSeed: 0x19af35baedda7731037af3be6faf601530cecb36afc236f3791b09e792b82184
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x0c159d93c896508d585d1a25c82e660b8888c03f86fb7408508db3c4446b47ef
clientSeed: 0xf32bb75626f468f068f3b7491e3afae2774f618f1fde4fe94e0faad640c042dd
serverSeed (revealed): 0x0059a59caa98e6c65e37e29ba26677708c8f2020b3b036a76b1c9ecd9a75741f
chainBlockhash (revealed): 4BYgWJfzzH5mJFZUpZvfMG7eKZq2mfrFwyumbUVWGZsZ
chainSlot: 458108816
serverSeedHash: 0xbee3ee9a9614cac67854abd0b9ee8f4f54f7a0064251748f7dd59f7b15169b41
clientSeed: 0x594adfcc5d6c4f1a709b3936f9978927e6b205eb4338775d15526c0f51a4c0f5
serverSeed (revealed): 0xf74d3db47dc530a09bff06a265581523c6749f5f752f04af9549a0585595b7e4
chainBlockhash (revealed): HNUDR8zDXuW2Bmd2ooLs7iMbMU9wV2WkvorwNbQAht4d
chainSlot: 458107442
serverSeedHash: 0xf6b97455b51b45c1b1fe019df51711b92e4681a8d4b3380bbd800d3cd2035179
clientSeed: 0x8a4e5fed4882be18f07094e260943f602500b1165876e3ab5852ab9e4e020d87
serverSeed (revealed): 0xfe39046a96f6552c68fb81441738dbb1ab8591fdef422619a0a5f318bed7dce4
chainBlockhash (revealed): 42W1QpvrNvfTVmZDbfGfBVV8Tw9xVXkmL5Xf52zemhRk
chainSlot: 458106081
serverSeedHash: 0xe54b02deb5bccba16ce7834e982433d9bceedfb53550217bcdb833b0dde042d4
clientSeed: 0x55fe96defd8a86c68972643ec5c998dde884aa51f76e610cea287396291e2ed7
serverSeed (revealed): 0xb9d600e95375503be31da339d1501b97a27e408880a4e0381e354da6347dd981
chainBlockhash (revealed): BwdigSpL3fwku7LkoYahMnpY2MeqWKW9xW2jBW9qLwTJ
chainSlot: 458104685
serverSeedHash: 0xfbaa48463d4e1c696f56b8348562527e226fd933803a65b4d4181768f6a80bb6
clientSeed: 0x31395cde6b2b63852dc7985699aae986f6205f24ab26a9e357fa74913be6044a
serverSeed (revealed): 0xc1bebaf72e1fdd261d979353f223c2e10344474e85077a11580c24c7e908f855
chainBlockhash (revealed): qMk1pvZN8CUssjMoRXzyRZGNcczqUwubihH9kyehCzY
chainSlot: 458103291
serverSeedHash: 0x6de14a55c3e0b95c7b33608a73be1da5fcf9987d1c69d8287f9a8b2e72cb0fb5
clientSeed: 0xf3c2dc6e891a10bcc4a34a4f84f597748bcd18cad5075dda992690b30683ee3c
serverSeed (revealed): 0x030e3f06524e8c0645aa1a028a52f43bf36b9dcea0f9ba7044355c52c3ed15f0
chainBlockhash (revealed): 4ghXdJZH5rekCQmRJyDtS94hAFoRdeZwp5brMgXVWfnE
chainSlot: 458101917
serverSeedHash: 0x36632eefeeca8a7e24593893ab602db09c82ab709517dea6e24d67c4721f7178
clientSeed: 0x8ee70daf40e53e2ff99adf4d7ca87ff04b6dbf500c4945d6ace9cd8c66e75b98
serverSeed (revealed): 0xe5e9047dd34e2290321f09512a6b5f433a2cff15ef2d39dfd115302a465ce8ff
chainBlockhash (revealed): L1iTykFxzVgkxG3qHV4DUNQtShpzH178J1sfFjCrx29
chainSlot: 458100554
serverSeedHash: 0x6bc592cd20eb8c904976d8033e481c805261660020ac44b0798bd28dc094ca98
clientSeed: 0x6640aea897404e871d5cc5cc5288b685fab8a4971e0a3545f0a7f20b5fa3ba9c
serverSeed (revealed): 0xb65b720b9db7df89b6a675cc605f0c047bedf4c995791b62bc386201967eaa89
chainBlockhash (revealed): BoEdE8BqfDLYjvnhgcbbCCt1PWJJj7Xq8RR7UnLA6gte
chainSlot: 458099181
serverSeedHash: 0xa111bf7f90ba719f60c6496694b9b4eaeadd32ce821bd45d216ba7930d2c1292
clientSeed: 0xab40f9b91730f38d7a93b18d6c4911bf0ed73db5c769726d17c3a1ad0b050b2a
serverSeed (revealed): 0x3ca376c990d3768386e021b0111f4cb3678d4c64ad90a682ce537d771baa3f84
chainBlockhash (revealed): FCdREMDg6rUaeC1kVGiHCgKsmykHHD56fRqTGbq3SodJ
chainSlot: 458097798
serverSeedHash: 0x4fd6e831b084cc8cb6e93b4e1f7053367d424d913522bc9835762a209d0c9791
clientSeed: 0x4aab29bd69fb55c1c88391e5b01717941799ed1eea367f461fff0addd4cca967
serverSeed (revealed): 0x07c65fc636abc22ae2cd48a6cf397fb2497d571fbbc4c0e8634f93635142956c
chainBlockhash (revealed): HXMQyixEDBGg3XmfaAbUVx9F5Yx9T6zzbNfN2bRSeWgJ
chainSlot: 458096406
serverSeedHash: 0x4d396329827bf623dd27476dfda0cab95ebd1b4c87a4f88aab6b38d59cf6852d
clientSeed: 0x56307c6c54a53b7e7059736d8369e6d3c186e9321de185f6e6486aa57a2c8c9b
serverSeed (revealed): 0x0297c5f0ab453529f9d119724c9c3a0f75612d63e02026f59c1a1760e268b217
chainBlockhash (revealed): 6rAgh2or6qVPzfEd6VwVzZHSZ1yb7wu3AB1nB273RbLz
chainSlot: 458095031
serverSeedHash: 0x102e4350fb9f1bcb91eeed23227858ce586e055edfb71089c99560d3cf384641
clientSeed: 0x17574f815e1c7e564f033885329c9bbd443219bfa5488396243d8c424ff566ab
serverSeed (revealed): 0xa3a8835663fed82395474cd42551e903e7d87889f7ae4152bf203216500f754f
chainBlockhash (revealed): DF53NG9shVwX5KGP6WHxeLw6yiZVyM5bjFVP974uizi6
chainSlot: 458095029