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): 0xaf069138b4f507570f35db8902f92274c46b7ee1ffbe31015e168f7a3484a707
clientSeed: 0xc13ab8f924855b6440dc8c8e3ef096d00ef525057378f3858cae3e24462f6b1e
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xf19029d823f49d75012be1f140aa4d5a57b02d7083b2c89bbae211eeada09f70
clientSeed: 0x2a695d46b7759970e38495afb64da46bcf78691dfc64ff3748b49163fc328cab
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: 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
serverSeedHash: 0xc33180207644c80d7164acc4a04bf79494458ff210da65e24853a8f8226e055c
clientSeed: 0xa5576d06e960866605731c56ac396bad7ae380aa36e3f6199f31d64d2823acf1
serverSeed (revealed): 0xc92910fe2db009f2b0647d025f8abb9bc02c35ca4ddf3bf93c60ae77e77b80a8
chainBlockhash (revealed): HxmiH4fStgmvizYMzZcEiqk9TVUcNrLZYRWbKqub1Xv
chainSlot: 458365964
serverSeedHash: 0xda5946a1720a28c74e60df379927013572808f48b0f3de4ebddbb210533f568c
clientSeed: 0x6f1a7939a5c2e24e87301d518d8ec488cc023eb90b53091069c92432dcfbb122
serverSeed (revealed): 0x43d9f9c4e3b2dc1eb302f80f881990c2f8d9416d785306cc8e004eeac76921c1
chainBlockhash (revealed): HH9U7ByVStpZia7KWREqqUNU2fneNVf8hir8AXLQp115
chainSlot: 458364584
serverSeedHash: 0xe2b722330c54daa1face5d218b08ac3977a57696c959158aacf67e833a95ad98
clientSeed: 0xf310a5ffea60351fe90b82d94117b27e272be430fafca276c8dc418e37b2f120
serverSeed (revealed): 0xa060976974f0ed4ede7172cda4b8e0072b2e6922955ea1b1c53b37932021a9f3
chainBlockhash (revealed): AssUx1hsmGyugwFVNe1tXLw2zpp76cWiKgrTAEcBvtSw
chainSlot: 458363198
serverSeedHash: 0x291bacea843bee9ef7e269804eee803d10eb8f57d512675a88df00c090c9bb27
clientSeed: 0x9e03e6839401dc74f6a929f71e5ca7a156206971ca56b3f7cf81aac85157223e
serverSeed (revealed): 0xdb286779590655d7d7f718ecc04b4bc2fe6ac1acbe4e79e7b0fb382a1242cd40
chainBlockhash (revealed): HtssSd4nJR14dryTXpNTHtSL4RCXLfqnDoS8RDC7hMjB
chainSlot: 458361811
serverSeedHash: 0x2cfc3500a5d38b9b431d6282321ebb21c29b41e11ee5c505e68192e25215681b
clientSeed: 0xf156dc1504111cc5ffd4193f97d189af5579bb2e29ca2d641d2ddde316d340e5
serverSeed (revealed): 0x977f7842441d0d124944a82348f002d653296ec0e78a96396f4a77c9eafb10fa
chainBlockhash (revealed): 5V3AMx91gGYqp29AxWidXkzPG44xdvWsbZF18PgdaQFE
chainSlot: 458360430
serverSeedHash: 0xb24ad301eb1c7fa668a5eecdd428a3debbbdf890336228eabbc5c429699c7828
clientSeed: 0x292aa2bc5b5639455c31ba14352927d41047c62b345c73e384ca9d989f1dfec2
serverSeed (revealed): 0xbf6edefadbecd06a5a24eb252acfa9279aaa9a5f175a041f98a45373b866ad4c
chainBlockhash (revealed): HkuUnLCzYGhG2nmUFLgR8fRXhyW7PmQfxWR7WG2PAuCG
chainSlot: 458360429
serverSeedHash: 0x8d717f3e4a07f9539e24997b01e3ae5e5f4970c349abe1fba854a3dcff758e53
clientSeed: 0x71ebd129a9cbd70416f68760783d3e294e527e2b58840a1f033dc9364eb8feee
serverSeed (revealed): 0x6bb6fd76ff5f250fe38ba971535fb3d508801e7024eb823dd04ae71fc6fb9787
chainBlockhash (revealed): wH2A6chjHEWQhyCTmzDf62N8PGfshY13yGPL8i1hZRF
chainSlot: 458359046
serverSeedHash: 0xaf214829af1b22617a30765a6493408d8b8c20f223841e7eb46f200bb8807c31
clientSeed: 0x6ee4f500a87f1de99e26bf99acc3b97d2b3da50c84745ac1bb786ce04cfbc9f1
serverSeed (revealed): 0x9ce74aca17c0f2ec716fb6d78bd689b6425588bb38bcd7ba58f7660dd5a62599
chainBlockhash (revealed): 3XLDoCSWRM1aSxQRaYzxZ9SP4V3YXo9wPzj8FBDhWdWz
chainSlot: 458357672