Fairness

Implementation

Seeds and commitment

Server seeds are 32 cryptographically random bytes encoded as 64 lowercase hexadecimal characters. Both hashing and HMAC use the UTF-8 text, not hex-decoded bytes.

serverSeedHash = SHA256(UTF8(serverSeed))

Client seeds accepted by Double are 1–64 visible ASCII characters, without spaces. They are used exactly as accepted: no trimming or normalization. The standalone verifier can also reproduce externally supplied UTF-8 seeds.

Random byte stream

block(round) = HMAC_SHA256(
  key = UTF8(serverSeed),
  message = UTF8(clientSeed + ":" + nonce + ":" + round)
)

Nonce and round are decimal integers. Round starts at zero. Each block contains 32 bytes. A byte cursor selects block floor(cursor / 32) and offset cursor % 32; more blocks are generated when needed.

The nonce starts at zero and advances once per accepted bet/round, including demo play. Rejected transactions do not consume a nonce. User identity, currency and game name are not HMAC inputs; sharing a single nonce sequence prevents stream reuse across games.

Bytes to floats

Read each consecutive group of four bytes as an unsigned big-endian integer:

f = uint32_big_endian(bytes) / 4294967296
  = b0/256 + b1/256² + b2/256³ + b3/256⁴

Every float lies in [0,1). One HMAC block supplies eight floats. These fractions are exactly representable in JavaScript and Go doubles. Mapping them into a number of events that does not divide 2³² introduces a tiny finite-grid bias; no rejection sampling is used.

Verification

After rotation, check the SHA-256 commitment, generate the byte stream, apply the documented game mapping and compare the recorded result. The server seed hash is not the HMAC key.

Reference vector:

server seed: e8df2cc3b9ccb583ce5ea92336842387
client seed: 83e27f682128eb1852b048203dfd6931
nonce: 1
first HMAC message: 83e27f682128eb1852b048203dfd6931:1:0
first four bytes: b7 08 ca 58
Dice outcome: 71.50
CasinoSports