Skip to content

Feature to subscribe based on attachment and tag, instead of just tag. #2209

Description

@VAIBHAVJINDAL3012

Feature description

In the current setup, clients can subscribe only to tags. Once the client receives all notes corresponding to a subscribed tag, it locally filters out the notes that are actually relevant to it.

This leads to unnecessary bandwidth usage, since the node may send a large number of notes that the client ultimately discards.

Based on the discussion from @bobbinth here:
#2130 (comment)

I think we could support a more sophisticated subscription model where:

  • the client subscribes to a note category (represented by the tag), and
  • additionally provides filter inputs derived from the attachment data.

Under this model, the node would first match notes by tag, and then apply the attachment-level filters before forwarding notes to the client.

Conceptually, I am thinking about this similarly to how event subscriptions work in the EVM ecosystem:

  • tags are analogous to contract addresses, and
  • attachments are analogous to emitted event data/topics.

In that sense, clients would subscribe not just to a broad category, but to a filtered event stream, similar to how dapps consume indexed event data through subgraphs or indexing services.

One open question is whether this functionality belongs directly in the node, or whether it should live in a separate indexing sidecar.

A dedicated sidecar/indexer could provide:

  • more advanced querying capabilities,
  • richer filtering semantics,
  • and potentially better scalability for sophisticated subscription patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions