If you sign up at Stake through this site's referral links, this site may earn a commission. What this site writes does not change with that relationship.
Stake guide in English · Stake Originals · provably fair
How to verify a bet on Stake (provably fair)
Information about Stake for English-speaking players, put together by an independent affiliate website. This is not Stake.
- Independent affiliate site, not Stake
- Facts quoted from Stake's own pages
- This site may earn a commission if you sign up through its links
- Affiliate disclosure
The short answer
You check a Stake Originals bet after the fact, from three inputs. Before you bet, Stake shows a hashed version of its server seed. Your client seed and a nonce (a counter that goes up with every bet) go in with it. When you rotate the seed pair, Stake reveals the server seed: you check that it gives the hash you saw before, then recompute the result with the functions Stake publishes. The program on this page does both. A match shows the result was fixed before you bet and was not changed afterwards. It does not make any game a good bet and it predicts nothing.
Check a Stake Originals result yourself, with copyable code
What you need
- The hashed server seed Stake showed you before the bets you want to check. Stake's Implementation page says it gives this hash before any bet, so that the seed behind it cannot be changed.
- Your client seed. Stake's page says one is created for you by your browser at registration, and that you can set your own in the fairness settings.
- The nonce of the bet. Stake's page describes it as a number that increments with every new bet on the same client seed and server seed pair.
- The revealed server seed. Stake reveals it only after you rotate the seed pair, which also starts a new one.
- A computer with Node.js, to run the program below. It needs no packages and sends nothing anywhere.
Step by step
- Before betting, open Stake's fairness settings and copy the hashed server seed of the active pair. If you want your own input in the randomness, set your own client seed now.
- Place your bets. Each bet on this seed pair uses the next nonce, so you can count which nonce the bet you want to check used.
- Rotate the seed pair in the same settings. Stake then shows the previous server seed in full and starts a new pair.
- Save the program below as verify.mjs and run it with the revealed server seed, the hash you copied, your client seed and the nonce.
- Check that the program says the hash matches. Then compare its Dice or Limbo line with the result Stake showed for that bet. If you are not sure which nonce a bet used, run the neighbouring nonces too.
The program
The first part copies Stake's published functions: HMAC-SHA256 keyed with the server seed turns the client seed, the nonce and a round counter into bytes, and every four bytes become one number between zero and one. The second part is this site's: it hashes the revealed seed with SHA-256 and prints the Dice roll and the Limbo result Stake's Game Events page defines for that number.
Example command (seeds made by this site for the example, not from a Stake account)
node verify.mjs 1eaa1bde3e9e47781c03d6618c3fa099b382940f819520e2ad4ed9667db900ca 8f73b648ca19acf869035da0bb208d88e352d35baa2c8583fde00ef358aa0b9e casinoproofs-example 0What the example prints
sha256(server seed) 8f73b648ca19acf869035da0bb208d88e352d35baa2c8583fde00ef358aa0b9e
matches the hashed seed yes
first float 0.4408371450845152
Dice roll 44.08 (published line: 44.088122879902365)
Limbo result 2.24xverify.mjs
// CasinoProofs: check one Stake Originals bet from its seeds, with Stake's published provably fair functions.
// Node.js 18 or later, no packages. Run:
// node verify.mjs <server seed> <hashed server seed> <client seed> <nonce>
//
// Part 1 copies Stake's published functions (pages "Implementation", "Conversions" and "Game Events" under
// stake.com/provably-fair). Three changes, none touches the maths: the star in "function*" is added so the published
// generator runs, lodash's chunk helper is replaced by a plain loop, and Limbo's house edge, which the published snippet
// names only in a comment ("houseEdge of 0.99"), is a parameter with that value as its default. Part 2 is ours.
import { createHash, createHmac } from "node:crypto";
// ---- Part 1: Stake's published algorithm ----
// "Implementation": bytes from HMAC-SHA256 keyed with the server seed, over clientSeed:nonce:round
export function* byteGenerator({ serverSeed, clientSeed, nonce, cursor }) {
let currentRound = Math.floor(cursor / 32);
let currentRoundCursor = cursor;
currentRoundCursor -= currentRound * 32;
while (true) {
const hmac = createHmac("sha256", serverSeed);
hmac.update(`${clientSeed}:${nonce}:${currentRound}`);
const buffer = hmac.digest();
while (currentRoundCursor < 32) {
yield Number(buffer[currentRoundCursor]);
currentRoundCursor += 1;
}
currentRoundCursor = 0;
currentRound += 1;
}
}
// "Conversions": every 4 bytes become one float between 0 and 1
export function generateFloats({ serverSeed, clientSeed, nonce, cursor, count }) {
const rng = byteGenerator({ serverSeed, clientSeed, nonce, cursor });
const bytes = [];
while (bytes.length < count * 4) bytes.push(rng.next().value);
const floats = [];
for (let i = 0; i < bytes.length; i += 4) {
floats.push(bytes.slice(i, i + 4).reduce((result, value, j) => result + value / 256 ** (j + 1), 0));
}
return floats;
}
// "Game Events", Dice: one float per bet (cursor 0)
export function diceRoll(float) {
const roll = (float * 10001) / 100;
return roll;
}
// "Game Events", Limbo: one float per bet, house edge 0.99 as published
export function limboResult(float, houseEdge = 0.99) {
const floatPoint = 1e8 / (float * 1e8) * houseEdge;
const crashPoint = Math.floor(floatPoint * 100) / 100;
const result = Math.max(crashPoint, 1);
return result;
}
// ---- Part 2: ours ----
// Stake shows the hashed server seed before the bets and reveals the seed itself after you rotate it. The pages read
// for this program do not name the hash function; SHA-256 of the seed text is what this program tries. If it does not
// match, use Stake's own "Unhash Server Seed" page before drawing any conclusion.
export function sha256Hex(text) {
return createHash("sha256").update(text).digest("hex");
}
// Dice shows two decimals; the published line has no rounding step, so the roll is also printed cut to two decimals.
export const diceTwoDecimals = (float) => Math.floor(float * 10001) / 100;
export function check({ serverSeed, hashedServerSeed, clientSeed, nonce }) {
const [float] = generateFloats({ serverSeed, clientSeed, nonce, cursor: 0, count: 1 });
return {
hashOfServerSeed: sha256Hex(serverSeed),
hashMatches: sha256Hex(serverSeed) === String(hashedServerSeed).trim().toLowerCase(),
firstFloat: float,
diceRoll: diceRoll(float),
diceRollTwoDecimals: diceTwoDecimals(float),
limboResult: limboResult(float),
};
}
const isMain = process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\\/g, "/").split("/").pop());
if (isMain) {
const [serverSeed, hashedServerSeed, clientSeed, nonceText] = process.argv.slice(2);
if (!serverSeed || !hashedServerSeed || clientSeed === undefined || nonceText === undefined) {
console.log("usage: node verify.mjs <server seed> <hashed server seed> <client seed> <nonce>");
process.exit(2);
}
const r = check({ serverSeed, hashedServerSeed, clientSeed, nonce: Number(nonceText) });
const line = (label, value) => console.log(label.padEnd(26) + value);
line("sha256(server seed)", r.hashOfServerSeed);
line("matches the hashed seed", r.hashMatches ? "yes" : "NO");
line("first float", String(r.firstFloat));
line("Dice roll", r.diceRollTwoDecimals.toFixed(2) + " (published line: " + r.diceRoll + ")");
line("Limbo result", r.limboResult.toFixed(2) + "x");
}
What a match shows
- The server seed behind your bets was fixed before you placed them: you held its hash first, and a different seed would not give the same hash.
- The result follows from the published functions and the three inputs. One of those inputs, the client seed, is yours to set.
What it does not show
- It says nothing about whether a game is worth playing. Each Original's RTP and house edge are separate figures, listed on this site's RTP page.
- It cannot check the seed pair you are still using: Stake keeps that server seed hidden until you rotate it, and nothing here can tell what a future bet will be.
- The pages read for this program do not name the hash function behind the hashed server seed. If the program reports no match, check the pair with Stake's own Unhash Server Seed page before drawing any conclusion.
- The program prints Dice and Limbo only. For other Originals, Stake's Game Events page describes how the numbers become the game's result, and Stake's own calculation page reproduces it.
- It covers games that use these published functions, not slots or live tables from other providers.
Frequently asked questions
Can I verify a Stake bet without using Stake's own calculator?
Why can't I check the seed I am using right now?
Does changing my client seed change the odds?
Which Stake games can be checked this way?
Does a successful check mean the next bet will win?
Stake's published pages used here (archived copies)
Related Stake pages
When you are ready, go to Stake. Read its terms before you sign up, and check the rules where you live.