From fa038a8671ce3280ef5bc819c6ea601f28ba5488 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sun, 31 Mar 2024 11:12:59 -0400 Subject: [PATCH] Improves the text and changes to SREQ requests --- 63.md | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/63.md b/63.md index b28b1e8..7d02997 100644 --- a/63.md +++ b/63.md @@ -8,26 +8,38 @@ Signed Filters This NIP declares the use of event kind `33012` to represent one or more Nostr filters. -The `d` tag represents the subscription id and the `filter` tag contains the JSON-stringified (NIP-01)[01.md] filter. +The `d` tag represents the subscription id and the `filter` tag contains the JSON-stringified [NIP-01](01.md) filter. -Supporting relays interpret the tags of this event as if they were submitted in the `REQ` scheme while automatically authenticating the signer. The relay MUST delete these events after the connection closes. - -They are submitted to the relay via `EVENT` messages instead of the usual `REQ` message. - -The goal is to be able to support `AUTH` from multiple users in the same connection while removing the usual `AUTH` round trip. - -```json +```js { "kind": 33012, "tags": [ ["d", ""], - ["filter", ""], - ["filter", ""], + ["relay", ""], + ["filter", ""], + ["filter", ""], + ["expiration", ""], ], "content": "", - ...other fields + // ...other fields } ``` +They are submitted to supporting relays via `SREQ` command, with the following format: +```js +["SREQ", ] +``` + +Supporting relays interpret the `filter` tags of this event in the same way they do with `REQ` while automatically authenticating the signer. + +Relays MAY reject these filters based on `created_at`. + +An expiration tag MAY be used to limit the reuse of the filter. + +## Motivation + +The goal is to be able to support `AUTH` from multiple users in the same connection. As a side effect, this approach removes the `AUTH` round trip. + +Trusted proxies can use these event types to query relays on behalf of the user.