recently had a conversation about the us powerball lottery and why im not interested in playing; it depends on a bunch of trusted third parties.

that sounded familiar and sparked an idea for a trust-less implementation:

1. take a Block Hash: 0000000000000000000a1b2c3d4e5f...

2. convert hash to integer and use as rng seed

3. Call rand.IntN(69) five times → White balls: 7, 23, 45, 58, 62

4. Call rand.IntN(26) once → Powerball: 18

someone build this on nostr with zaps.

Reply to this note

Please Login to reply.

Discussion

Anchor it to the first block of a difficulty adjustment or something like that to make it regular.

totally! or run it every n blocks and store state on relays

Sooooo are my ticket numbers arbitrary data or financial transactions information 😜

I am not a lottery player but a periodic game tied to the difficulty adjustment would be pretty fun. Especially if it was a simple nostr note and Lightning transaction to play and then the payout automatically went to the correct players.

hodl invoices seem perfect but i think ~2 weeks is too long to hold

You could roll up all entries into OTS. Bets for next block go in OTS merkle tree for current block.

cool idea. i was imagining storing state on relays but this is an interesting, more robust spin.

You just want proveable time anchors so there's less cheating. OTS provides that.

nostr events are signed, if you trust the signer.

Signatures are just one part. Timestamping is the other.

nostr events include a unix timestamp and are then signed

Right. And I can sign any event with any time. You could back date an event.

thanks for bearing with me, im a little slow sometimes.

🤝

No worries. We're all learning together.