Extension: Events (Ticketing) #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implement a Nostr-native event ticketing extension for Lightning.Pub, replacing the LNbits
eventsextension with a version that leverages Nostr for discovery and Lightning for payments.Motivation
The LNbits events extension provides basic ticketing (create events, sell tickets via Lightning, promo codes, refunds) but is HTTP-only with no Nostr integration. A Lightning.Pub extension gets Nostr superpowers for free:
Scope
RPC Methods:
Data Model:
Event— title, description, date, location, capacity, price, statusTicket— event_id, buyer_pubkey, payment_hash, status (pending/paid/refunded)PromoCode— event_id, code, discount_percentage, max_uses, used_countExtensionContext API usage:
createInvoice()for ticket purchasesonPaymentReceived()to confirm ticketspayInvoice()for refundspublishNostrEvent()to announce events (kind 31923)registerMethod()for all CRUD operationsComplexity
LOW — ~800-1200 lines of TypeScript. Zero external dependencies. Pure payment + state tracking.
This is the simplest extension to implement and a good template for the extension pattern.
Reference
lnbits/extensions/events/lightning-pub/withdraw/NIP Review: Applicable Standards for Events Extension
Core NIPs to Implement
NIP-52: Calendar Events — PRIMARY FOUNDATION
Use kind 31923 (time-based calendar events) as the canonical event format. This makes every event discoverable on any Nostr client (Amethyst, Damus, etc.) for free.
Event structure:
Also defines:
status: accepted/declined/tentative) — doubles as ticket confirmationNIP-57: Zaps — PAYMENT LAYER
Zap receipts (kind 9735) serve as ticket purchase proof. The
atag links the payment directly to the calendar event:Zap receipt (kind 9735) then becomes the immutable ticket — cryptographically signed payment proof linked to the specific event.
NIP-33: Parameterized Replaceable Events — INFRASTRUCTURE
Events (kind 31923) are addressable via
<kind>:<pubkey>:<d-tag>. This means organizers can update event details (venue change, time shift) without invalidating existing tickets/RSVPs. Deletion via NIP-09.Supplementary NIPs
priceandstatustags — less suitable than NIP-52Recommended Implementation
Ticket purchase flow using standard NIPs:
pricetagatag to get attendee listWhat this gives us over LNbits: Every event is automatically visible on Nostr, tickets are verifiable zap receipts, attendees are identified by npub, and RSVPs work across any Nostr client — zero custom UI required for basic discovery.