What the Code asks for

Clause 2.2 of the UK Voluntary Code of Good Practice for Prize Draw Operators says winners should be picked by an independent person, or under one's supervision, “unless winners are selected by a computer process that produces verifiably random and auditable results”. It also asks operators to describe the draw mechanism on their website. More than 130 operators have signed the Code.

A random number generator on a live stream shows a number. It doesn't let an entrant check, afterwards, that the number wasn't picked or re-rolled. Provable.io publishes a hash of its secret seed before the draw and the seed itself after, so anyone can recompute the winning ticket.

How a draw works

  1. Close entries. Number the sold tickets 1 to N, as your site already does.
  2. Commit. POST /api/commit returns a serverHash. Show it on the stream or the competition page. Neither you nor anyone else can see the seed behind it yet.
  3. Choose the client seed. Pick it after the hash is up, for example from a viewer on the stream. Provable.io couldn't have known it when the seed was made.
  4. Reveal. POST /api/reveal with min 1 and max N, within 10 minutes of the commit. The response has the winning ticket number and a permanent proof page at provable.io/o/….
  5. Publish. Link the proof page from your winners page, or embed its badge.

Check one draw

A draw of one ticket from 4,999 sold. The replay button recomputes it in your browser without calling Provable.io.

GET /api/ints?clientSeed=comp_1042_main_draw&count=1&min=1&max=4999Example record
{
  "clientSeed": "comp_1042_main_draw",
  "nonce": 0,
  "serverHash": "853f6199d9fadb379847a2fb7d4d1155c7fe157b76d35fc2348bf7ab84a696f5",
  "outcome": [2655]
}
  1. Before the draw, the server commits to a seedPublish this hash before the draw, so the seed can't be swapped afterwards.serverHash = sha256(serverSeed) = 853f6199d9fadb379847a2fb7d4d1155c7fe157b76d35fc2348bf7ab84a696f5
  2. The draw is a pure function of both seedsHMAC-SHA256(serverSeed, "comp_1042_main_draw:0:0") → 1 integer in 1–4999 = [2655]
  3. After the draw, the seed is revealed and anyone can replay itserverSeed = 0983557516211cbf872d7d4f084b7fc0ba9bf5303869edb3f85bf683193bf4e0

Integration snippet

// 1. Entries close. Your system already numbers the sold tickets 1..N.
const headers = {
  "x-api-key": process.env.PROVABLE_LIVE_KEY,
  "content-type": "application/json",
};
const ticketsSold = await db.tickets.count({ where: { competitionId } });

// 2. Commit. Show commit.serverHash on the stream or the competition page.
const commit = await fetch("https://api.provable.io/api/commit", {
  method: "POST",
  headers,
}).then((r) => r.json());

// 3. Reveal within 10 minutes.
//    Choose the client seed after the hash was shown.
const draw = await fetch("https://api.provable.io/api/reveal", {
  method: "POST",
  headers,
  body: JSON.stringify({
    commitId: commit.commitId,
    clientSeed: `comp_${competitionId}_${seedChosenLive}`,
    endpoint: "ints",
    params: { count: 1, min: 1, max: ticketsSold },
  }),
}).then((r) => r.json());

// 4. draw.outcome[0] is the winning ticket.
//    Post draw.permalink on the winners page.

A badge for your winners page

Every proof page has a badge you can copy onto your own site. It shows the draw's status and links to the proof, so an entrant can check the draw without asking you:

<a href="https://provable.io/o/SHORT_ID">
  <img src="https://provable.io/o/SHORT_ID/badge.svg"
       alt="Provable.io draw SHORT_ID" height="20">
</a>

What an entrant can check

  • The hash shown before the draw matches the seed revealed after it.
  • The winning ticket recomputes from the seeds and N, with the provably fair calculator or the open-source provable-core library.
  • The draw is in that day's public transparency log, so it can't be edited later.

What stays with you

Provable.io draws the number and keeps the proof. Ticket sales, the free entry route, age and eligibility checks, prize fulfilment and your terms stay with you. For draws picked from a list of names instead of ticket numbers, see the raffle picker API.

Keys and volume

Accounts are free. Each draw is two calls, a commit and a reveal, and a live (pk_live_) key's default quota is 10,000 draws a day; email [email protected] if you need more.

FAQ

Does this make my competitions compliant with the DCMS Code?

Provable.io doesn't certify operators. It gives you the part clause 2.2 names: a computer process whose results anyone can recompute, with the commitment published before the draw. Whether your whole process meets the Code is for you and your adviser.

Do I have to send entrant details?

No. You draw a ticket number from 1 to the number of tickets sold. Names, emails and addresses stay in your own system.

Can I still do the draw on a live stream?

Yes. Show the server hash on the stream, choose the client seed, then reveal. Entrants can open the permalink afterwards and check the same winning number.

What if a competition doesn't sell out?

Draw from 1 to the number of tickets actually sold when entries close, including free postal entries if you number them in the same list.

What does it cost?

Accounts are free. Each draw is two calls, a commit and a reveal, and the default quota is 10,000 draws a day.