Privacy-preserving push notifications for Nostroots using Nostr filters. Mobile clients send AppMessage events (Kind 10395) with filters and Expo push tokens. The notification daemon uses the Expo Go service to push notifications to all subscribed (filtered) devices when matching events arrive.
┌──────────────────────────┐ ┌──────────┐ ┌───────────────┐
│ nostr relay / strfry ├───────┤AppData as├───► │ │
│ │ │kind 10395│ │ │
└──────────────────────────┘ │ or │ │ notification- │
┌──────────────────────────┐ │Events as │ │ daemon │
│ message queue / rabbitmq ├───────┤Any Kind ├───► │ │
│ │ │ │ │ │
└──────────────────────────┘ └──────────┘ │ │
┌──────────────────────────┐ ┌──────────┐ │ │
│ SDK's Notification hub / │◄──────┤REST PUSH ├─────┤ │
│ Expo Go │ │ API │ │ │
└────────────┬┬────────────┘ └──────────┘ └───────────────┘
││
┌───────┴┴────────┐
│PUSH Notification│
└───────┬┬────────┘
┌─────────┐ ││ ┌─────────┐
│Mobile - │ ││ │Mobile - │
│Devices /│◄─┘└─►│Devices /│
│iOS │ │Android │
└─────────┘ └─────────┘
The service operates in two phases:
- in Startup Phase, all historical Nostr events are read from strfry and processes.
- Normal Operation Phase: Listens to a RabbitMQ queue (fed by strfry) for real-time event processing.
The service handles two kinds of messages:
- Subscription (Nip4 enrypted but Kind 10395, AppData)
- Message/Any events
as defined in https://github.com/Trustroots/nostroots/blob/main/nr-common/src/10395.schema.ts
Containes filers and push-sub-keys Client notifies server for which events they/a pubkey wants notifications for and includes the expoPushToken for Expo push SAS.
10395: replaces older messages with the same ID.
Any Nostr event. If it matches a stored subscription filter, push notifications are sent to all relevant (e.g. subscribed) devices.