Verify a draw

Paste a receipt id (or the JSON from /api/result) and this page re-runs everything locally with the Web Crypto API. Source: /js/verify.js (about 40 lines, no dependencies).

Algorithm fair-draw-v1

request     = canonical JSON (keys sorted) of {v, algorithm, id, createdAt, targetRound, kind, items|n|sides, pick|count, label}
requestHash = sha256(request)
targetRound = latest drand quicknet round at commit time + 2
beacon      = drand quicknet round targetRound (server: 2 relays must agree; you: BLS G1 RFC 9380 check on this page); randomness = sha256(signature)
seed        = sha256(randomness || requestHash)          (raw bytes)
block_i     = sha256(seed || uint32_be(i)), i = 0, 1, 2, ...  read as big-endian uint64 values, 4 per block
int(m)      = draw x until x < 2^64 - (2^64 mod m); return x mod m      (no modulo bias)
pick k of L = partial Fisher-Yates: for i in 0..k-1: j = i + int(L - i); swap(i, j); output position i
shuffle     = pick L of L;  dice = int(sides) + 1, count times