Loading…

Provably Fair

Every draw on Hypeluck is decided before you click, by a server seed we publish the hash of in advance. After you rotate that seed we hand you the seed itself, and this page recomputes the round from it. Nothing here is taken on trust.

1. We commit

Your seed pair carries a server seed we keep secret and the SHA-256 hash of it, which you can read at any time. The hash cannot be changed after the fact without changing the seed.

2. You play

Every round mixes the secret server seed with your own client seed and a nonce that counts up by one per round. Change the client seed whenever you like.

3. We reveal

Rotating the server seed retires it and hands you the plain value. Hash it yourself and compare it with the hash you were shown before you played.

4. You verify

With the revealed seed, your client seed and the nonce, the calculator below reproduces the exact result the server produced.

The algorithm

From seeds to numbers

Each round takes HMAC-SHA256 with the server seed as the key and "clientSeed:nonce:block" as the message. The 32-byte digest splits into eight 4-byte big-endian integers, each divided by 2^32 to give a number between 0 and 1. Block 0 supplies the first eight numbers, block 1 the next eight, and so on.

Boxes

Box contents are sorted by probability ascending, ties broken by item id, and laid out as consecutive ranges. Multiplying a number by the total range width and rounding down lands on exactly one item. Opening several boxes at once consumes one number per box, in order.

Battles

A battle draws slots x rounds + 1 numbers from a single nonce, round by round and slot by slot within each round. The last number settles a tie.

Mines

Mines are drawn one at a time without replacement: the first number picks from all 25 tiles, the second from the 24 that are left, and so on.

Plinko

Plinko takes one number per peg row. Below 0.5 the ball goes left, 0.5 or above it goes right, and the bucket is the count of rights: bucket 0 is all left, so the payout table reads left to right.

Keno

Keno draws without replacement across the whole board: the first number picks from all 40 tiles, the second from the 39 that are left, and so on until the draw is complete.

Dice

One number per roll, spread over 10001 outcomes: multiply it by 10001, round down and divide by 100 to land between 0.00 and 100.00.

Upgrader

One number per upgrade, taken as it is and read to five decimals. You win when it falls inside the range your bet bought: it starts where you set the slider and is as wide as your chance, wrapping past 1 back to 0.

Double

One number per round, multiplied by the 15 pockets and rounded down, lands on exactly one of them.

Crash

One number per round: the crash point is 0.99 divided by one minus that number, cut to two decimals and clamped between 1x and 100x. Half of all rounds end below 1.98x.

Blackjack

The shoe is six decks, 312 cards, shuffled without replacement the same way mines are drawn: the first number picks from 312 cards, the next from the 311 that are left. It is reshuffled once a quarter of the shoe is left.

Jackpot

One number per round. Every player takes a slice of the wheel proportional to their stake, and the number multiplied by 360 degrees points at the winning slice.

Reference implementation
const encoder = new TextEncoder();

const hmacSha256 = async (key, message) => {
  const secret = await crypto.subtle.importKey(
    "raw",
    encoder.encode(key),
    { name: "HMAC", hash: "SHA-256" },
    false,
    ["sign"],
  );

  return new Uint8Array(
    await crypto.subtle.sign("HMAC", secret, encoder.encode(message)),
  );
};

export const getFairnessFloats = async (
  serverSeed,
  clientSeed,
  nonce,
  count,
) => {
  const floats = [];

  for (let block = 0; floats.length < count; block += 1) {
    const digest = await hmacSha256(
      serverSeed,
      `${clientSeed}:${nonce}:${block}`,
    );

    for (let slot = 0; slot < 8 && floats.length < count; slot += 1) {
      const offset = slot * 4;
      let value = 0;

      for (let byte = 0; byte < 4; byte += 1) {
        value = value * 256 + digest[offset + byte];
      }

      floats.push(value / 2 ** 32);
    }
  }

  return floats;
};

Check a revealed seed

Paste a revealed server seed and the hash you were shown before playing. They must be the same seed.