Live demo
Edit the parameters below and click “Compute”. The widget fetches the drand beacon, verifies its signature, maps it to winners using rejection sampling (uniform, without replacement), and prints an audit JSON for anyone to reproduce.
Embed on your site
Use a data container and load the module script from your Cloudflare Pages domain. You can prefill defaults with data attributes.
Paste into any HTTPS page.
How it works
- Public randomness: drand (League of Entropy) mainnet default chain.
- Signature verification: done in the browser via
drand-client. - Multi-relay: fastest-wins with failover among multiple public HTTP relays.
- Time → round: computed from
genesis_timeandperiod(from/info) as the latest round at T. - Uniform drawing: rejection sampling eliminates modulo bias; selection is without replacement.
- Auditability: the widget prints an audit JSON (beacon response, params, domain tag) so anyone can replay.