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): 0xa483e47384a0f04f4d06004209546cd52719ed28a9f512f725036773da4b692c
clientSeed: 0xd423b90c810664b0943156a5f83d617395b1e4380395c0c801171727839a1839
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x0283206ea012650897e2fe9c1f414479cfa76a1b8f74a3fa6bb56f8532d9f55e
clientSeed: 0x104e19baeade51fb3ecb44e3e1cffbdb9564b6536a089a1b94557fc0a7e21851
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): n/a
clientSeed: 0xc7232ae2d71047eab03ff5d11ac53807851945f1f3754091bbb5f13cee458411
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0xd141a9cdbb4df966a65cb0c74863245d48c910c0b171cf2afd18e7f0c1bc3214
clientSeed: 0x5131b2aa68e920aacc3e9368129b70d342ce7bc6b0dab05039d62e1b63f33b81
chain entropy: not yet, arrives with the draw
serverSeedHash: 0x99148332baff8a34161268e748396b0cec428eacb31ecec807a39a8897cee254
clientSeed: 0x851aeefe3624d1e3e928f90e27d009515a97ef6721628c1eeea7b360e68ff26f
serverSeed (revealed): 0x7ff6a9f2037f0d2bcff9f19a0191dee967f2edff03cf8e38299d3f75e75f1fd6
chainBlockhash (revealed): CyLN7eHeuxxG51tX7WMtFGyU67BsUCUBjNvbSp1nv7Md
chainSlot: 457857001
serverSeedHash: 0x2b3a690569b6466f2e38b3f38a15c294dab47881387086cccaf35c2b306d4b64
clientSeed: 0xb72cf0baf449d01a279e2efe274b9c5d8b6cacbabd2986622c7eaa56c33c1105
serverSeed (revealed): 0x8dc28d19d41265e3ae36417f75e047e48c00060a4b33c5077bf75d3324098063
chainBlockhash (revealed): 76jQajEceVpCRJpVa5GbmXhJ25TVGhmkRTEC61ovZhSh
chainSlot: 457855601
serverSeedHash: 0x6faa7b5e451076d040f863860df3ff4de48ab15cf38b5a476047b6ff7c8c1365
clientSeed: 0x7157c25e7fa9df6d0a3f99b268444d5a2e89b0c52891b57b082fd7463a042adb
serverSeed (revealed): 0x1e6926c731f0c9f8ac94e53094fddeb429ecc3835d5e16cb7a3149237046a3e8
chainBlockhash (revealed): GCZoLCH6pMffGiJfn6y1BSGMzNgKVAbKA6f13PXZEx45
chainSlot: 457854211
serverSeedHash: 0x696e4ef0c089310f0351b99a62256575f8f11fd5e3a759ccea3c7055ab06cc21
clientSeed: 0x333dcededdcffaa1f7dbf802d5e86bba43a9bb1a2f3ae67deaf757c0f0c216fa
serverSeed (revealed): 0xf35f6767101551dc9454ab28603f6570c514a9b851ec68d27e64ef0d805d203e
chainBlockhash (revealed): 44aeMuQaogHgbtSYcBiDte71hERtXNYzLmHwUBH7nUdW
chainSlot: 457852828
serverSeedHash: 0xdca2e495d550eb311c97098bbef66126cbbdbddbb3339306cd9b7ca5db42225d
clientSeed: 0x859b35a0fcb5cbb2ce1c8190a2e906c7a719e63daad1f794edd036a70bb0fc01
serverSeed (revealed): 0x045397b8bfe7c3f0952a3edc59507185230b3d2508b4733cf2d1f8ffc85ac7ab
chainBlockhash (revealed): DWAh6K3RFyD6sExvcqwZ9USrdjiWBhWLshzeBNbVFXkT
chainSlot: 457851429
serverSeedHash: 0xbb558094bdcb33e566333926a118bb3f76e9580bee5a22f3129cd072b70c2b2c
clientSeed: 0x7bdad9140a3d19fed105ab0543c38f6f792b5eb62cf2b62f9df3fc44da8e7a30
serverSeed (revealed): 0x688ea8193c5550cfcb5a00d1d8c4d2f9fc41eb9072b0a00bf2d3bbee2851391b
chainBlockhash (revealed): 5t2m42KDijakZBtwpkCstVCVMboHptfme42F3QeBRMct
chainSlot: 457850059
serverSeedHash: 0x23b18bad189f3dad1fe2ef5d2e95413dae14db437065939d47eec3652f9f540f
clientSeed: 0xa80028821edb1bc84c65c4f9bda9b689d2cb210019ac11d935eb33d4595044c8
serverSeed (revealed): 0xad93b9f4dd581b13534331640db6c3c4abc47e4510ce90c0376541f31d48da54
chainBlockhash (revealed): Ft2DSV9vLdKs22WbvLht5FLS64jAfMrAM19h59CCLMrq
chainSlot: 457848678
serverSeedHash: 0x694d3589cb34b5cc511b9a26d82717d3417d92e567a1dc725b3b9ce4984c0394
clientSeed: 0x33756b2334adf90358063fbcab70bfd5d26aa293d73a98d83fde0e3c6209f525
serverSeed (revealed): 0x7ff555905c2b13478e13957dbac5c55f529223a7403b813317748a56fa814979
chainBlockhash (revealed): JAX6Q7hoMGqCFVi1vy52PH7Va7SaMFj79bJhLQQ6Nvaa
chainSlot: 457847300
serverSeedHash: 0xa2aced849a5e755672f165866280544bb7b20fbc375a5a02e45b80a4d5ceef39
clientSeed: 0x5f43933dde8e7cbf9fa7a61f048a88278b9e3036cfa5f88b63570c5248087a22
serverSeed (revealed): 0x538041c3bfd192cea43b7804c0149ab6e22e47d1223bd0382bfe091ba4a01a4c
chainBlockhash (revealed): G3WzCm3L9TJvR4TLELGPmt1D9tNvmuM6UjFyhJToK6EF
chainSlot: 457845916
serverSeedHash: 0x4f6ae9257ee28bdebe8e5884137f88f4195f4a8871f9b5e787aeb5cb6e3d4061
clientSeed: 0x1926232e8e02b348a19b5d41f0c6e0ba4b672aaf7e30d67fb0b9ca5d56b0b380
serverSeed (revealed): 0x80bf013666c44061ac79c48b85cf51cfd904881893605e19e38011604dd4ee1b
chainBlockhash (revealed): CZrQg38yXRGRFGr9hroFAZBPoZCzFxfyNkcPrLBwwdaZ
chainSlot: 457845915
serverSeedHash: 0x9a2f2be38db83f56c91272f1982f6da96cb3ee6aa96de5ea2e97f60e219cba93
clientSeed: 0x5ef026af7dc85b22fe959e4047cf2a44215490d5d19f85f4a8244a0c2e4f010d
serverSeed (revealed): 0x59234d2b52de2564f7b71e33c075becb994368844a4e7c5e34b1d6ad891d958c
chainBlockhash (revealed): ApMxQvhmSUyWgkgApLe74tEcDJFABHstf8TjtGB5rKuG
chainSlot: 457844527
serverSeedHash: 0x108c16f11677aeb7c2de48d356b540e0e760855637b3654210063a1bad8b7e03
clientSeed: 0xe4c92a0d4f956d9e49c777112ae9fd2f71e15c4ded2d4e1e7299a60f97cb8ba0
serverSeed (revealed): 0x72e2013760efce8507f64ec27297fa7414b85754a14f72d674086975ae936070
chainBlockhash (revealed): 5s7DiWbuQrAQ31kLkyRkFC6JGgpFoLJyCXjKk4x16xoj
chainSlot: 457843141