A decentralized platform built on Nostr for podcasters to run 50/50 style fundraisers. Listeners can buy raffle tickets using Lightning payments, with half the proceeds going to the winner and half supporting the podcast.
- Decentralized: Built on Nostr protocol for censorship resistance
- Lightning Payments: Fast, low-fee Bitcoin payments via Lightning Network
- 50/50 Split: Fair distribution - half to winner, half to creator
- Transparent: All transactions and winner selection verifiable on Nostr
- Mobile Friendly: Responsive design works on all devices
- Create Campaign: Set up a fundraiser with target amount, ticket price, and end date
- Promote: Share your campaign with listeners
- Automatic Payout: When campaign ends, 50% goes to random winner, 50% to you
- Browse Campaigns: Discover active fundraisers from your favorite podcasters
- Buy Tickets: Purchase raffle tickets with Lightning payments
- Win Big: Get a chance to win half the total pot while supporting creators
- Frontend: React 18, TypeScript, TailwindCSS, shadcn/ui
- Protocol: Nostr (decentralized social protocol)
- Payments: Lightning Network (Bitcoin Layer 2)
- Build Tool: Vite
- State Management: TanStack Query
This application defines custom Nostr event kinds for fundraiser functionality:
- Kind 31950: Fundraiser Campaign - Defines campaign details, target, pricing
- Kind 31951: Ticket Purchase - Records ticket purchases with payment proof
- Kind 31952: Campaign Result - Declares winner and final distribution
See NIP.md for complete event specifications.
- Node.js 18+
- A Nostr client/extension (like Alby, nos2x) for authentication
- Lightning wallet for payments
# Clone the repository
git clone <repository-url>
cd podraffle
# Install dependencies
npm install
# Start development server
npm run devnpm run build- Login: Connect your Nostr account using a browser extension
- Create: Click "Create Fundraiser" and fill in campaign details:
- Campaign title and description
- Podcast information
- Target amount (in sats)
- Ticket price (in sats)
- End date
- Publish: Campaign is published to Nostr relays
- Browse: View active campaigns on the homepage
- Select: Click on a campaign to view details
- Purchase: Choose number of tickets and complete Lightning payment
- Track: View your tickets and win probability
- Campaigns automatically end at the specified date
- Winner selection uses cryptographically secure randomness
- Results are published to Nostr for transparency
- Payouts are handled automatically via Lightning
The app connects to Nostr relays to fetch and publish events. Users can switch between different relays using the relay selector.
Default relays:
- wss://relay.nostr.band
- wss://relay.damus.io
- wss://nos.lol
Currently uses mock Lightning payments for demo purposes. In production, this would integrate with:
- LNURL-pay for receiving payments
- Lightning wallets for payouts
- NIP-57 Zaps for Nostr-native payments
src/
├── components/ # React components
│ ├── ui/ # shadcn/ui components
│ ├── auth/ # Authentication components
│ ├── CampaignCard.tsx
│ ├── CreateCampaignDialog.tsx
│ └── BuyTicketsDialog.tsx
├── hooks/ # Custom React hooks
│ ├── useCampaigns.ts
│ ├── useCampaignStats.ts
│ └── useNostr.ts
├── pages/ # Page components
│ ├── Index.tsx
│ └── Campaign.tsx
├── lib/ # Utility functions
└── contexts/ # React contexts
useCampaigns(): Fetch all fundraiser campaignsuseCampaignStats(): Get campaign statistics and ticket purchasesuseCurrentUser(): Access logged-in user informationuseNostrPublish(): Publish events to Nostr
- New Event Types: Update
NIP.mdand create validation functions - UI Components: Use shadcn/ui patterns for consistency
- Hooks: Follow TanStack Query patterns for data fetching
- Styling: Use Tailwind classes and CSS custom properties
- Payment Verification: All ticket purchases must have valid Lightning payment proof
- Random Selection: Winner selection uses cryptographically secure randomness
- Event Validation: All Nostr events are validated before processing
- User Authentication: Secure key management via Nostr browser extensions
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
For questions or support:
- Open an issue on GitHub
- Join the discussion on Nostr
- Contact the development team
Disclaimer: This is experimental software. Use at your own risk. Always verify payments and campaign details before participating.