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): 0xd623d58b7a6badb303ed6720c502c6454320ee76346e0ce97c780099e59c6c9c
clientSeed: 0x3fce0a25db8586c20bc6ae48ab6a01a91bd6872e0b4f2f991816551a7f854c6f
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x845c0032c5cd1343a49717b893f98cd3714380b7204f4f4fc421bee45e243941
clientSeed: 0x71db4f9795ed61efe8b664391ec06e7be842c418326f07920508387852925387
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd449f4dc8f4994cc7c58d5ee3451cc40a65f0076a822926c1139ddd40bea0bb3
clientSeed: 0x784fc8db8aa524dc91467d096b5b9c554b245854bd8a025f940d258928a9b57f
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1de14308e3055e32d9036594b402fa7d4b23e064f19f926e2e66b8e23301aa1a
clientSeed: 0x19af35baedda7731037af3be6faf601530cecb36afc236f3791b09e792b82184
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x1cdc6be09db284bb5085c68231f97ac94286989cd0c440a38f778518a802073a
clientSeed: 0x52c5c7d36f003b658061323ee60dc33bb60aafe64552b45dc3ea0d04b92ddd02
serverSeed (revealed): 0x50398218e9917daf1605ab53fcafa9eb26592169fb4231758fab365c5aa2bc24
chainBlockhash (revealed): DvQdTDPLo1RkpUM1DiBzQFBSNKkAsgvYZhb2Rrdbxbzh
chainSlot: 458460154
serverSeedHash: 0xcc1122556bfa2b47b97384ad66becf0448d8d408d6a7d68b9b5dd55c8f0fc75c
clientSeed: 0xebf6dbeb49ea3c0f9138650c356473cfaf99b76d069700360d3eb3c4e46272b1
serverSeed (revealed): 0xcaf065d48a100990a81838cbde62fa1835ad75a4b4e6ab21fb046c7f4f295324
chainBlockhash (revealed): DvQdTDPLo1RkpUM1DiBzQFBSNKkAsgvYZhb2Rrdbxbzh
chainSlot: 458460154
serverSeedHash: 0xe0a68952a9ac0832923f6552aed3a37663c77036d61143f62753cb8d81040a18
clientSeed: 0xba05a82ffd98481ece82adb2341ada27a428f9bb6e04d58c151a06adc6ad320e
serverSeed (revealed): 0xa0f4716ef99f93a4d4637da3d660aac0fa04bd4b6c55401f2a3ac288b4b5e0cf
chainBlockhash (revealed): 5chXHhja8TueGegJQgCw8nh7aJm58tgoyUAP5J7mvR25
chainSlot: 458458768
serverSeedHash: 0xccb02ca91ac9f9c2e500f6e118e10f8f74406500fa16f717f03681d99c4e5196
clientSeed: 0x1ff379ee215fd19d219962f7a9b5417aed570a516a1c0b912b0348ec5046bd6f
serverSeed (revealed): 0x869f71319d0329e49c379db7eaae1c872b684fd047dcaf96af1e3c2e140b2a5d
chainBlockhash (revealed): GRM3MrvWXpj8GXr45fpzwZUKvC92JKqzupRsHrm6itDg
chainSlot: 458457383
serverSeedHash: 0xd8f5fa1809e4f4bb1df99312b1c3e88c526e165dd3eabc671be417086ea84a9f
clientSeed: 0xf5403d1341c9bb87f29a35a7bef3f943f7e0d2c2d70898099f89c4bea5db925c
serverSeed (revealed): 0x9a3226d3fc56a010b60ac4645a73a6cbab54552d4abdc3c9ebcc7f894b89d310
chainBlockhash (revealed): GQA3fFfdwNfHnZqBSgboefre26kVafLGQaCViumd8Lvz
chainSlot: 458456008
serverSeedHash: 0x54c29e730d9f1a3df14dcb83a474157b46e1920c48a7958541af4b0080866bc1
clientSeed: 0x739160ae3a055f4c3e031b6540037ac69fe3d584b286ca6e67ae3df71b8da51f
serverSeed (revealed): 0x93e6099a97d30ed8ae04ad1e53b59aebb5d1964bf335781f66365d47aa833ee4
chainBlockhash (revealed): EUQQv96n38hZswngB215VhJCCDjcaJJELAcx1mABUrDT
chainSlot: 458454644
serverSeedHash: 0x768439c47d57d8af2a6aa29073ec355cb4d3d236b6627ec13f2eaa295d0cfb35
clientSeed: 0xadbc973f70648eb29f345c29c62ee6039ea1d78e5e8d3f1def17376bfffd0f09
serverSeed (revealed): 0x1629b1fa6ab81c83f0a505abda173a09a5e9e2621fd956022951316861c14df8
chainBlockhash (revealed): 8ocXCdpr7zPjWWs42ygqTf2mknapB9LsDH6B1sdg7PPU
chainSlot: 458453253
serverSeedHash: 0x2d562a5d1eb2d4fec9b0d97470d8aaaa61231a780a3b0b45c9507d4b6a414ab0
clientSeed: 0x2a8148e61490718b74e656c5677b999ddc60c1f4fe7fb31cd937650f59d4beae
serverSeed (revealed): 0xeaea9eb5d420141644415d5ba3810cfd48e96cadd0e50f40bf2b926e2393fd37
chainBlockhash (revealed): Fi2M516GKAUKbHRsjvEsV7ZXRScKYNi2GwqJRfeaPyCM
chainSlot: 458451860
serverSeedHash: 0xf6d6018ba8f1282a8a285a0496650ae80afe119caec65f120889f92f1164b58b
clientSeed: 0x572b7cf6f31750a538161ff9e6501a9ef65e17931f839c2aecbd9853b1633efb
serverSeed (revealed): 0xb39d60c9fd7ab4d825d2c125d9d7a9716d38f1ef860a6a609e55025dce78f081
chainBlockhash (revealed): CEpNWAzphHWHppoV9RmvAYyzBZsFY2CXUFjCkQgXc1ge
chainSlot: 458450471
serverSeedHash: 0x7c54f4d26d33f856f31b02efd19773ed1a465ca01ad9e5b52c082bde55f7dfc6
clientSeed: 0x1a4e19c1547395503001acb6f6d2706d0875b786c0462ddfc3c0e788fe126188
serverSeed (revealed): 0x8dabb0278d9fca8a14ceffab04d180ed3103f0291aca9828f586993cddd217ad
chainBlockhash (revealed): DmkfHpyo9uuLXG5vMBR9DREFp7rY4q8hph4yv18W1qt5
chainSlot: 458449088
serverSeedHash: 0x5f3c0e2e262838d11752c3832d4c3312c1d839f2f725c55db616731771f6a6d3
clientSeed: 0x51f74e9d739620116aed2960620bc942a4b3527a2b173bd2957b6a198137045d
serverSeed (revealed): 0x2c30e10a5e71b9f68f90a44a578d9f37c7ef139f214ee9ec12b13b468c91d2f4
chainBlockhash (revealed): hkSeZvaUHwcUt8Vqsvz4Bxz4j8thqmCB4AzSU2EUzas
chainSlot: 458447703
serverSeedHash: 0xee2a1f02754b314c8620e0404d160e0aaa471e63c794c5e7f2bc3bd5b9d1d5d9
clientSeed: 0x3eb8a6fad159d0f71affe2da5d70c579ac85abfc519a2042a32b79a69a7f553b
serverSeed (revealed): 0x17cb184fe4f856c72fc44612ba0bc8571332751bdc02914b3bec90d7b6306d77
chainBlockhash (revealed): HPQF6eQwZkjEHGfcFCcfbckqjVNV3R1J4WscunVVud1f
chainSlot: 458446322