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

clientSeed: 0xb45d4b7a6840a979053f8cee9a9be213f8f99c59796b1a45ceb3e034bb9d6e5b

chain entropy: not yet, arrives with the draw

serverSeedHash (commitment): 0x2814cec4f0e60f780dcbf2f8394bbdbb70f9af5346aac7844db9be071a9dbdbe

clientSeed: 0x006114206387934e145fe304a00e9389100aac8d05f4dc55911af6589070dd1b

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

clientSeed: 0x9a37f64639c8b7cc203b11fcd91aaa05cefd77eb92f78e06e16bf64b64476745

serverSeed (revealed): 0x3136306d5523c6480d6fa0d4ccea5dcca803b01ecb819fc15db843adb0f19894

chainBlockhash (revealed): GzZzwgyF353f4sRTHQmZfcBSsTjunAABa7scaGf5kCgf

chainSlot: 457405906

Rapid Firecancelled

serverSeedHash: 0xc7324c1cc7b3944e78f463d303911ae8f639556fbcba95c6bd7d5d3cbae30cdf

clientSeed: 0xa0ffdd562ce3902edf30eaa66b21b95ffb02307013cb39e8d7e2f4f6d8e0a358

serverSeed (revealed): 0x5ededaf8993bca0a5c0b485e7fcb6c46b40765e438294d4672deb3746e937825

chainBlockhash (revealed): F3ZQJkQgG3u3D4F5x6EpTw24bCRvG3GzMGvszkdDhtM8

chainSlot: 457404518

Rapid Firecancelled

serverSeedHash: 0x235a4cb59dfe232799e7ad4184a2ffd5c12bda550e5b08d5712a7377055efe95

clientSeed: 0x7e6aa667191f102212c30b3f4205288d7ff931061897656c80f8df9742f05115

serverSeed (revealed): 0x38a94aac85408b4857dcec47578f2a3f2b22d13f2be8843a56b0f396769b5fd8

chainBlockhash (revealed): 2ZgoPW1MQsvUvDRiUh4TKMEYexZTKoyExrA37m96fxPH

chainSlot: 457403127

Rapid Firecancelled

serverSeedHash: 0x363307ac2b23b66c39c600b3f6658b201706916db2360610b0ca1531f1aa3f25

clientSeed: 0xc70250ae8984bec527b2417dee71b9c7f9d34e0c5604ba188e26d2b440454b7d

serverSeed (revealed): 0xb95d321a66ddab482ae3bd3b48f63f1d9bc0700890c2f441cb73b5c4dfe2b4a7

chainBlockhash (revealed): ooE9iCwzMHNDUYYUKrB7HLE9XDs26WLCmFhvKJTBk7a

chainSlot: 457401726

Rapid Firecancelled

serverSeedHash: 0xdbbde263af87435ee8c861ff99437ecdfa023b6c9c9b264770038185ae1ad4d0

clientSeed: 0xf97f9b9ebe67a766478fc80a4402f52d036dd11b4c12e091367d9ef7cea780e4

serverSeed (revealed): 0xff3174f4f0801b49b687eb27ec5b790fd72a93c467ff7ee34b09a88ccd270243

chainBlockhash (revealed): FpEVGxPTbSq7wS1Dx7emimFGT7cki7LVRYTPgtKYJmiF

chainSlot: 457400328

Rapid Firecancelled

serverSeedHash: 0xdca586a7461c62dbb0d4874d8dc60103e6d51eb877bb8029533b0f2650056000

clientSeed: 0x731e398b308ef52699a5afa797a004b07a7bf150edd846feb9453d51818a8cdb

serverSeed (revealed): 0xf5a1a633accf20505f33098b8a28d08dd93c9de4f8ef48fd8d70dcb4bce9dc29

chainBlockhash (revealed): 4MUcEetdsv7gtbhpkDmutCvmGZSahg12C8FRKydogCC7

chainSlot: 457398948

Rapid Firecancelled

serverSeedHash: 0x05e7c806200d74283f8d0713cc97fee4d88adc98a24c53ed739a481b18f1a8a7

clientSeed: 0x0d1c7c074b8aafc3401b9c87ddc6ca81da6df4ad5ceba0b80cb06df94859c4ff

serverSeed (revealed): 0x613248a8194ab9e81793b952f81be3e22781ba34228ebeadee7d767ebdfdb924

chainBlockhash (revealed): D35xSEDVv9xG3zAJ9cqbisXpWkFgucNvXH7Zac21N353

chainSlot: 457397564

serverSeedHash: 0xf828130cbd6a2ade3f6f23833bf9f72099f4ca8606f87b1b2567869029f80d81

clientSeed: 0x07bde86bb837558370e8f725bfa20b071257201ff3d95a907728c4e3f3e30598

serverSeed (revealed): 0x4aa828c16ee286d8d5a55c915720c11ffacf6ef905c45832c205ecc0a25471bd

chainBlockhash (revealed): vpE57XjQa8DCVX6wE5mijCZWPYJgPQNSC7U3PCZbGUj

chainSlot: 457396177

Rapid Firecancelled

serverSeedHash: 0xd3189d1e9545f37cb5d5d9f1de37feb4c2b9b0db21765795ec705fb581880726

clientSeed: 0x780b7c3d63dc3d0d5656b9aaaae71a5976ada95682fe53eaa21c2de46938053c

serverSeed (revealed): 0x7da68217444eb309d6a7ae5cdc194be294375738eebe13be56ecaf4c52f1a3d6

chainBlockhash (revealed): 5JFHkikr7JKZxEy2yMJtCJgckuUtWAQiBWiKRGHPV59m

chainSlot: 457396180

Rapid Firecancelled

serverSeedHash: 0x0c808af1996fff9a0636a02f9ee9e74f03af1373d6c73d21548223cd1b8ad569

clientSeed: 0xcd3c9103823213d983c4763de0638ed579a3c253a2051876730355c8cd736251

serverSeed (revealed): 0x45eaee31a5f96475b2ab14840f36922c423cbe3f39e92c79b13518797f7620ee

chainBlockhash (revealed): Gsyb3gk5Cnp6trz1WEp2TzPV4rwVrJfMftzXE9aL3BEJ

chainSlot: 457394798

Rapid Firecancelled

serverSeedHash: 0x60ce30471deb7b68d69940c7842242d1e8ce1ac639d85d868d54d00b46f9d125

clientSeed: 0xcc57289139b0c212a2cd2a2bdacd0044b59c776fb5eff1747426da9d6296cf1d

serverSeed (revealed): 0x7874a523bf0e8793b01e5b729c6495ff8d257e0cf0e51c22a76b9975f0f70ed6

chainBlockhash (revealed): 3YSakP6MZVn9PHrKvx8jW6dVHViYm9wT7AX4GWDjL2va

chainSlot: 457393423

Rapid Firecancelled

serverSeedHash: 0x0d8e7a35d2fd38982441961bec3224a01cb32b0efc130e0cf33623b9b1d037a1

clientSeed: 0x4188a919f5e21c77766da51947de77c1fa805be0eb9d78f7054e9e959818e835

serverSeed (revealed): 0x9fc6a6dd950c11d342939761248feb7fb63a2d654233f2a0245b42bf47969152

chainBlockhash (revealed): 6t7iicpvbSKSyZ1tpS3MadfFv73NK7aPrCnxqQL9WX6D

chainSlot: 457392035

Verifier