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): 0x4731931f174a91ed6b7b28dfc46888682cb1caa9970f90f99710acbbf9ed9a5b
clientSeed: 0x6236cc700f02cb04ed8318b1c346ad38f32119ae84bf5104f106cf1029454e77
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xf7f57cb6e8d89537f2fabc0fb967c34db5078a1a87fbe4352bb965865fde5186
clientSeed: 0x8d9c3afbde38c757d567643fd96b7950ba978384afb03eb619a2e432e5137ce9
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: 0xdd5730368c32d55ef00cfab9b5efc2418f29371ecfec422dbb2750b168972886
clientSeed: 0xfb57607cd524770fbde5c0f5af41d6387c1731a5c2271a8fbe93325231b77336
serverSeed (revealed): 0xa90ca48d0625e4ba07faf77d0f97226baa90d98dc5384cf909e531359327cb84
chainBlockhash (revealed): AwPZaivsB5ZPtvtfzrcYkY2eVFyDTPu4mtjokPysWHqg
chainSlot: 457901332
serverSeedHash: 0x327224ff9d6b2302f23ab39dc973f8d7594bb4acc5b192606d91c2d34e9ae78c
clientSeed: 0xf7b91d8bef4d223702c7bc4348c1b095eaf990e620cdcbdefce5e7fd0623a430
serverSeed (revealed): 0xf51413ebb8570b7cf6dc1ecdcc632ecbc29fd4d036499729239660bb71ac6e05
chainBlockhash (revealed): FdJapwtXzNbR76H9c9UxkQPLzUbRZ9BK3cTiCrPjKaHN
chainSlot: 457899955
serverSeedHash: 0xabc327a256ca6decbb24445e6f9cb4d5637834891324628f40048ec0c611b344
clientSeed: 0x61c5f9b9c7a33c08eb2d966fc89ac766f3c14f4dfebbc7daf4e90fc1e22d04bb
serverSeed (revealed): 0xd3d1b02ccd981eff7f416476c485bb925573cc606303a2b8db4d3480c4ed1764
chainBlockhash (revealed): 51FP5T1VYnEeWd14CN1n6FQenoVyDPzHCFRVmFG9KpVR
chainSlot: 457898574
serverSeedHash: 0x313e733188d0b56af729189a42b82c32d9d88c54781c811c0787a7dc3396ac2d
clientSeed: 0xa457d9e2cccbadbfbface769b860451aef3180f92e58db040fb34aaf704adb1a
serverSeed (revealed): 0x19f29e6c946072e77cd28e180a91d0c417cb17d108c7de040bb7d3d063382f96
chainBlockhash (revealed): 4BTk1FJhU5p2if872focbHfPvgmKxZeDNvvdHWCzA5JD
chainSlot: 457897182
serverSeedHash: 0x9a469debf4a8c94ab0f3d13ca691f783aaaba10560ebcdba9a0122e441b8bcda
clientSeed: 0x360e40dc5fe803f70beb56a4f68de71924b80c187ac3900b753b07982f6d3df0
serverSeed (revealed): 0xd3981793a75fb5f3c855266148bb5fe3fda7fe3ba7f1fcf72dd736c2bade3aec
chainBlockhash (revealed): 5d76oWqgMDHh8d7z8ViyQPUnL64EZRYzqnhmmFpQDXD1
chainSlot: 457895797
serverSeedHash: 0xf77bce72ece7b8650d5660359a6cd707b478e2fa1de0624e3e2389165725964a
clientSeed: 0xf5acfdadb3b3841f96106cc137a144d69f3af66b1f6d8babfe1aa68891426d2d
serverSeed (revealed): 0x7fe9ccdbe47a882f97a18cf363e5fd249c28c3829b99134484b6f6f394fde3b3
chainBlockhash (revealed): 5d76oWqgMDHh8d7z8ViyQPUnL64EZRYzqnhmmFpQDXD1
chainSlot: 457895797
serverSeedHash: 0xe88049e1fe193e07598ac2cf41c323987c790cf4d5b6ded2b1b61878f3364a19
clientSeed: 0xbf7a1be88491f2652fe0086441fbba5c7451ed403f8d90d5e7c7d44a33deb510
serverSeed (revealed): 0x7ecc4b8b1b34b345ad8132c470b697346d81dcac3ad0b96173fd39ce8357119c
chainBlockhash (revealed): 2qB1Z4ygKvS7uibQPghKttzkuAmknUXxp5N1ENwXy4fK
chainSlot: 457894398
serverSeedHash: 0x786d6487977dbe6ac9031cdd58a7fa14d0405aef319d0b5a790d5e5914de5835
clientSeed: 0xb37d84b896f539f1ab4a86941bbce161b2470b6041e856381da481a7da13c187
serverSeed (revealed): 0x0207be2b8187628329ec1a21218abefc552b2019e108c9f38b6881724291350e
chainBlockhash (revealed): Dg85o1iJPEEwscZikE4Ts5S3nEgyGgBJRX8mTpjkPaDM
chainSlot: 457893026
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