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

  1. Commit. When a lottery round, duel lobby or case battle is created, the server generates a secret serverSeed and publishes keccak256(serverSeed) straight away, next to the public clientSeed. 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.
  2. 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.
  3. 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.
  4. 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): 0x18525a05b8bc56e518940be9b1e48c3324357da45929957b51d0e6cbe62370f5

clientSeed: 0xfa54ef5b3e8d31186b8c7fe1aed68c5d743f7b4ff4b63253ae8d21375d7b8ea9

chain entropy: not yet, arrives with the draw

serverSeedHash (commitment): 0x0ddbd914a6c4ac982c32c12de079b96554e7ed93ca466203ec2d8b749caa0674

clientSeed: 0x8a1bbefe967cdab60af77a509fbf0ee753c3c753ff9bc3e5f4bbb81d7f7c66e4

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

Rapid Firecancelled

serverSeedHash: 0xa80570dd3dda1bc09b8c92790cce7f6a9bb749a2bcb41ec58b11514ccc792431

clientSeed: 0x59c1356bb0aebebe68341f1065b0344714fa839e9d31352c926d85c18553ba7c

serverSeed (revealed): 0xea93804eb86decaf3cb793c1f0fb7e8c01e9a1f37fdcb3156f433dba7c4b0960

chainBlockhash (revealed): gZX67PEn5Sg2d67mdEjg8hPBQAkCEES5cFNECnaaWAd

chainSlot: 457509887

Rapid Firecancelled

serverSeedHash: 0x5e2cd9ec237c8b7e9e7dd63e52a45af4c215e3cccca02b0ac62f67a8ee8a7acc

clientSeed: 0xc47535f17d64853510c506a6011e567d1f3cc2e073f12fc8fe327b5a2390e0d8

serverSeed (revealed): 0x12c1d8f4578e8af7125b1c76d91f8bd8a2f1ab99e0d462752bb9c0a61d01c740

chainBlockhash (revealed): AYb2jP2Mk6DVx4Y2pGfbDqgGvZAidXH9uLYK3yS84iwq

chainSlot: 457508495

Rapid Firecancelled

serverSeedHash: 0x3df51ac7dfc70bb528e98e902b563054c06f68acc46d8c169f0f971917933c17

clientSeed: 0xca7f4bd837d3ce9967474f6b495df3fd34a6f7ee855b26158a05fa519341cd26

serverSeed (revealed): 0x48e682aa6c60d717a03f3f0a5d1f92fbee1cab65813578c5d7016b45fa2decbc

chainBlockhash (revealed): JC5zMjFwBcHfcdUPjg6aZT6xLDeTi8x6CEpdyWjHd4eY

chainSlot: 457507102

Rapid Firecancelled

serverSeedHash: 0x701c8f08316aabaa8c5ceb9336d47c00808a26439841c00d04711e3699ac4ccc

clientSeed: 0x14cea2ff36adcff4439b73e03cf25c08d79834c841a3a4074030747057fdc315

serverSeed (revealed): 0x192d3a21d2addca2c89e040e2eb0329e210c7911098c7b875cce8979d44b2ea9

chainBlockhash (revealed): BQArjPQFouBBkCgrTAbHD6DvhRpqM3owmzBSt3VzodKF

chainSlot: 457505705

Rapid Firecancelled

serverSeedHash: 0x372637cef0ffe24d0e367a5dc9db8bd83e6f86b12597bc5a3453acb4eb7484d0

clientSeed: 0x2d1dc45ab5b5ba166a12dbb8eddcd930a9e1e22bc53b4d90d9f3b1818f3e6b20

serverSeed (revealed): 0x2a3008e9d64be190230a21152914076d27ed79329130dbdb5dec624ec005b57e

chainBlockhash (revealed): DjmSoSiMMi7WUTYUrRXWReR11V9uk5RB52n1iTzXmDXW

chainSlot: 457504327

Rapid Firecancelled

serverSeedHash: 0x9ea343de9afdcb82f22137cddf3c572fc6df7e457bb2961bfe39f3cd4a294a8b

