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): 0x31bc001622949fe12b01d651dd4baeab4c513712fafdd02e2d99e637ef5e3be6
clientSeed: 0x79fb8cdf7ad9de08d1c2a22817540b5438459dd83a33bdb57eefff904a3fcff7
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x102e4350fb9f1bcb91eeed23227858ce586e055edfb71089c99560d3cf384641
clientSeed: 0x17574f815e1c7e564f033885329c9bbd443219bfa5488396243d8c424ff566ab
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd141a9cdbb4df966a65cb0c74863245d48c910c0b171cf2afd18e7f0c1bc3214
clientSeed: 0x5131b2aa68e920aacc3e9368129b70d342ce7bc6b0dab05039d62e1b63f33b81
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1de14308e3055e32d9036594b402fa7d4b23e064f19f926e2e66b8e23301aa1a
clientSeed: 0x19af35baedda7731037af3be6faf601530cecb36afc236f3791b09e792b82184
chain entropy: not yet, arrives with the draw
serverSeedHash: 0xe2469444f2d879c1a56eced8062ff104eeb6bcdecfb7771d68465fc835708ae8
clientSeed: 0xb02d367ea2432f0f7b4c67003efd8ef6baeb04c0969d7d8999835535e33fa409
serverSeed (revealed): 0x09d3c4a0c94083b774ef8dc9b9f92b6c7804201042577ce0669c5ecf9d2133a8
chainBlockhash (revealed): KRoSgYKyCDjSTQH3c6CQmcp8uz7Va4cRUtaYWt7Edb2
chainSlot: 458088145
serverSeedHash: 0x91161aeae28e0224fe482a1b13774513240143bb8a0c3d0cf910509c4467da38
clientSeed: 0x14015dd1873b04778ed8ef156eba61073fbf5e7bffa807d71f940386afcdfb81
serverSeed (revealed): 0x0c418bc0e3075c18db21c9a3083316a92da590225ba4adbbff78f575103978aa
chainBlockhash (revealed): AuvgER9qHuBqPRp2gok4LzeNRvLUoULixyuLYzkBPbgg
chainSlot: 458086776
serverSeedHash: 0x0f9ec6fba184fc035d11b734aad138b238aca1b188e77a7fc5cda5b1952daad2
clientSeed: 0x16c61e72412e3592c395308d765506515bb9f6fefac712060f58b8d032d03d17
serverSeed (revealed): 0x160269a5b6dea9f18dc27f052fea84f2498ecf81a4f4a600e77a79b8bdc50c1c
chainBlockhash (revealed): A7Bj8GPTKbxebociGkq23qgC98kysvExnRTxX6LH4qdy
chainSlot: 458085391
serverSeedHash: 0x1ba7c8d904f07f18de818507d0d98b5868193a867f65aa522b600d4fb5ed0242
clientSeed: 0x37741ca09248b24c80d511a92c51879f5cc7bb6b3531b506094b9483af7bb2e4
serverSeed (revealed): 0x71330418483f3d522852d1b88225a1afaddb60c20d64712afb20d1c7e9bcc133
chainBlockhash (revealed): ifiPaKXid53fFGf443eCRFUJxQMikFsEPAP1DRTpzpV
chainSlot: 458084027
serverSeedHash: 0x984bd1de67e6c335029bd317c25244596bd691b775ab752069d85b30e79833c0
clientSeed: 0x90c4d8ebc6accedd28477a11360c11dac041458f9cec4e952721ea315be38718
serverSeed (revealed): 0x0f9d9a7f219057e7663b260a85a90c95b0d7b74e8d45ae2b8e13124cc51fce22
chainBlockhash (revealed): J1YwVsDhZ2Ccbg2Nboa8JCp13HEpxw5tMU2UE66V7HA5
chainSlot: 458082650
serverSeedHash: 0xa31e313ea1158e6e09ce260cb0edce7938dbb6819785155e88132c51144c7d33
clientSeed: 0x71c66869e0ff11ade475717dec18890690ed25c51acc1669b7c60af9d42a8ac7
serverSeed (revealed): 0xc2105a0ecae2b10a13c0a6032f30067932141584ad460b4f4d11f373f9d58344
chainBlockhash (revealed): G76Fzy97f9UDBQgLACuEmmK7FgxV7e7joNGCBQkr3dRe
chainSlot: 458081278
serverSeedHash: 0xb58d68426c9bc64c8c28e7b9be8cc54d0bd46278e459112fc46db2f7fbf24689
clientSeed: 0x89dfa382b3b58d820174932a197684187c813486749a47f473a0337288fd349c
serverSeed (revealed): 0x65dd4ebd3c3f529fa0c5ba0aa7d38b0089a998e451651f380076c92039e988e2
chainBlockhash (revealed): 3rc7V3R7FQTWQQgtSH2JiFYXTztUGwJFirGBRiuJVf9N
chainSlot: 458079912
serverSeedHash: 0x7591ec4d1345de1f0409076449154a9bda730fe8cc1b78b0ab9c266ac98974c2
clientSeed: 0x2d4980a83e5d62b80ab5e9d3cb6fb7d6181e2d026ee0365f5e97164344ea655e
serverSeed (revealed): 0x3ac25324b8492e5cd4a5593d3c5c773712348d8b72e9dd20dba26ca168f71df6
chainBlockhash (revealed): 3MAPGkYgKpXFjpCshVDEC2PLh8zdqMZkenDDF47eTnR4
chainSlot: 458078529
serverSeedHash: 0x24e1ce88b0ecf9bc1c846f3c7de1f637066599ea72f1ce0b47670f1a4c8b5b40
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
serverSeed (revealed): 0x8871ba4c4f90cfa83f80a7e19287d3f3a390593c74b282723a53fca05f5218d8
chainBlockhash (revealed): 3MAPGkYgKpXFjpCshVDEC2PLh8zdqMZkenDDF47eTnR4
chainSlot: 458078529
serverSeedHash: 0x0cd8a3fdd8f77e0a9eb76230726ffd1e2843c87411f4d83a2d58ba791a1c265a
clientSeed: 0xb88f05779b1c4e92a0c92252ddc6efb2fad0c85286745f8a4a0d882da666cc06
serverSeed (revealed): 0x688670c42f264803d095881b535cc488a28985fd59c956edd64150624e55a2c8
chainBlockhash (revealed): HJ8jWG566BkpvDe4XnFPHwkJwsE9s5LirLHk98LjXen9
chainSlot: 458078530
serverSeedHash: 0xbef2d343796ff5728d09f2ccb72c33cc751116414307e3d81d3ec731e3df376c
clientSeed: 0x19366e4df599a35ca8a4cd36a034d3fd532fd6e3a10a62da28d264a04fbb7154
serverSeed (revealed): 0x5538a24c79011ac5a52c0bf57fb8bf2517639f50b739c8e2b492ccff186bd706
chainBlockhash (revealed): Gp71HocnCP66da5LJYEyToHYHikKB2TbAgMB8SEticQr
chainSlot: 458077133
serverSeedHash: 0x3230395d99c6a863971c438200da5d252eeae8ceb58adb61ed7188d055be98c9
clientSeed: 0x0e961d8d6f5c39f26e15a3142df95d7b0b966bf7a94ad2baff6015679a3b6b93
serverSeed (revealed): 0x37ce00aaec56264d12e615c74813eb1f1b6ba33f84d286d3a13d44eb06ddbeb8
chainBlockhash (revealed): CGH5i67QUbk8PanPzVsCGEGipo9wTk1Nm1bLHakErR8G
chainSlot: 458075743