Add NIP-52 calendar event publishing via nostrclient #4

Closed
opened 2026-04-26 20:18:58 +00:00 by padreug · 0 comments
Owner

Summary

Publish NIP-52 calendar events to Nostr relays when events are created/updated in the LNbits events extension, following the nostrmarket bidirectional sync pattern.

Scope

  • Add nostr/ module to the events extension (scaffolding already excluded in pyproject.toml)
  • Add event_id and event_created_at columns to the events DB table (same pattern as nostrmarket)
  • On event creation/update → publish kind 31922 (time-based) or 31923 (date-based) calendar events via nostrclient WebSocket
  • Map Event model fields to NIP-52 tags:
    • name → content
    • event_start_datestart tag
    • event_end_dateend tag
    • infodescription tag
    • bannerimage tag
    • price_per_ticket + currency → custom tag or amount tag
  • Store NIP-52 event's Nostr event_id back in DB for correlation
  • On event deletion → publish kind 5 (delete) event

Dependencies

  • nostrclient extension must be installed and configured with relays

References

  • nostrmarket sync pattern: nostrmarket/services.py lines 144-179 (sign_and_send_to_nostr())
  • NIP-52 spec: https://github.com/nostr-protocol/nips/blob/master/52.md (always consult for latest tag names and required fields)
  • Lightning.pub patterns: ~/dev/shocknet/lightning-pub/extension-loader/src/services/nostr/ for event dedup and relay pooling
## Summary Publish NIP-52 calendar events to Nostr relays when events are created/updated in the LNbits events extension, following the nostrmarket bidirectional sync pattern. ## Scope - Add `nostr/` module to the events extension (scaffolding already excluded in pyproject.toml) - Add `event_id` and `event_created_at` columns to the events DB table (same pattern as nostrmarket) - On event creation/update → publish kind 31922 (time-based) or 31923 (date-based) calendar events via nostrclient WebSocket - Map Event model fields to NIP-52 tags: - `name` → content - `event_start_date` → `start` tag - `event_end_date` → `end` tag - `info` → `description` tag - `banner` → `image` tag - `price_per_ticket` + `currency` → custom tag or `amount` tag - Store NIP-52 event's Nostr `event_id` back in DB for correlation - On event deletion → publish kind 5 (delete) event ## Dependencies - nostrclient extension must be installed and configured with relays ## References - nostrmarket sync pattern: `nostrmarket/services.py` lines 144-179 (`sign_and_send_to_nostr()`) - NIP-52 spec: https://github.com/nostr-protocol/nips/blob/master/52.md (always consult for latest tag names and required fields) - Lightning.pub patterns: `~/dev/shocknet/lightning-pub/extension-loader/src/services/nostr/` for event dedup and relay pooling
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/events#4
No description provided.