At midnight UTC on 16 October 2026, PancakeSwap closed lottery round 2,145 on BNB Chain. The lottery contract shows 487 tickets sold at 2.29 CAKE each, a pot of 16,490 CAKE, and a winning number drawn by Chainlink VRF. Only 48 tickets won anything. About 70% of the pot rolled into the next round.
That one round shows what a crypto lottery platform really is. The fair draw is solved: you can rent it. The hard parts are the prize maths, the licence and player trust. This guide covers each one, so you can plan a build, a budget and a launch market.
In this guide:
- Use Chainlink VRF v2.5 for draws. It replaced V1 and V2 on 29 November 2024, and block data such as blockhash or PREVRANDAO can be bent by block producers.
- Close ticket sales before you ask for randomness, and never let anyone re-roll a draw. These are Chainlink’s own rules.
- Pay prizes as shares of the pool, not fixed sums, unless you hold a reserve. A worked example shows where $100,000 of ticket sales goes.
- Private lotteries are shut out of the US, France, Germany, India and the UAE. Great Britain allows only charity-style society lotteries. Curaçao charges EUR 4,592 to apply and EUR 47,450 a year.
- Published 2026 agency cost guides put a blockchain lottery app at $80,000 to $120,000+ custom, and white label platforms at $40,000 to $90,000+.
What Is a Crypto Lottery Platform?
A crypto lottery platform is software that sells tickets for crypto, picks winners with randomness that anyone can check, and pays prizes from a smart contract. The player does not have to trust the operator’s word. They can read the draw result, the proof behind it and the payout on the blockchain.
Most platforms run one of four formats. Each one changes your prize maths and your licence risk.
| Format | How the winner is picked | How the operator earns | Licence risk |
| Number draw (6/49, PancakeSwap style) | Random number matched to tickets by tier | Fixed share of every pot | High: it is a lottery in every legal sense |
| Raffle or jackpot pool | One random ticket wins the pool | Share of the pool | High: a raffle is a lottery in most laws |
| No-loss lottery | Prize comes from yield on deposits; players keep their stake | Share of the yield | Lower, but still reviewed as gambling in many places |
| Instant win | Random result per ticket at purchase | House edge | High: often licensed as a casino game |
For instant games, see our crypto casino clone script. This guide covers scheduled draws, which have their own rules for timing, pools and payouts.
How Provably Fair Draws Work in 2026
A draw is only fair if no one, including you, can know or change the result before ticket sales close. That rules out most “free” sources of randomness on a blockchain.
| Source | How it works | Can it be gamed? | Use it for prizes? |
| blockhash or timestamp | Hash block data in the contract | Yes. Block producers see it first. | No |
| PREVRANDAO (Ethereum) | Reads the beacon chain’s random mix | Yes. EIP-4399 says a proposer gets one bit of bias per slot. | No, not alone |
| Commit-reveal | Players or the operator commit a secret, then reveal it | Yes, if the last revealer walks away | Only with penalties |
| Chainlink VRF v2.5 | Oracle returns a random value with a proof the contract checks on-chain | No, if you follow the rules below | Yes |
| Pyth Entropy v2 | Commit-reveal service paid in the native token | Low risk; check its design for your threat model | Yes, on supported chains |
Chainlink VRF v2.5 is the default choice. Per Chainlink’s docs, each request returns random values and a cryptographic proof, and the contract checks that proof before it uses the values. V2.5 replaced V1 and V2 on 29 November 2024, and V2 is deprecated. Many older lottery tutorials on GitHub still call V2, so treat them as reading material, not as code to ship.

