navs

NAV-08

Notifications

Status: Draft
Optional: Yes
Author: Melvin Carvalho

Pub-Sub System over Nostr

Overview:

A pub-sub (publish-subscribe) system over Nostr allows for efficient message distribution across multiple subscribers by leveraging the existing Nostr protocol. This specification aims to outline the design and components of such a system.

Components:

image

Event Structure:

An event in the pub-sub system over Nostr should include the following properties:

{
    "id": "A unique identifier for the event",
    "pubkey": "The public key of the publisher",
    "created_at": "Timestamp of event creation",
    "kind": "Integer denoting the type of event",
    "content": "The actual message content",
    "tags": "An array of tags to categorize the event or describe its properties",
    "sig": "A signature to ensure the authenticity of the event"
}

Subscriptions:

Subscribers can express their interest in specific publishers, topics, or event types by sending subscription requests. These requests should include:

Pub-Sub Process:

Delegated Event Signing (Optional):

Delegated event signing allows publishers to delegate the signing of events to other keypairs. This is useful for abstracting the use of ‘root’ keypairs and enables the generation of new keypairs for each client.

This can be achieved by introducing a new tag, delegation, with the following properties:

Relay & Client Querying Support:

Relays should support querying events based on publisher public keys, topics, or event types. Clients should display delegated events as if they were published directly by the original publisher.

This specification provides a high-level overview of a pub-sub system over Nostr. Implementations can be further refined and optimized based on specific use cases or requirements.

Additional Features:

By incorporating these additional features, the pub-sub system over Nostr can be tailored to specific use cases and requirements, providing a versatile and robust messaging infrastructure.

Advanced Features:

By implementing these advanced features, the pub-sub system over Nostr can cater to a wide range of complex use cases, providing a powerful and flexible messaging solution for diverse applications and environments.