# A giveaway draw nobody can rig, not even the people running it

> The new CAPPZ fair draw locks the entry list first, then picks winners from an XRP Ledger hash that didn't exist yet. Anyone can re-check the result in a browser. It costs 0.1 XRP per draw and runs on a small edge node.

By CAPPZ.AI · November 16, 2026 · Source: https://cappz.ai/news/a-giveaway-draw-nobody-can-rig

Every online giveaway ends the same way. The winner is announced, and within minutes someone asks whether it was rigged. The organizer posts a screen recording of a "random name picker", and that proves nothing: the picker could have been run ten times off camera, or the list quietly edited before the recording started.

The same doubt hangs over audit samples ("why these twenty invoices?"), reviewers chosen "at random", and any selection by lot where someone cares about the outcome. A random pick is only worth something if the people who lose believe it.

New in the open-source [CAPPZ SDK](https://github.com/CAPPZ-ai/cappz-sdk) 15.47, the **fair draw** is a draw whose fairness anyone can check for themselves, without trusting the organizer or the service that ran it. It is live on the CAPPZ Marketplace for 0.1 XRP per draw.

## Lock the list before the randomness exists

A draw has two parts that can be manipulated: the list and the randomness. The fair draw fixes the list first and takes the randomness from a source that didn't exist yet when the list was fixed.

**1. The list is locked and published.** The organizer sends the entries, one per line, or only the list's SHA-256 fingerprint if the names should stay private. They choose the number of winners and a draw time, and pay. The node then signs a **commitment**: the list's fingerprint, its size, the number of winners and the draw time. The commitment goes onto a public log at once, and each entry names the one before it, so none can be removed without it showing. The organizer shares the commitment link before the draw. Change one name afterwards and the fingerprint no longer matches.

**2. The randomness comes from the XRP Ledger.** About every four seconds the XRP Ledger closes a ledger: a page holding every transaction submitted around the world in those seconds, settled when the network's validators agree. Its fingerprint, the ledger hash, changes completely if a single transaction changes. The draw uses the hash of **the first validated ledger that closes at or after the draw time**. Nobody can know that hash in advance: not the organizer, not the entrants, not the node.

**3. The winners follow by plain arithmetic.** The ledger hash and the list's fingerprint are combined into a seed. The seed shuffles the list like a deck of cards, with every entry given exactly the same chance (a partial Fisher–Yates shuffle with rejection sampling, which avoids the small biases quick code tends to have). The rule, `cappz-draw/v1`, fits in four lines and is published with the tool:

```text
seed   = sha256("cappz-draw/v1|" + ledgerHash + "|" + listSha256 + "|" + count + "|" + winners)
stream = sha256(seed ‖ counter), read as 32-bit numbers
pick n = next number below 2^32 − (2^32 mod n), then that number mod n
picks  = for each place i: j = i + pick(count − i); swap entries i and j; entry i wins
```

## Why a second try doesn't help

The obvious way to cheat a draw is to run it until you like the answer. Here that buys nothing. The seed depends only on the ledger and the list, so the same list drawn on the same ledger always gives the same winners. A different list means a new commitment, which is paid for and lands on the same public log, where a second commitment for one giveaway is plain to see.

The node can't cheat either. It only does arithmetic on public data. If it reported the wrong winners, every check would fail.

## Check it in the browser

Organizers can ask for a **public result page** to share with their audience. Opening it runs every check in the visitor's own browser, with no trust in the site that serves it:

```text
✓ draw signed by this node
✓ commitment signed by this node, and the draw names it
✓ the draw used exactly the committed list, size, winners and time
✓ list locked 4:35:10 PM, before the draw time
✓ the entries shown match the committed fingerprint
✓ seed follows from the ledger hash and the list
✓ winners recomputed from the seed
✓ XRP Ledger (testnet) confirms ledger 22381500 has this hash
✓ ledger 22381500 is the first closed at or after the draw time
```

That is the checklist from the first live draw, run on the XRPL testnet on November 16. The page reads the ledger directly from a public XRP Ledger server, and checks the signatures with the browser's built-in cryptography. For records, or for an auditor who wants nothing to do with a web page, a single-file verifier with no dependencies runs the same checks offline: `node verify.mjs draw.json`.

## Who signed it

Every commitment and result is signed by the node's key. Since SDK 15.45, a node's payout account can vouch for that key on the XRP Ledger itself, by approving one transaction in the Xaman wallet that changes nothing on the account. From 15.47 the node finds that declaration in its payout account's history by itself, and picks up renewals the same way, with no file to copy.

A buyer's verifier then shows "declared on the XRP Ledger by wallet r…", the same address they paid. Trust rests on a wallet the buyer can see on the ledger, not on a website's certificate or its domain name. If the key is ever revoked, signing stops within minutes and every verifier sees it.

## What it costs

| Item | Cost |
|---|---|
| One draw (commitment, draw, signed result, optional public page) | 0.1 XRP, paid once up front |
| XRP Ledger network fee for the payment | about 0.00001 XRP |
| Account, sign-up, API key | none |
| Trying it on the XRPL testnet | free (test XRP from the public faucet) |

Lists can hold up to 10,000 entries inline, or up to a million when only the fingerprint is sent. A draw can pick up to 1,000 winners and can be scheduled up to 30 days ahead, so an organizer can announce "entries close Friday, draw Saturday at 8 pm" and publish the commitment in the same post.

## Where it fits beyond giveaways

- **Audit sampling.** Lock the invoice IDs, publish the fingerprint, and let the ledger choose the sample. The auditor and the audited can both re-run it, and the list itself can stay private until someone needs to check.
- **Selection by lot.** Reviewers, committee members, study groups or spot checks, chosen in a way nobody inside or outside can later call cherry-picked.
- **Agents breaking ties.** AI agents call it over plain HTTP like any CAPPZ paid agent, with a served `SKILL.md` and `llms.txt`, and pay per draw from their own wallet.

One caution for organizers: in many places a prize chosen by chance with a paid entry is a lottery. The fair draw makes the pick fair; the giveaway's rules (free entry, eligibility) remain the organizer's.

## Runs on a small box at home

The fair draw is the third paid agent of the CAPPZ edge node, after the signed timestamp and the signed webhook receiver. It needs no GPU and no model, and stores no files beyond its job log. The first node selling it is a low-power ARM board on a home network, which costs well under a dollar a month in electricity. Anyone running the open-source edge node can offer it from their own payout address, set their own price, and list it on the marketplace. The operator's guide is the [running-edge-node-paid-agents](https://github.com/CAPPZ-ai/cappz-sdk/tree/main/skills/running-edge-node-paid-agents) skill.

## Try it

- **Free, on testnet:** [silwa.duckdns.org/testnet/agents/#try-draw](https://silwa.duckdns.org/testnet/agents/#try-draw)
- **Mainnet, 0.1 XRP:** [silwa.duckdns.org/agents/#try-draw](https://silwa.duckdns.org/agents/#try-draw)
- **A live result page:** [the first testnet draw](https://silwa.duckdns.org/testnet/agents/draw/draws/job-c4bee4c0294b8da0)
- **For agents:** `cappz-market hire https://silwa.duckdns.org/agents/draw --input '{"entries":["ann","bob","cy"],"winners":1,"public":true}' --max 0.1`
- **The code:** [packages/cappz-edge-node/agents/draw.ts](https://github.com/CAPPZ-ai/cappz-sdk/blob/main/packages/cappz-edge-node/agents/draw.ts), Apache-2.0

The question "was it rigged?" usually gets a shrug and a screen recording. Now it can get a link where the answer checks itself.

---

CAPPZ.AI News: https://cappz.ai/news · RSS: https://cappz.ai/news/rss.xml
