OPDUEL

Fairness

OPDuel Originals

Limbo

Plinko

Keno

Roulette

Mines

Blackjack

Roll

Dice

Provably Fair Keno

Keno draws 10 numbers from a pool of 40. Pick your numbers before the draw, and your payout scales with how many you match.

Verify Game Fairness

The algorithm uses selection without replacement - each number is removed from the pool after being drawn, ensuring no duplicates.

The Algorithm

// Step 1: Generate 10 floats (needs 40 bytes = 2 hash rounds)
const floats = [];
for (let round = 0; round < 2; round++) {
    const message = `${clientSeed}:${nonce}:${round}`;
    const hash = HMAC_SHA256(serverSeed, message);

    // Extract floats from this round's hash
    for (let i = 0; i < 8 && floats.length < 10; i++) {
        const bytes = hash.slice(i * 4, i * 4 + 4);
        let float = 0;
        for (let j = 0; j < 4; j++) {
            float += bytes[j] / Math.pow(256, j + 1);
        }
        floats.push(float);
    }
}

// Step 2: Select numbers without replacement
const pool = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40];
const result = [];

for (let i = 0; i < 10; i++) {
    const index = Math.floor(floats[i] * pool.length);
    result.push(pool.splice(index, 1)[0]);
}

How It Works

  1. Generate floats - Keno needs 10 random numbers. Since each hash provides 32 bytes and each float uses 4 bytes, a single hash can produce 8 floats. Keno requires 2 hash rounds (rounds 0 and 1) to get all 10 floats.
  2. Create the pool - Start with numbers 1 through 40 in an array
  3. Selection without replacement - For each of the 10 picks:
    • Multiply the float by the current pool size
    • Floor to get an index
    • Remove and record the number at that index
    • The pool shrinks by 1 each time

This method ensures every number has an equal chance of being selected, and no number can be drawn twice.

Example

Given these inputs:

  • Server Seed: c5e7146c5863d7d647c93ffe7d4ec13fffbb7311108fab0c067d97bcc2b32d55
  • Client Seed: LuckyClientSeed777
  • Nonce: 1

Keno needs 10 floats (40 bytes), requiring 2 hash rounds. The floats extracted:

FloatValue
10.55862593
20.28559087
30.36156606
40.48979709
50.38374817
60.59817973
70.64279013
80.34504414
90.28650033
100.45604396

Selection without replacement:

PickFloatPool SizeIndexNumber Selected
10.55862640floor(0.558626 × 40) = 2223
20.28559139floor(0.285591 × 39) = 1112
30.36156638floor(0.361566 × 38) = 1315
40.48979737floor(0.489797 × 37) = 1821
50.38374836floor(0.383748 × 36) = 1316
60.59818035floor(0.598180 × 35) = 2026
70.64279034floor(0.642790 × 34) = 2128
80.34504433floor(0.345044 × 33) = 1113
90.28650032floor(0.286500 × 32) = 910
100.45604431floor(0.456044 × 31) = 1420

The 10 selected numbers: 23, 12, 15, 21, 16, 26, 28, 13, 10, 20.

Verify your bets by selecting the "My Bets" tab at the bottom of the page while playing, then click on the bet you want to verify. For older bets, find them in your Bet History.

    CashierHomeGamesChat





    OPDUEL