The rules that keep a draw fair
Chainlink publishes eight security rules for VRF consumers. Five of them decide whether a lottery can be rigged:
- No re-rolls: never let anyone cancel or repeat a randomness request. Otherwise an insider can throw away a result they dislike.
- Close sales first: stop selling tickets the moment you request randomness. Late tickets are the classic lottery exploit.
- Callback must not revert: VRF will not retry a failed callback. Store the random word, then settle prizes in a separate call, or the round can freeze.
- Match by request ID: results can arrive in any order, so map each one to its round.
- Wait for confirmations: wait enough blocks that rewriting the chain costs more than the prize. On Ethereum the floor is 3 blocks.
What a draw costs
One draw needs one request. One request can return up to 500 random words, enough for many winners. Under Chainlink’s billing formula, you pay the gas for the proof check and your callback, plus a premium. On Ethereum the premium is 20% in LINK or 24% in ETH, and Chainlink’s own example at 50 gwei costs 0.013 ETH. On Arbitrum, Base and BNB Chain the premium is 50% to 60%, but gas is far cheaper.
VRF v2.5 runs on nine mainnets: Arbitrum, Avalanche, Base, BNB Chain, Ethereum, OP, Polygon, Ronin and Soneium.
Draw Contract Architecture
A lottery platform has an on-chain core and an off-chain shell. Keep the core small, because every line in it holds player money.
On-chain core:
- Round manager: a state machine with Open, Closed and Claimable states. PancakeSwap’s contract uses the same pattern.
- Ticket logic: ticket IDs stored in the contract, or ERC-721 tickets if players should trade them. NFT tickets cost more gas and add resale rules.
- VRF link: a contract built on `VRFConsumerBaseV2Plus` asks for random words when a round closes and stores them.
- Prize vault: holds the pot, splits it by tier and lets winners claim. Pull payments (winners claim) are safer than pushing funds to hundreds of wallets in one call.
- Admin: a multisig wallet with a time delay controls fees, pauses and treasury payouts. Players should see that no one can sweep the pot.
- Automation: a keeper, such as Chainlink Automation, that closes and draws rounds on schedule.
Off-chain shell: the app and wallet login, a way to pay in, KYC and age checks, and geo-blocking. Add a draw history page, a back office and player limits such as deposit caps and self-exclusion. A smart contract development team builds the core. The shell is where most of the hours go.
Prize Pool Economics: A Worked Example
Start with a real round. Per PancakeSwap’s lottery FAQ, 20% of each pot goes to the treasury and is burned. The other 80% is split across six tiers: 2%, 3%, 5%, 10%, 20% and 40% of the pot for matching the first one to six digits. Winners in a tier share it. Unwon tiers roll over, and PancakeSwap injects 8,000 CAKE every other round to keep pots large.

The lesson sits in the numbers. Round 2,145 sold 487 tickets, worth at most 1,115 CAKE. Yet the pot was 16,490 CAKE. Rollovers and injections, not ticket sales, carried about 93% of the prize. A new lottery has no rollover and no treasury to inject from, so your first rounds will look small. Budget for seeding the early jackpots.
An operator model you can copy
Now take an illustrative weekly draw: 50,000 tickets at $2, so $100,000 in sales. The split below is a planning example, not a rule.
| Line | Share | Per week | Notes |
| Prize pool | 50% | $50,000 | Shared by tier; unwon tiers roll over |
| Jackpot seed reserve | 5% | $5,000 | Funds early pots and guarantees |
| Affiliates and marketing | 15% | $15,000 | Usually the largest cost after prizes |
| Payments, KYC, gas and VRF | 4% | $4,000 | Varies by chain and on-ramp |
| Licence fees | 1% | $1,060 | Curaçao’s EUR 47,450 a year is about $1,060 a week |
| Operator margin | 25% | $25,000 | Before staff, hosting and tax |
Pool shares keep you solvent. If you pay tiers as shares of the pool, you can never owe more than you hold. A fixed jackpot (“win $1 million”) is different: one lucky week can owe more than the pool, so you need a reserve or insurance first. Regulators think the same way. In Great Britain, a society lottery prize cannot exceed 10% of a draw’s sales, capped at GBP 500,000.
Licences: Where Crypto Lotteries Are Allowed and Restricted
Lotteries are the most closed form of gambling. Many countries keep them as a state business and never license private firms. Write your target market list before you write any code, because the licence decides your features.
| Market | Position in 2026 | What it means for you |
| United States | Lotteries are run by states. Federal law (31 U.S.C. 5362) counts buying a lottery chance as a bet under UIGEA. | No private crypto lottery route. Geo-block US players. |
| Great Britain | Only the National Lottery, local authority and non-commercial society lotteries are allowed. Licensed society lotteries can sell up to GBP 5 million a draw and GBP 50 million a year. | Charity or sport draws only. No for-profit lottery. |
| France | FDJ holds exclusive lottery rights for 25 years under the 2019 PACTE law. | Closed to private lotteries. |
| Germany | The GlüStV 2021 treaty, in force since 1 July 2021, keeps the state lottery monopoly. | Closed to private lotteries. |
| India | State governments run lotteries under the Lotteries (Regulation) Act 1998. The online gaming law banning online money games came into force on 1 May 2026, and its stakes include tokens bought with money. | Closed. Geo-block India. |
| UAE | The GCGRA gave the first lottery licence to The Game LLC (UAE Lottery) on 28 July 2024 and says unlicensed gaming is illegal. | Closed without a GCGRA licence. |
| Malta (MGA) | The MGA’s Type 1 games include lotteries and secondary lotteries. Open to EU and EEA companies. | The strongest licence for a private online lottery, with the highest bar. |
| Curaçao (CGA) | The LOK online licence costs EUR 4,592 to apply and EUR 47,450 a year for B2C. Local lotteries sit under separate rules. | The usual crypto-first route. Confirm with the CGA that your draw format fits the online licence. |

