nips/100.md
Fernando López Guevara d1ec51a4a1 rewording to tags presence
2023-07-26 10:17:32 -03:00

1.1 KiB

NIP-100

Querying Events by Tags Presence

draft optional author:fernandolguevara requires:nip-12

This NIP allows clients to query events from relays based on the presence or non-presence of specific tags.

Presense:

The filter condition matches if there is at least one tag name in common with the filter and event.

Non-Presence:

The filter condition matches if there is at least one tag in the filter that are not present in the event.

Example Subscription Filter

Below are some example filters that demonstrate tag presence and non-presence:

  1. Filter to match events with a g tag:
{
  "tags": ["g"]
}
  1. Filter to match events without the presence of the e tag:
{
  "tags": ["!e"]
}

Suggested Use Cases

One of the suggested use cases for this NIP is for location-specific events. Clients can utilize the provided filter example to locate events with specific location-related tags, regardless of how the location information has been stored in the events.