Private Raffle
A confidential raffle system on Solana where participants submit encrypted guesses, and winners are determined through encrypted comparisons — no one can see the winning number or anyone’s guess until results are revealed.How It Works
The raffle follows a simple “guess the number” game:- Authority creates a raffle with a ticket price
- Players buy tickets with encrypted guesses (1-100)
- Authority draws by setting an encrypted winning number
- Players check if their guess matches (encrypted comparison)
- Winners claim their prize through on-chain verification
Privacy Guarantees
| Data | Visibility |
|---|---|
| Player’s guess | Only the player can see |
| Winning number | Only authority knows |
| Win/loss result | Only the ticket owner sees |
| Prize amount | Only the winner sees |
| Ticket purchase | Public (on-chain transaction) |
Key Features
- Encrypted Guesses: Players submit encrypted numbers, hidden from everyone
- Encrypted Drawing: The winning number is never revealed on-chain
- Private Results: Only ticket owners can see if they won
- On-chain Verification: Winners prove their prize amount with Ed25519 signatures
- Trustless Payout: Prize transfers are verified and executed on-chain
Setup
Project configuration and dependencies
Program
Raffle program instructions and accounts
Client Integration
TypeScript usage and testing