Two traps catch new operators. First, a “no KYC” promise does not lift your money laundering duties, and every licence above asks for ID and age checks. Second, a smart contract cannot be switched off, but your website, app and on-ramps can be. If you sell into a closed market, regulators go after the parts they can reach. The blockchain fantasy sports and sportsbook prediction market guides show the same pattern in their own markets.
This is general information, not legal advice. Hire a gaming lawyer for each market you plan to serve.
Launch a Provably Fair Crypto Lottery Platform
Crypto Lottery Platform Development — done right.
- Fair draws: Chainlink VRF v2.5 randomness with on-chain proof checks and no re-rolls.
- Draw contracts: round manager, ticket logic, prize vault and timelocked admin controls.
- Prize models: tiered pools, rollovers, jackpot seeding and claimable payouts.
- Compliance layer: KYC, age checks, geo-blocking and responsible gambling tools for your licence.
Get a white label or custom crypto lottery built for your markets.
Book a Free Demo to see the draw flow and plan your launch.
How to Build a Crypto Lottery Platform, Step by Step
- Pick the licence and markets. This sets KYC, geo-blocking, payout limits and responsible gambling features.
- Choose the format and prize model. Decide tiers, ticket price, draw times, rollover rules and how you seed the first pots.
- Choose the chain. Use a VRF-supported network with low gas. Ticket fees of a few cents matter when tickets cost $2.
- Write the draw contracts. Build the round manager, tickets, VRF link, prize vault and a time-delayed admin.
- Build the shell. App, wallets, on-ramp, KYC, geo-blocking, back office, draw history and player limits.
- Test hard. Use Chainlink’s VRF mock coordinator to simulate thousands of draws. Test late tickets, failed callbacks and rounds with no winners.
- Audit and certify. Get an independent smart contract audit. Your regulator may also ask for an RNG or systems test from an approved lab.
- Launch with limits. Start with capped pots, alerts on the VRF subscription balance and a public draw history page.
If you also plan a token for tickets or rewards, plan it early with a crypto token development team, since a token can raise securities questions.
Cost and Timeline
Published 2026 agency cost guides put a full lottery app at $30,000 to $150,000+. Within that range, a blockchain lottery app runs $80,000 to $120,000+ custom, and a white label lottery platform $40,000 to $90,000+. The same guides put yearly maintenance at 15% to 25% of the build cost. Security audits for crypto apps add $10,000 to $40,000 or more.
| White label | Custom build | |
| Market cost range | $40,000 to $90,000+ | $80,000 to $120,000+ |
| Draw contracts | Pre-audited, configured | Written for your format |
| Prize model | Set tiers, adjustable | Any model, including fixed jackpots with reserves |
| Best for | Proving demand in one licensed market | Several markets, NFT tickets or a token |
Running costs sit on top: licence fees, VRF and gas, KYC checks, hosting and the jackpot seed fund, which is often the largest in year one.
For timing, Coinsclone’s crypto casino page quotes 4 to 6 weeks for a white label casino and 10 to 14 weeks for a standard custom build. Licensing often takes longer than the code, so start it on day one.
Risks and Mistakes to Avoid
- Weak randomness or a frozen round: block data can be bent, and a callback that reverts leaves the pot stuck.
- A sweepable pot: an admin key that can withdraw the prize vault destroys trust. Use a multisig, a timelock and public addresses.
- An unfunded subscription: Chainlink warns that a balance near the minimum can delay draws. Set alerts well above it.
- A fixed jackpot without a reserve, or no seed budget: one big win can sink you, and early pots look weak.
- Leaky geo-blocking: one closed market reached by your app can cost you your licence.
How to Choose a Partner and Prepare for a Scoping Call
Ask any vendor for a live draw contract on VRF v2.5, a recent audit and a draw history page. Ask how they handle failed callbacks, hold admin keys and geo-block, and check that you get the full source code.
Bring four things to the first call: your target markets and licence plan, your draw format and ticket price, your prize model with seed budget, and your chain choice. With those, a team can give you a real scope in one meeting.
Coinsclone has been building since 2018 and has delivered 350+ platforms for 200+ clients across 20 industries. If your draws sit inside a wider gaming product, our crypto casino platform is the closest starting point, and the team can scope the draw format, prize model and chain with you.
Frequently Asked Questions
What is a crypto lottery?
A crypto lottery is a lottery where players buy tickets with cryptocurrency and a smart contract runs the draw and pays the prizes. The best ones use verifiable randomness, such as Chainlink VRF, so anyone can check that the result was not rigged.
Is there a crypto lottery that is legal?
Yes, but only where a regulator licenses it. Malta’s MGA licenses lotteries as Type 1 games, and Curaçao’s LOK licence is the usual crypto-first route. Private lotteries are shut out of the US, France, Germany, India and the UAE. Great Britain allows only charity-style society lotteries.
Can you start a lottery business or company?
You can start a firm that builds lottery software in most places and sell it to licensed operators. Running the lottery yourself needs a gaming licence in each market you sell to. In many countries only the state may run one. There, your route is to sell your tech to the state operator.
How much does Chainlink VRF cost?
You pay gas for verification and the callback, plus a premium. On Ethereum the premium is 20% in LINK or 24% in ETH, and Chainlink’s own example at 50 gwei comes to about 0.013 ETH per request. On Layer 2 networks the premium is higher but gas is far cheaper, and one request can return up to 500 random words.
How does a blockchain lottery system work?
Players buy tickets through a smart contract, which closes sales at a set time. The contract then asks an oracle for a random number, checks the proof on-chain, matches the number to tickets and lets winners claim their share of the pot.
Can I use an open source lottery smart contract from GitHub?
You can learn from it, but do not ship it as is. Many public examples pick winners from block data or call the old VRF V2. Any contract that will hold player money needs VRF v2.5, your own prize logic and an independent audit.
What is bitcoin lottery mining?
Bitcoin lottery mining is solo mining with a small machine, in the hope of finding a whole block by luck. It is not a lottery platform. The odds are tiny, but a lucky miner keeps the full block reward, which is 3.125 BTC plus fees since the April 2024 halving.
How much does it cost to build a crypto lottery platform?
Published 2026 agency cost guides put white label lottery platforms at $40,000 to $90,000+ and custom blockchain lottery apps at $80,000 to $120,000+. Add an audit, licence fees and a seed fund for early jackpots.