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): 0xc2837e20e5fa5916ec27066404c973e1c2f26aa1b2221db66ea66ae5910cb02b
clientSeed: 0xffc83805388cc608283733e3060a2b9922b6065a825794cfaba4dc857022f760
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x49045c0ba5b6275f6b39dbc2b42c5bdf8732a4738c4f85d84022f89c8cd7dc61
clientSeed: 0xd8a5f9c754db8cb0fbc51553d9ebb0a8d23a0f004187e065dc00da4b14d4b515
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x24d5e14176236ff7fcb2d4db69870149192d8369adf799313bff22ad8d10f7ef
clientSeed: 0xe7ee2dd6d3bc1b68ccb2f80429ab27cbe9d8c0870cb67e94d0f69f68444a4120
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): n/a
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x12518518a759ef19bb27a27a87666b6cb5447aa3ef62ce2fb5e79765b0bd6c7c
clientSeed: 0x763039b504209def5118b3869a94e28a8714a070be40eef386bfac3b9c0b866d
serverSeed (revealed): 0x634bb6027b441984f85a429b3a357fcc6a550f2bbb8f06d0496110d79d9a1520
chainBlockhash (revealed): 6P5XF1LA4N4H2dzoxT63B2An2ao9HkfHH7tJ4VwDKSGj
chainSlot: 457583647
serverSeedHash: 0x8115b6d429cce02d36c8a8cd57f100b907153d57f8cc4a0723b66c75c22757b7
clientSeed: 0xb9c649453f5c67865ed5fd520c9ec1212a4b9aba34c1eb413e77b6c160d91130
serverSeed (revealed): 0x2a2fa4432cc1c402d5ef51a6e243072d782c09b41555196dde0501281fa7a57f
chainBlockhash (revealed): EWfYx7uyBG52p6GLCuFX8NnxZd79874TUVF5axLVB1m9
chainSlot: 457582255
serverSeedHash: 0xb4909d0c2a84f25314c890a0a2f58a45fa48418cca27a23de0a599fdec220382
clientSeed: 0x9401ff3744b0a6537e643f54c76936983d69bdeaa07215a64ac11233769c3907
serverSeed (revealed): 0x97a6499b904dcaa2b5fe596cc7b8a84808945eee80daf696633e3cd0f0c8eb45
chainBlockhash (revealed): 7EsEtSpeSE2My8ubP9WjoXUPdDq4wkHMihHcPeFT3z3p
chainSlot: 457580851
serverSeedHash: 0x31bda280aeb254fe606aafaed4037b02249a3034e8f17c4986cb9eeac965a8bf
clientSeed: 0x650d82e473d4f4963cbae41a4a0840ec46a63c2e501752708ed9a7340ae811e0
serverSeed (revealed): 0x5d0d4d824db3ce99800a8379f97b3d00814fa4ba7eb983ce0954779320ba6fc2
chainBlockhash (revealed): 8P7qNp6cfGiwKhzHUFvhrZnL18QYm9eLxQqpEvMEQXMH
chainSlot: 457579447
serverSeedHash: 0x85af10105bed7f511ab01fe425e6c64e6d05b881753bdbb43abbd3e8010934d6
clientSeed: 0x0e8ba758eaac1f637177520d8ff7cf62cc2fd9acd970693b39221e007e3c4092
serverSeed (revealed): 0xfca54f1b8f32502456028c38c1412d461b935b8b9ad13d0e49728d22b4ece49b
chainBlockhash (revealed): 79UZLYS1e3ZbmJwcevvZTfygYvGvguxo82W9f8g8CpcD
chainSlot: 457579449
serverSeedHash: 0xeec5a59b681042931f4c81c8b32e01a11b692a500abc98b33e26581c93c916e1
clientSeed: 0x846944facdde497abc85f28215ec77fbbee653a9271e0d02237e92e3d0bc6754
serverSeed (revealed): 0x6172e2759a363d0851d28dcbde05994f0550e05a02a39dada9775a85b83e8a3a
chainBlockhash (revealed): Dm39t7HWSvzJ2yBx7eE4ZwrxcPzKAa2p9Qm6rjnPpV1b
chainSlot: 457578062
serverSeedHash: 0x23706ac2fba19ca57dad7ff372a3fa50f4f6a157629624076fd7864a7362bbaf
clientSeed: 0x10c2d0fc606b889dfcd4c2075498e85a8a4d3b38c33e596fb289cc35e438fd0c
serverSeed (revealed): 0xdefd7b6fd24c3960b5e09244a406d62f4f0d693d3808fe7386b57b3998acc8fc
chainBlockhash (revealed): 6nphjr32r252iGirG8C1sHH3RJWnxfGS1JHJdog61Vby
chainSlot: 457576662
serverSeedHash: 0x10df0f0734a80039ade057697160526f455628ff7294b6a4737867f3790031a2
clientSeed: 0xf54085caadeea2b1b9dae258e4a7ee63b1b6996183ded8a2c1db81c91d548fa0
serverSeed (revealed): 0xd626f8ce67716227c217c2991773ddf87d470131eee7c359384bf9c826c9373b
chainBlockhash (revealed): 9cMkh9ayTrxkWNbFsoVtWi1HJuJvyHcZ3unVsdBETnmy
chainSlot: 457575281
serverSeedHash: 0x172d1fc17a37ba9c5d906addbd7fd29e8cbb9fe1a19921738f7988001071fe09
clientSeed: 0xc55697e18ebf6eca14ab0ccad2e164d3fdc53247fec6292bd964299dff3d0df9
serverSeed (revealed): 0xad8a80289301fefc6aeb6a1c76a70c83403d093a693cc0f6fbbcecb70164ee08
chainBlockhash (revealed): 4LNurKLSaHX1v1KE3X54UU42HvwfST8SmikFuMJwxTwo
chainSlot: 457573880
serverSeedHash: 0xe7983fc2a5f2c3be5d290ce643d7e2b3f294c4483e8a0ce5fbd48f1a654e85c3
clientSeed: 0xa6c5be6ee71317e91f777d8da7d0b7e0ada672a29f48dd8af2b28ebdc30b1770
serverSeed (revealed): 0x4429ec6aa538ab420bf6a4b148c3f06889d68b77b5d596f0c764ca0dfdac1714
chainBlockhash (revealed): 5avSa9QMejjY74rLQa6Bd653nkGZDZqiwU7hH7QHT8ps
chainSlot: 457572488
serverSeedHash: 0x74552b568d30028c87557448ad0572b3926ac0c0a136f594645ccec9d52c8142
clientSeed: 0xf03852576c4c2beeec4c7840cbe7e32a0aeab29d4a859da950f8e3c0fbf4e47c
serverSeed (revealed): 0x492cf77f6b9478cdb516886c05875ba565a8a9f86265ced46b338ca7af157671
chainBlockhash (revealed): 7MbD13URAWeDGKeRVKToZSvh52yUkz72HKfyrpURoHDS
chainSlot: 457571092
serverSeedHash: 0x011322052abc2d52c5ed8758f2bda7cb58113a8b8b8763a2102c7e3968be69df
clientSeed: 0x304bde9260e6e8b806a57b8fa5bd041c471a34ee15b8c3b91bfcb01dc461eb3a
serverSeed (revealed): 0x35c3fd60e5c94c194f93e902d7472cf1f098bf2ed4167471da2d63c0326113f8
chainBlockhash (revealed): AuoumH5o3kJgqnGGriHdeeCcgB1yGSVVhYXoxvET2GwG
chainSlot: 457569688