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): 0x172d1fc17a37ba9c5d906addbd7fd29e8cbb9fe1a19921738f7988001071fe09

clientSeed: 0xc55697e18ebf6eca14ab0ccad2e164d3fdc53247fec6292bd964299dff3d0df9

chain entropy: not yet, arrives with the draw

serverSeedHash (commitment): 0x31bda280aeb254fe606aafaed4037b02249a3034e8f17c4986cb9eeac965a8bf

clientSeed: 0x650d82e473d4f4963cbae41a4a0840ec46a63c2e501752708ed9a7340ae811e0

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: 0xe7983fc2a5f2c3be5d290ce643d7e2b3f294c4483e8a0ce5fbd48f1a654e85c3

clientSeed: 0xa6c5be6ee71317e91f777d8da7d0b7e0ada672a29f48dd8af2b28ebdc30b1770

serverSeed (revealed): 0x4429ec6aa538ab420bf6a4b148c3f06889d68b77b5d596f0c764ca0dfdac1714

chainBlockhash (revealed): 5avSa9QMejjY74rLQa6Bd653nkGZDZqiwU7hH7QHT8ps

chainSlot: 457572488

Rapid Firecancelled

serverSeedHash: 0x74552b568d30028c87557448ad0572b3926ac0c0a136f594645ccec9d52c8142

clientSeed: 0xf03852576c4c2beeec4c7840cbe7e32a0aeab29d4a859da950f8e3c0fbf4e47c

serverSeed (revealed): 0x492cf77f6b9478cdb516886c05875ba565a8a9f86265ced46b338ca7af157671

chainBlockhash (revealed): 7MbD13URAWeDGKeRVKToZSvh52yUkz72HKfyrpURoHDS

chainSlot: 457571092

Rapid Firecancelled

serverSeedHash: 0x011322052abc2d52c5ed8758f2bda7cb58113a8b8b8763a2102c7e3968be69df

clientSeed: 0x304bde9260e6e8b806a57b8fa5bd041c471a34ee15b8c3b91bfcb01dc461eb3a

serverSeed (revealed): 0x35c3fd60e5c94c194f93e902d7472cf1f098bf2ed4167471da2d63c0326113f8

chainBlockhash (revealed): AuoumH5o3kJgqnGGriHdeeCcgB1yGSVVhYXoxvET2GwG

chainSlot: 457569688

Rapid Firecancelled

serverSeedHash: 0xfa7d453a694c08183a801d46e0bfd00b9c930eb1877e06f614c30a1b0a91ded4

clientSeed: 0x90cc0bf7523e44a2842be6c6dbddfc6bbfcd4c4e3be14801a4a28998e424ec8a

serverSeed (revealed): 0x5848e24186f81eaaba966b7f3ad6751317f453592545446f81220ba2a8b7d6e3

chainBlockhash (revealed): H95xqCpBw6Q4i1KJYpGmiuoAT9q3snDn83f9a5jNbTCp

chainSlot: 457568300

Rapid Firecancelled

serverSeedHash: 0xc563e5f3e3dde71f9f05e79009d8446407d50c430853697d4f457cd2042489eb

clientSeed: 0x71b96ca7149566eabe731b8e4fd9064d2d8567c798a96d628650819f9bccae04

serverSeed (revealed): 0xf9584acdfaaae55da86b9c537e94d29da868c27dab7fba45c23ec9a347ee379c

chainBlockhash (revealed): E1EgAyLr3PjNuUFHeqaqz5PVhMtB7L21NmQ4kCFpRPxi

chainSlot: 457566918

Rapid Firecancelled

serverSeedHash: 0xcab59d2cf480a367b03efc1dedd58c560a35750a25a197c3b2c699a5c41b32aa

clientSeed: 0x12966f687a9ad9848a2d715ba50af06aa1a8ab59a927e8e96a1b2f184f65b3c3

serverSeed (revealed): 0x33806ba1605b53f1537a7d62f430a537e13a9215f34a20c78049a85aba75599f

chainBlockhash (revealed): A3Vk9nHisHpzG5D5yPpY3Bc1yWFPTZ8xFCYqtaFRpfj5

chainSlot: 457565543

Rapid Firecancelled

serverSeedHash: 0x41bfeaa1e3bc299363999fa5c177a60b838f386e30b0752878b77d2551c2e50e

clientSeed: 0x22cf1c2172c67eace1aed43374b45243d8f46204953fa07174225acca6eeeaeb

serverSeed (revealed): 0xddcd7fb0b523c37fea07b79f16290231a0c04e27841f073dd2742dc64b2114e9

chainBlockhash (revealed): HwCD4Uh5xN5L69LjWHm7w4AfBCt7ntxtGYrjDhgaKBS1

chainSlot: 457564158

Rapid Firecancelled

serverSeedHash: 0x8483a2b504a5eb62dd3be0720e53be577dd616cc94c2c44a431b27b005a735de

clientSeed: 0x897df09d5c642210b4030c7a6361afd2b719507029e37f955977b326340a5abc

serverSeed (revealed): 0x2931fc6dfab6a23467964bb025b1a30a19f3a7996b15c77b4a475e91863c91d2

chainBlockhash (revealed): 9AX2GopUpCzntJcWjx9f9hQsJSCTWXnUKX8ec5zaJdtX

chainSlot: 457562758

serverSeedHash: 0x499ed16a1ffad7964ce85a417622d2d30bc71e81b7b2b9a64af764a51b79bc52

clientSeed: 0xa97cb790a25266ba3bf474cedd6d2b06271b8d378dc1f2e4a6c6782c3703bac4

serverSeed (revealed): 0x30360dd13d7afb9930540b91a5ee4d8b3e8b4467239e7d6b7c9219473b138427

chainBlockhash (revealed): 9w36Cn47idm7tCn2GW7NomNvv4hcBWiAXkAXMfiHU7nU

chainSlot: 457562757

Rapid Firecancelled

serverSeedHash: 0xbae56cd2ee21d62f88a745dd33f4e47c2a81388585f5bcd0a5a6958992793b23

clientSeed: 0x203706de7b7d0472005db7f81ae97d489759c1174f3c3380302fb6dbb211115e

serverSeed (revealed): 0x345ae6639342aa1a2db38f321b775dc8b1ee77192bcd2962c65b45bd0fdd560c

chainBlockhash (revealed): 9TqSeM69yPRYcKbWeV9pEWkidjbyf4mFxrnK4cLEaM3o

chainSlot: 457561363

Rapid Firecancelled

serverSeedHash: 0x272a6f46f1151c74551d4b2a3ed12781954ba42a9e94c51c9fc393f1c7e7fba9

clientSeed: 0xfb1678cd2cfd3b168472499746959c1aa78ee7222e108cec771bc579775e85e1

serverSeed (revealed): 0x579a1f85198e4cedf344a96bc1f17585fc1ff4effbe212d396b52d0bade808d3

chainBlockhash (revealed): EZdWLTj9nNdGWAnGvfwhoEZe3WLnebsFu7ZomkDJweCz

chainSlot: 457559984

Rapid Firecancelled

serverSeedHash: 0x5fd045f7ca565d6a3d6584f12ca2b21bb30b3ae062351327e95442c21e3e13a0

clientSeed: 0xd8ea0cbff82228bfa7c7333dc87cd3297c057ba46b0bf2a7630d5b7d96bd0480

serverSeed (revealed): 0x17d07fef73c943bccc822b29eb7822e32749280393275464082ebd32aa03972f

chainBlockhash (revealed): 9UQHacPr56sq7Uuwp3QmnCJgbmXprv943K4Js2KDu4tu

chainSlot: 457558584

Verifier