Verify a draw
Every draw session gets a secret random value (the seed) when it is created. Before the draw we show only its SHA-256 fingerprint, so the seed cannot be changed later without the fingerprint changing. After the result is published, the seed is revealed here, and anyone can repeat the calculation:
- Check that
SHA-256(seed)equals the fingerprint shown before the draw. - List every booked number in the session in booking order (ticket ID order).
- For pick
k = 0, 1, 2…computeHMAC-SHA256(key = seed, message = "session:{id}:round:{round}:pick:{k}"), read the first 8 bytes as a whole number (top bit cleared), and take it modulo the number of booked numbers. That position is the winner (repeats are skipped).