Add bidirectional Nostr sync for events (subscribe via nostrclient) #5

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

Summary

Subscribe to NIP-52 calendar events from Nostr relays to support federated event discovery and eventual Nostr-only operation.

Scope

  • Subscribe via nostrclient for kind 31922/31923 events authored by known pubkeys
  • Process incoming NIP-52 events and upsert into events DB
  • Deduplication via event_id UNIQUE constraint
  • Background task: wait_for_nostr_events() (same pattern as nostrmarket)
  • Startup sequence: connect to nostrclient WebSocket → subscribe with since timestamps → process backlog
  • Use NIP-44 v2 for any encrypted content (not NIP-04)

Depends on

  • Issue: "Add NIP-52 calendar event publishing via nostrclient" (for DB schema with event_id columns)

References

  • nostrmarket sync pattern: nostrmarket/nostr/nostr_client.py and tasks.py
  • Lightning.pub: ~/dev/shocknet/lightning-pub/extension-loader/src/services/nostr/nostrPool.ts for event dedup and relay pooling patterns
  • NIP-52 spec: https://github.com/nostr-protocol/nips/blob/master/52.md
## Summary Subscribe to NIP-52 calendar events from Nostr relays to support federated event discovery and eventual Nostr-only operation. ## Scope - Subscribe via nostrclient for kind 31922/31923 events authored by known pubkeys - Process incoming NIP-52 events and upsert into events DB - Deduplication via `event_id` UNIQUE constraint - Background task: `wait_for_nostr_events()` (same pattern as nostrmarket) - Startup sequence: connect to nostrclient WebSocket → subscribe with `since` timestamps → process backlog - Use NIP-44 v2 for any encrypted content (not NIP-04) ## Depends on - Issue: "Add NIP-52 calendar event publishing via nostrclient" (for DB schema with event_id columns) ## References - nostrmarket sync pattern: `nostrmarket/nostr/nostr_client.py` and `tasks.py` - Lightning.pub: `~/dev/shocknet/lightning-pub/extension-loader/src/services/nostr/nostrPool.ts` for event dedup and relay pooling patterns - NIP-52 spec: https://github.com/nostr-protocol/nips/blob/master/52.md
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#5
No description provided.