A random drawing with evidence, not just an outcome
Raffle locks the eligible ticket population, commits to secret randomness before the drawing, records every selection in an append-only hash chain, and reveals the evidence needed to independently reproduce the exact order.
Algorithm version 1.0
How the random pull is made verifiable
The method creates evidence before, during, and after the drawing. Each stage narrows the opportunity to change an outcome without detection.
-
1
Lock the ticket pool
Eligible tickets are sorted into a deterministic snapshot. SHA-256 records the exact population before activation.
-
2
Commit to a secret seed
PHP random_bytes(32) creates a cryptographically secure server seed. Only its SHA-256 commitment is published before the first pull.
-
3
Add ceremony entropy
A public value entered at the event is combined with the committed seed and the locked ticket-pool hash.
-
4
Select without bias
HMAC-SHA256 produces each candidate selection. Rejection sampling avoids the unequal ranges caused by simple modulo selection.
-
5
Chain every event
Each state change and ticket pull includes the prior event hash, so alteration, insertion, deletion, or reordering can be detected.
-
6
Reveal and reproduce
After completion, the server seed is revealed. The commitment, final seed, ticket order, and event chain can all be recomputed.
Precise language matters
What “NIST-aligned” means here
NIST describes public-verifiability applications as committing up front to a deterministic operation, deriving a seed from committed and later randomness, and then performing the promised operation. Raffle follows that architecture while adding a locked ticket hash, rejection sampling, selection proofs, and an event hash chain.
SHA-256 is part of NIST's Secure Hash Standard. The initial secret seed comes from PHP's random_bytes(), which PHP documents as producing cryptographically secure, uniformly selected random bytes suitable for long-term secrets.
Reports for financial review
Everything needed to trace the drawing
A completed audit workbook separates summary evidence from detailed source records, while retaining the keys needed to reconcile each result.
Audit Summary
Draw identity, algorithm version, timestamps, commitments, revealed seed, and integrity result.
Locked Ticket Pool
Every imported ticket, deterministic pool position, and grand-prize split election.
Complete Event Log
Exact elimination order, pause/resume events, selection proofs, and chained hashes.
Prize Winners
First draw, every 50th draw, final winner or split recipients, ticket identity, and split election.
Review the 800-ticket demonstration package
The sample includes 795 eliminations, a pause and resume, 16 milestone prizes, and a five-way $10,000 split. All names and results are synthetic.