Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Querying events by tags presence #683

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions 100.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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:
fernandolguevara marked this conversation as resolved.
Show resolved Hide resolved
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:

```json
{
"tags": ["g"]
fernandolguevara marked this conversation as resolved.
Show resolved Hide resolved
}
```

2. Filter to match events without the presence of the `e` tag:

```json
{
"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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-94: File Metadata](94.md)
- [NIP-98: HTTP Auth](98.md)
- [NIP-99: Classified Listings](99.md)
- [NIP-100: Querying Events by Tags Presence](100.md)

## Event Kinds

Expand Down