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): 0xaa8e15a00d1d62aadb341cec472ce00880325f13fb8da4fa8e74eaba4ea5084d
clientSeed: 0x677897768ae34d3ef8a1441854624381f314a85fafb488c33b9542908b634ce2
chain entropy: not yet, arrives with the draw
serverSeedHash (commitment): 0x1cdc6be09db284bb5085c68231f97ac94286989cd0c440a38f778518a802073a
clientSeed: 0x52c5c7d36f003b658061323ee60dc33bb60aafe64552b45dc3ea0d04b92ddd02
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: 0x7393f9d471b9905683320b13a34f5ef8ff8c92ec380bafc2b623399e5d8cc304
clientSeed: 0x12e41d21069310d913f67821c95a0ecbe3a74788d63db0a6a3853f9c3670f3f0
serverSeed (revealed): 0x13e738354f14c346cbb623ebc6d8e89095b6e5d7a0696863333c4e9577789eca
chainBlockhash (revealed): 872om5DEcSCNPPC23SGoF2t4NSFvGoVxeeXjew4xHmf5
chainSlot: 458443543
serverSeedHash: 0x5363264bb11e3a0f71b30993eb754970c3f6fca6b89b0159ec22e2a4a8585d1a
clientSeed: 0x98517b324cf212947061892d0268c2b4568e2e3de9108d2f8752d1b9faaba08c
serverSeed (revealed): 0x6554b86cdacead1e7e7c82754db3cf9d0cf7c1e0eb49d7de931995bd8b74e71a
chainBlockhash (revealed): FRt6QqTQfXbi1TCAc2MASibG8PWe7K1iwyMnSxhwrjJe
chainSlot: 458443546
serverSeedHash: 0xb7d1cebd7568f9e038359fde111689774f6f8dc12417b6e85c561f2c2b4fab17
clientSeed: 0x370b07f1ed79bcc42cc7300b0bba0dfa1602f241753f2c86d848dcba5f345520
serverSeed (revealed): 0x5c538ef3f8529fd56ac764e339ebcaf8c393808f0c98f6d9ed46e0fa02cecfa5
chainBlockhash (revealed): AmekybDx1XUGWq6n4sut6WsYBYLocTKVAewesz6DeCJ8
chainSlot: 458442166
serverSeedHash: 0x2dc3529c9443e839210cf3ee2fce9144d6d03857df2fc074d28d4c9b03baf9ad
clientSeed: 0xe7446acdb8343b25c775aefbc9df710286f7810fed5d0cadc0846c39bd892d9c
serverSeed (revealed): 0x61972795ccd6eef9df638c94f1f3033094580b4c19975e0947ad05a53f9c2294
chainBlockhash (revealed): 8pybRAKEXkzkbYFNKpU23vUZYfcA5q4kTsh27nVfunuu
chainSlot: 458440775
serverSeedHash: 0x9d3b3ee1d2ae6ddd2763cb87e4f6c2c1a614187bd7edfa46c3d6367523a23826
clientSeed: 0xd4a672d1ab296f7dc934db86263028700e9e0454301f1aabd4d54e6a5a2e69b0
serverSeed (revealed): 0x6709c33fab3b67e3beaaa0478f3f41205890a54fa9d975d17bc2ee53cb648cac
chainBlockhash (revealed): FHSm5RkLxLD2nwVJocxkxxF2M5RWyidw7y3tUihPDxXC
chainSlot: 458439395
serverSeedHash: 0xfa90b986a22bb2269ad842c5bf619607afb2fd3f924877c56c089833507733cb
clientSeed: 0x7f20b8d8a49e83536afc433085ceb4a381bfb1a180dbad9ac61919a0710aff2d
serverSeed (revealed): 0x0f31e83476c9ec2ebe164162aa9a1c28e800c45fb69bafdf8230bbc8102deef7
chainBlockhash (revealed): 17rvs3yxgjHRprUF2hSPJSZGag5HqHJyyEa7GNWf5gK
chainSlot: 458438020
serverSeedHash: 0xb571c40b93948197292493a9a07630f57d078b3f1177eae3b95a53abcd745878
clientSeed: 0xf0b41f49b0fdc5a824745c09e395d5aae1c52213453cded720dd5d6fdfb718a8
serverSeed (revealed): 0xeef8f56072ec56d80a21ee4441af14bdfc2833131d19e401627e2deb03af5fe4
chainBlockhash (revealed): E6YyF3Stkt1ZHkJ11FrrskiZTbjP77twVsdm2L46v7MG
chainSlot: 458436641
serverSeedHash: 0xed62b586b333a4983a6db7425f3e14084919859baa1b7ebc133ed845d6bf6ba5
clientSeed: 0xb497ac41e0793c3024053dcd44cf2e568820c6386243a2f26aa939a18f0b666f
serverSeed (revealed): 0xe3b6f727026bb8ea2249e1a10dd081d41683926de30e647e5c9fcf38b8ac1ba6
chainBlockhash (revealed): FX1R6214CbEk5Xm7TejxPtpUQcqBBZuCEwL7zn7FGZDp
chainSlot: 458435258
serverSeedHash: 0xc8302e04ff8aa4ebc8ab46492e3ae70f15b568a4c069fb27cc323f1db4c3302c
clientSeed: 0xbf07cd7152041581817c7dc1db93b3ada929571e5f157b31508975b930250038
serverSeed (revealed): 0xf29009c1fb692269764ee6abcd01ac067d507f24f77bb7c01577ab73dfc0c1b8
chainBlockhash (revealed): BNe6HR8B39XGYtwfraVbtbBAfv8RnyZQdj2aPkbHcbNV
chainSlot: 458433876
serverSeedHash: 0x599150076da100893d84300b500754e641e6eba0a7751412444e00aeccbc05c6
clientSeed: 0x33be19319f226c2ae8b6df4847fac63fc79f40d907e9e29d651f702d59b63aec
serverSeed (revealed): 0x735e83e8b3f28293356deae1050725299b63434876bdf41cf9783cf41cc2c27d
chainBlockhash (revealed): FQSuGxXYjG9wUAKuc3mEEeCee3rL5DG4v59A6q4U5Yop
chainSlot: 458432468
serverSeedHash: 0xa05be955cc1b815e37670d26e68bcb857a9baa806d56be6db9983cec1cd5cadd
clientSeed: 0x01efe4a159b12b9c0cb34db7b5513345adf599c37c24deca41857530c29f2c88
serverSeed (revealed): 0x94368f9bd506b7463be35ead2b3a9b403fa9b992ebbd83c78f5ff58dc1b1cbea
chainBlockhash (revealed): 3K4cDbFC3ZHqCUPDRNYZnsVbP57RBFAn1Sk2D8bfyzZ9
chainSlot: 458431089
serverSeedHash: 0xd819386376214ae12a693d28b7a7291777c3086911f8a320977d084ef18ac0c1
clientSeed: 0x5f311a47bff296b7faede2d67dc687447991c2bde29e4207c6e1571674942653
serverSeed (revealed): 0x12da6da4ce105b02d842ddcf723fcaf5ab372b11aa1a35b51cafbc8f6d9fa468
chainBlockhash (revealed): BUwo8REMkGmPSuNu1DjUrPxHaG8PdY2RX2GuX3ijdPBM
chainSlot: 458429701