Fairness Protocol
Draw Protocol Specification (v1.0.0)
Formal mathematical specification of the Buzzeee commit-reveal verification protocol. Viewers can independently verify every winner in under 1 second.
Mathematical Formulation
For each winner rank $k$, a cryptographic pseudorandom 256-bit integer $X_k$ is derived using HMAC-SHA256:
HMAC-SHA256 Digest Formula
digest = HMAC_SHA256(serverSeed, `${clientSeed}:${drawIndex}:${rejectionAttempt}:${manifestHash}:${beaconValue}`)Where:
- serverSeed: 64-character unhashed hexadecimal string revealed after entries lock.
- clientSeed: Operator or community client seed string.
- drawIndex: 0-indexed integer of the winner rank being drawn (0 for 1st place, 1 for 2nd, etc.).
- rejectionAttempt: Integer starting at 0, incremented if a rejection sampling roll falls outside the uniform modulo window.
- manifestHash: SHA-256 hash of all entrants formatted as `platform:userId:weight` sorted alphabetically.
- beaconValue: External entropy (e.g. latest Bitcoin block hash or stream timestamp).
Rejection Sampling Without Modulo Bias
Simple modulo arithmetic ($X \pmod N$) introduces a statistical bias toward lower numbers when $2^256$ is not evenly divisible by the total pool weight $W$. Buzzeee eliminates modulo bias by discarding numbers in the remaining tail:
Rejection Guard Formula
const DIGEST_SPACE = 1n << 256n;
const target = DIGEST_SPACE - (DIGEST_SPACE % poolWeight);
// If the derived integer falls in the unbiased window, accept the winner:
if (x < target) {
const winningTicket = x % poolWeight;
return selectEntrantByTicket(winningTicket);
}
// Otherwise, reject and increment rejectionAttempt++ to roll again.Try the Public Verifier
Anyone can test any giveaway draw or proof bundle by visiting our browser-side verifier at /verify.
