All or nothing   Full sell-out required   No middlemen   Anyone can close   Claim your winnings   Token payments only   Fair winner selection   All or nothing   Full sell-out required   No middlemen   Anyone can close   Claim your winnings   Token payments only   Fair winner selection  
Onchain Raffle Protocol

Simple rules.
Clear outcome.
No middlemen.

Sellers lock a prize. Buyers buy tickets. Either every ticket sells and winners are picked automatically — or everyone gets their money back. That's it.

How it works
01
Create & Lock

Seller sets the prize, ticket price, total tickets, duration, and winner count. The prize is locked — no one can touch it until it's over.

02
Buy Tickets

Anyone can buy during the open window. Tickets can be gifted to another address. Per-account limits keep it fair.

03
Finalize

After the end time, anyone can trigger finalization. Sold out = success. One ticket unsold = full refund. No judgment calls.

04
Claim

Winners claim their prize share. Buyers claim refunds. Seller claims proceeds. Everything on-demand, nothing pushed automatically.

If fully sold out
Raffle
Succeeds
If any ticket unsold
Raffle
Fails
Design choices
Success condition
All-or-nothing
One clear binary: every ticket sold, or full refund. No grey zones like "80% is enough."
Payments
Tokens only
No native currency edge cases. Stablecoins or wrapped tokens keep the system clean.
Settlement
Pull, not push
Winners and buyers claim themselves. No auto-sends that can fail or get exploited.
Randomness
Past, fixed data
Winner selection uses only data already on-chain. Unpredictable retroactively, verifiable forever.
Who closes
Anyone can
Seller can't stall or refuse. Outcome depends only on the rules, not on who triggers the close.
Multiple wins
Allowed
Each ticket is one independent chance. More tickets, more chances — including winning more than once.