Provably Fair

After a round, you can reproduce the shuffle and check every card.

The Protocol

  1. 1
    Save the commitment. The server generates 32 random bytes and publishes their SHA-256 hash before play. Save this hash so you can compare it with the revealed seed after the round.
  2. 2
    Choose a client seed. You can use the generated value or enter your own before the first deal. Choosing your own after saving the commitment adds an input the server did not choose.
  3. 3
    Combine the inputs. The shuffle seed is derived using HMAC-SHA256 with the server seed as key and client_seed || nonce as data. Changing your client seed does not change the server commitment.
  4. 4
    Check the result. After the round, the server reveals its seed. Check that its SHA-256 hash matches the commitment, reproduce the shuffle, and compare the dealt cards with the audit transcript.

The Shuffle Algorithm

The shuffle uses Fisher-Yates (Knuth) with a counter-mode HMAC-SHA256 PRNG. Each random index is generated as:

random_bytes(i) = HMAC-SHA256(key: shuffle_seed, data: <<i::big-64>>)

The 32-byte result is decoded as a big-endian unsigned integer and reduced modulo the current range. This introduces a negligible bias: the range is at most 52, while each result has 2²⁵⁶ possible values.

Nonce

The nonce increments with each new round within a session. It ensures that even if you reuse the same client seed, each round produces a different shuffle. The nonce is visible in every audit transcript.

Algorithm Version

faro-shuffle-v1

The algorithm version is embedded in every audit transcript. Future algorithm changes will use a new version identifier, preserving the ability to verify historical rounds.

Verify Yourself

After a round, you can copy the revealed server seed, your client seed, and nonce from the audit panel. Check them with the verifier below or use another HMAC-SHA256 and SHA-256 tool.

Provably fair · HMAC-SHA256 shuffle · All shuffles independently verifiable · GitHub