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.
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:
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:
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: