Replying to Avatar twood

I vibe coded a Nostr Lottery app using Opus 4.5 and MKStack. You can run your own lottery at https://nostr-lottery.vercel.app. All you need is a NWC connection that can receive payments for the tickets and send out payments after the lottery is done. Just a fun demo so all the usual caveats around don't use it with real money...

https://github.com/twood22/nostr-lottery

nostr:note1m7un5fspf4h3r46t5mtvlxnegrt2rhvjcdhjt7qmqjxcskwkh3yske4j8n

How It Works

- Operator publishes a lottery note on Nostr

- Users zap the note to buy tickets (1 sat = 1 ticket)

- Tickets assigned deterministically - sorted by payment_hash from zap receipts

- Sales close 6 blocks before the draw block and operator published a note that commits to a ticket ordering

- Winner determined using Bitcoin block hash: (block_hash % total_tickets) + 1

- Prize paid via Lightning to the winner's lud16 address

Reply to this note

Please Login to reply.

Discussion

This reminds me of nostr:nprofile1qqs0awzzutnzfj6cudj03a7txc7qxsrma9ge44yrym6337tkkd23qkgpzemhxue69uhk2er9dchxummnw3ezumrpdejz7qgewaehxw309akxjemgw3hxjmn8wfjkccte9e3k7mf0qy88wumn8ghj7mn0wvhxcmmv9uuxfel8's fair lottery idea. Nice 👌