
Provably Fair Battle Verification
Every battle is provably fair. Before a game can start we publish the SHA-256 hash of its secret server seed together with a committed drand round — a future beacon from the League of Entropy's public quicknet randomness network. Nobody, including us, can know or influence that beacon before the drand network publishes it.
When the committed round arrives, its randomness becomes public and the outcome is derived with HMAC-SHA256: the revealed server seed keys a hash over the game ID, drand chain hash, round, and randomness, which picks the fatal chamber and who shoots first.
Enter a game ID and your browser checks the whole proof itself: the seed against its hash, the beacon fetched straight from public drand relays, its BLS signature against quicknet's public key, and the recomputed outcome. Or run the code below.
import { createHmac } from "crypto";
const serverSeed = "REVEALED_SERVER_SEED";
const publicSeed = "REVEALED_PUBLIC_SEED";
const gameId = "GAME_ID";
const round = ROUND;
const chainHash = "52db9ba70e0cc0f6eaf7803dd07447a1f5477735fd3f661792ba94600c84e971";
const input = "solroll-drand-v1:" + gameId + ":" + chainHash + ":" + round + ":" + publicSeed;
function sample(draw, sides) {
const ceiling = Math.floor(256 / sides) * sides;
for (let counter = 0; counter < 256; counter++) {
const digest = createHmac("sha256", serverSeed).update(input + ":" + draw + ":" + counter).digest();
for (const byte of digest) {
if (byte < ceiling) return byte % sides;
}
}
throw new Error("Fairness sampling exhausted");
}
const bulletPosition = sample("bullet", 6);
const starterIndex = sample("starter", 2);
const fatalShot = bulletPosition === 0 ? 6 : bulletPosition;
const winnerIndex = fatalShot % 2 === 0 ? starterIndex : 1 - starterIndex;
console.log("Fatal shot:", fatalShot);
console.log("First to shoot:", starterIndex === 0 ? "Creator" : "Joiner");
console.log("Winner:", winnerIndex === 0 ? "Creator" : "Joiner");How provable fairness works on SolRoll
A battle's result depends on two inputs that neither SolRoll nor the players can control together. The server seed is generated when the battle is created and only its SHA-256 hash is shown, so it cannot be swapped later. The drand round is committed when the second stake lands and is published afterwards by drand's quicknet network, so nobody knows it while the stakes go in.
- Commit: the server seed hash is published before the battle is funded.
- Lock: the second deposit commits a future drand quicknet round.
- Derive: HMAC-SHA256 keyed by the server seed over
solroll-drand-v1:{battleId}:{chainHash}:{round}:{randomness}with:bulletor:starterand a counter picks the fatal chamber (rejection sampling keeps all six equally likely) and the first shooter. - Reveal: after the final shot the seed is published, and the checks above can be run by anyone.
The code in the box above is the complete derivation: paste in a battle's revealed values and run it with Node.js to get the same result as SolRoll. A fair result shows the battle was not tampered with; it does not change the 50% odds or the house edge, and it is not a promise of winnings. Read the full guide to verifying a battle or see how a Solana Russian Roulette battle works.