clientSeed: 0x321ffd1d8a444d5ac70ab54813b764fed68f0a48e292db3153340542312fd92d

serverSeed (revealed): 0xcceb3f371a4933f87d505af364947223e09538f6a3a0c5a786384c4b571069e9

chainBlockhash (revealed): Cra6pSKGZXYXs3H6UrhwMnnXGVqfDpRkN8KSnY1PHcz6

chainSlot: 457502942

Rapid Firecancelled

serverSeedHash: 0x2c86db491e08cf3a30405b8c95d8331be4bbb81823327dc183673abb22ab75a6

clientSeed: 0x78b3ae21d03ebe0852d8f8f5305c865af847d6a228355ab3b2c36c304018e4d4

serverSeed (revealed): 0xc26943e9f80f1a549c623c03382b15b93c05b8c7cdbf5c7fed07da08d42712a9

chainBlockhash (revealed): 2JjZZtkgXHnsWUKz366CHrVtTWwGCX7inLGhLBFZBFqS

chainSlot: 457501555

Rapid Firecancelled

serverSeedHash: 0x7e941666f19455dd1ac7fc83497494042fc3cd6423311330dfd15d34dc66508c

clientSeed: 0x2d887a81803045ee44229e4f74b75fa0c82fc66e15c705f28c93acc2fa1312d4

serverSeed (revealed): 0x9636fe7010fb7fe4742876274c9b35e7eaf0396854824e439105220c1e00856a

chainBlockhash (revealed): BXHmLmZfC9cmRySB1BxY2uAyytYji4cT6Sf17WtFx7jw

chainSlot: 457500169

Rapid Firecancelled

serverSeedHash: 0x9f0dd0da8ebafbb4d1f05d7675c8255952f87f8316f2ad92b5a56885f6d7e917

clientSeed: 0x832c2a07b3647276cf43958c5df78db85cd56a7278c2002ef4bab81381e3e8e8

serverSeed (revealed): 0x6568bfa780b523c08163dc726ed170df6eee4a844fab4808b3b9cb425c789b33

chainBlockhash (revealed): 2xaBjWJ5KbFa7VRk4WycH2GMHQvgwsYPMAM3ye6TZHWE

chainSlot: 457498767

Rapid Firecancelled

serverSeedHash: 0x3f31e96a96ff748eba7572167f848c7f1156088e173d97e8dfb9b92a07b230ea

clientSeed: 0x79f835c83f0807210d9d49304c273800a6bd71614be642d51273774cd29963e6

serverSeed (revealed): 0x57eed8c636787e877fcabcbc1bbc8a710d6fa9884d2feb6e59660c43c0f2a81d

chainBlockhash (revealed): HKVW2dzxHb53dzduPf2TJBvt1Nyu8yFAtXLQwTP84nrW

chainSlot: 457497379

Rapid Firecancelled

serverSeedHash: 0xf74b14804f1989a333c8088e3de921b6a5ead179bd704554465d4422ebfb279b

clientSeed: 0xe47e758dab902e92175a2abb0830d2e965f6c1fd7e98164b2c85a84a1df9dd56

serverSeed (revealed): 0xca873d665fd197f5fd4570f396716a4d5e4d4fc10cb1b0dc26f1cd0d3482e937

chainBlockhash (revealed): 3Nvt4xjWHXVRUpwbEHiPhqavxwaQjrtrm3JqjPXp5tTK

chainSlot: 457495993

serverSeedHash: 0x097cd5122ddce5afeec6d5b82c78b9ecfd4d4ff9daea0f44187c223d61f54a2d

clientSeed: 0x68b1d0d02f2382247cc3e18980fa40ceb9eeb6d1b50b25616950f3b6cfa42c0d

serverSeed (revealed): 0x46a60b497a170b2bbc0a112b4e2f3a412e0f1e39925d4980ab35b407c5fc04c2

chainBlockhash (revealed): 9mmCPxb5r4pKJtJ5rUoCqCZ4RRdbdvqA2Rbad4hHTXjA

chainSlot: 457495992

Verifier