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): 0x9a87772e537d71e189ecf9bf88502a1ae1c3f8bd9b9b229213bfe218603a7349
clientSeed: 0x89eb06161b1952c0d421833f28ba216332a3a6dfaca7631bc1e7a2a1a155fa38
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xce60ffe466a454db9ab1a0ec51a736e91d164bf1bedec38e4a39d947fff6e764
clientSeed: 0xf028b8ecc40857136d8429e190077cc64ba9d39a0b3e16bd7ea4064762f7b02f
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: 0xcab5986745df2eb3a225c551c03c1781ff5ff3077dde03bc0df1455f86c0b88f
clientSeed: 0x52d3bcabb26c6051b7e3fe0b53ce007f83d8f0336c7ea3c35ad535fcc47fa903
serverSeed (revealed): 0xeb4dd12e376451eb96bb55c76b4e9ae6e6ebc93d9ffbd60e31802fa927278e3c
chainBlockhash (revealed): BTBGWTPJyVLHx4a9NGftmGp3DHLss7r1vy7xs7x533Qe
chainSlot: 458541776
serverSeedHash: 0xc77f9c97abb4e3c3c3c8cadb18c376e5f5d89c5db1fddab5691b788e6bf8962b
clientSeed: 0xe5f38c0925c07fc670913d6629f0a312d66c697906f50c166a1a011a2f83b35f
serverSeed (revealed): 0x543c0d14a3fdb16f655dbf186b73e86c37682ddfb0f24876f1dc99643d28cbf1
chainBlockhash (revealed): 13K1Db1hApPjpeuJazfUDcWVHbXsGU2eTHrcdKMQrRo2
chainSlot: 458540403
serverSeedHash: 0xb9b140d7a06a9d073255a7386135e162d39ad95cacab2fda4c58b6b99564a921
clientSeed: 0x2db797d4dfbde28c9a52a36382dd819a71a44b5bff50e581984ddaeae22486d1
serverSeed (revealed): 0xa4140fd0c5ad4d1a2ea30c6738e65265296326ac651bedbe43a07363a2f45bbd
chainBlockhash (revealed): 5xNH8p6KoNqZwmtzafzGthQJn6XPVeEYnGyTDsh97Spd
chainSlot: 458539027
serverSeedHash: 0x62f6205303bf48404771e8c0c8306fc4e7a58b2348fa455cb46bf8555efb5321
clientSeed: 0x5656055a20bd65808ea46978ce76f6df2e5da87a5142f747ea1cc8369a240e9f
serverSeed (revealed): 0x890af8a935fccd00704e444196c14518122f304736cc1d1d5d35e928302791c8
chainBlockhash (revealed): EFUEoUusFcUZtpgThNodmGsyqCExbx9DrjxXofnqYNjF
chainSlot: 458537654
serverSeedHash: 0x68afc0de41ebc496c818e98440fc12d5a40523e7086aaf46ef0a317bc0db81fe
clientSeed: 0x0435dd8ef8fe5d162f0db71d57d47b51286876d24791ae8f463c1d96437e1375
serverSeed (revealed): 0xd5ff8d8d626ea28d31a424bfdca4c79a17aea433c0a97e3dc61feb7261d6e927
chainBlockhash (revealed): H5d7ieYQ2gBZW3o5SKHCw2x2VCKbtQkZbiHZmhNDT5Um
chainSlot: 458536271
serverSeedHash: 0x1aca8c692a62f98703b42e7a3897c4d5edab3249a19536c9437f6d3585a951d3
clientSeed: 0x39ec5219a7e87708dda5062669fc817b5554319b81f4fb16b0c7796dcfae597a
serverSeed (revealed): 0x429d8bb148ffe388bfd5273ba9d803e03d01a0b605ce0e927484675034c4d78b
chainBlockhash (revealed): 2aYu2ffZ15c1Edj5hchAri1LAkyaV47e6yB8Eeaoisyi
chainSlot: 458534891
serverSeedHash: 0xc708eac23174971f9da1a6f389a642e2a0180cf6b656b489abb6d1f112dacdfc
clientSeed: 0x37e40788f85f4ed6956bdeec0d9c5fabc7433e89b44f10a9b2483857b1653fe6
serverSeed (revealed): 0x5e7308c4531bb877e9eaa6b5c1c67d15481e3540e8b7d5a6a7480f68f008ac7c
chainBlockhash (revealed): 2yc7kpEBuAwj98wPhG4t9govhQbBLmXiFps4FeVU7gQb
chainSlot: 458533512
serverSeedHash: 0x6fb7f850d8896754728a3fee3f2c33c14f5724dd2d3a5d6e8663c3aa951925f8
clientSeed: 0x31968ab57e5cc4994f749c2a614cefb21c0019345ca27163a2fddeb16e281723
serverSeed (revealed): 0xcebe0604b6d9f583000a56b4cd8efa0d7fe2073b06d220e4b39125878b9c80b0
chainBlockhash (revealed): DiuqCLjLcAbbd5L4a26QcHNy6BBJtaLhcjAMyQvhCaL3
chainSlot: 458532128
serverSeedHash: 0x92d39b263fed2bcf9dbfbf9458b620b98a0e2a730c602146335499ad776d82d4
clientSeed: 0x5195d79776829c0fb0a3e9eb61039ef09e05d97526441bdb72f98bb53b315d12
serverSeed (revealed): 0xea9bb4adb2614af460bd71af2ceb2033788e0ee6fd3768ce7cbc37d1689ed0e3
chainBlockhash (revealed): B9vSDAwKYrF58stQb84ujeYvXcJYs4dHLnm8ZudeegS7
chainSlot: 458530750
serverSeedHash: 0x794bcc4cc4e1b009006eb906a5768229e9b29d5db0603a847bcaf9323879a03b
clientSeed: 0x7af963afb2da09178277b726b671dafab63542f38ee6b494c5b6c690f022acb2
serverSeed (revealed): 0xbb27077a63bb0aa12a9ad50e9d126e406d27d5dd5bdcdc40675cc6b972668d47
chainBlockhash (revealed): BfJ7baHZdqRJZxA4hqvDiSr1YKtcnVTYRVKn9VHpr8rS
chainSlot: 458529370
serverSeedHash: 0x83c1fed7419da486577496eb6af9bf0452bfad0a6ee8638a49d3587f5022148a
clientSeed: 0x0751681f2d035b33e66d64051af9071278d3399420c46fc13e5a66e34fd8106d
serverSeed (revealed): 0xb0349abdebca3776ac1b995b474a8572baff549580cff2c2059c060a1fc05250
chainBlockhash (revealed): 25woekxR4A2D85paQnExFYzUR5eDZrznkoxvPURLeLV9
chainSlot: 458527996
serverSeedHash: 0x6ddb02f02795f222fdfc5d32ad1a17a69ca5fe4b09259255f57ea90bc71fbacf
clientSeed: 0xc2e9e75423d1b0686f9337669332d715afd713b61a1d1c36f5877f2e33849aa8
serverSeed (revealed): 0x9566ba553847496b95bf79905b7e522a5bb66ba46edaaec7e2f96e192cd6039e
chainBlockhash (revealed): A6C6XEjjGZTdGQRYEE8ZLj4L3B1rDmBfSchRN9sLgTyq
chainSlot: 458526612