Sweepstake
Run a Gumball as a no-loss draw: any number of collectors enter during a set window, a public random beacon picks the winners on chain, and every other entry is refunded.
The mallow Sweepstake program (sWEEpg22uXSMaDx9QjdVKeUaZtk2Vj19XusBeszTiTQ) holds every entry's funds in escrow and decides each result. Anyone can verify a draw.
- SetupBefore startCreator signs the guard update. The terms are committed on chain.
- Entries open1 hour to 7 daysOne entry per wallet. Funds go into escrow.
- DrawClose + 30 sThe drand round is verified on chain and the winners are fixed.
- DeliveryRight after the drawmallow mints each prize to its winner. Everyone else is refunded automatically.
- RecoveryDay 7 onwardAny open entry gets everything back, fee included.
Entering
The entry modal shows the full cost before you sign:
| Item | If you're not selected |
|---|---|
| Deposit: the ticket price | Refunded |
| Account rent: for the artwork's account and your entry | Refunded |
| Entry fee: 0.011 SOL | Not refunded |
| Estimated network fee | Not refunded |
- One entry per wallet. Entries are final
- Tickets are numbered from #1 in order of entry
- If the payment token has a freeze authority, the modal warns you: a freeze can hold up your entry, mint or refund
- If you win, the button shows Delivering to your wallet... while mallow mints your artwork. If it hasn't arrived after 5 minutes, the button becomes Claim artwork and you can mint it yourself
- If the machine can no longer mint, the page shows Delivery failed, and the entry is recovered in full on day 7
Creating a Sweepstake
- Who: verified creators, in New artwork mode. Pre-minted and burn-requirement Gumballs can't run one
- How: choose Sweepstake as the Allowlist type. There are no allowlist phases, and each wallet gets one entry
- Price: one ticket price, in SOL or a supported SPL token (Token-2022 included)
- Timing: a scheduled start at least 2 minutes away. Entries stay open for 24 hours, 48 hours or a custom length between 1 hour and 7 days
- Artworks: all must be loaded before it goes live. Leftover artworks after the draw stay unminted
The last step of creating asks you to sign a guard update. It blocks minting until entries close, lets only the Sweepstake program approve a mint, and hands it the guard's authority, so no one can change the guard while the sweepstake is live. If you skip it, the studio shows Setup pending until you sign.
| Before the first entry | After the first entry | After entries close | |
|---|---|---|---|
| Edit price, start, duration or artworks | Yes, with one re-signed guard update | No | No |
| Cancel Sweepstake (creator) | Yes | No | No |
| Cancel for tampering (anyone) | Yes | Yes | No |
A cancel for tampering needs proof on chain that the machine changed: its mint authority, an artwork minted, or its artwork count. Every entry is then refunded in full. While setup is pending, Remove Sweepstake turns it back into a normal Gumball.
How the Draw Works
- Unpredictable: the drand round is the first
evmnetround starting 30 seconds after close. It is fixed before entries open, and no one can know its value until it's published - Unreusable: the seed binds the program, the sweepstake, the machine and its setup, so a round can't be replayed for another draw
- Fixed: the draw settles once. It freezes the entry count, and no entries are accepted after it
- Fair: the shuffle is a permutation, so exactly
ktickets win and every ticket has the same chance
Verifying a Draw
You don't have to trust mallow. Open Draw details on the Gumball page for the values you need:
| Field | Meaning |
|---|---|
| Draw round | The committed drand evmnet round |
| Seed | The seed the program stored (hex) |
| drand randomness | SHA-256 of the round's signature (hex) |
| Winners | k of n |
| View manifest | The public draw manifest, once every entry has closed |
| Evidence hash | SHA-256 of the manifest file |
Tickets on the page start at #1. The manifest and the script below use the index, which is the ticket number minus 1.
Check the drand Round
curl https://api.drand.sh/04f1e9062b8a81f848fded9c12306733282b2727ecced50032187751166ec8c3/public/<round>randomness must equal drand randomness, and must be the SHA-256 of signature. The round must be the first one starting at or after close + 30 s: round r starts at 1727521075 + (r − 1) × 3.
Recompute the Winners
Shuffle each ticket index with the seed. A ticket wins when its position is below k. If k ≥ n, every ticket wins.
Check the Manifest
curl -s <manifest-url> | sha256sumThe output must equal Evidence hash. When the sweepstake's account closes, a second manifest adds the closing transaction; the first stays online unchanged.
Run It All at Once
This script runs steps 1 to 4 against a manifest. It needs Node.js 20 or newer and nothing else.
# Whole draw: every line prints true
npx tsx verify-draw.ts <manifest-url> <evidence-hash>
# One ticket, before the manifest exists
npx tsx verify-draw.ts ticket <seed> <n> <k> <ticket-index>To also check the drand BLS signature and every transaction against the chain, use the open-source SDK verifier with any full-history Solana RPC:
npx -p @mallow-labs/mallow-sweepstake-sdk mallow-sweepstake verify <sweepstake-address> --rpc <rpc-url> --drand-mirror
npx -p @mallow-labs/mallow-sweepstake-sdk mallow-sweepstake verify-manifest <manifest-url> --rpc <rpc-url>The sweepstake address is sweepstake in the manifest.
Trust Model
Enforced by the Program
- The committed drand round and its signature check
- The seed, which entries win, and exactly
kwinners - Escrow of every entry's funds, the deadlines and the fee rule
- Refunds only ever go to the wallet that entered
Trusted
- mallow to countersign entries and prize mints, and to deliver or refund on time. From day 7 you can recover everything yourself
- The creator not to stop mints by moving the mint authority, withdrawing the machine or changing the collection delegate. Before close this cancels the sweepstake; after, the entry recovers in full on day 7
- drand and the program's upgrade authority
- The payment token's issuer, since a freeze can delay token transfers
Ready to run a sweepstake? Head to the Create page to set up a Gumball.