From d5484a33bcaf717ef1ef54a0f9be1b76c4f70afa Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Sat, 6 May 2023 11:35:21 -0700 Subject: [PATCH 1/4] Clarify how NIP 45 works with multiple COUNT filters. (#504) --- 45.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/45.md b/45.md index 87e80002..a5253913 100644 --- a/45.md +++ b/45.md @@ -6,21 +6,21 @@ Event Counts `draft` `optional` `author:staab` -Relays may support the `COUNT` verb, which provides a mechanism for obtaining event counts. +Relays may support the verb `COUNT`, which provides a mechanism for obtaining event counts. ## Motivation -Some queries a client may want to execute against connected relays are prohibitively expensive, for example, in order to retrieve follower counts for a given pubkey, a client must query all kind-3 events referring to a given pubkey and count them. The result may be cached, either by a client or by a separate indexing server as an alternative, but both options erode the decentralization of the network by creating a second-layer protocol on top of Nostr. +Some queries a client may want to execute against connected relays are prohibitively expensive, for example, in order to retrieve follower counts for a given pubkey, a client must query all kind-3 events referring to a given pubkey only to count them. The result may be cached, either by a client or by a separate indexing server as an alternative, but both options erode the decentralization of the network by creating a second-layer protocol on top of Nostr. ## Filters and return values -This NIP defines a verb called `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md). +This NIP defines the verb `COUNT`, which accepts a subscription id and filters as specified in [NIP 01](01.md) for the verb `REQ`. Multiple filters are OR'd together and aggregated into a single count result. ``` ["COUNT", , ...] ``` -Counts are returned using a `COUNT` response in the form `{count: }`. Relays may use probabilistic counts to reduce compute requirements. +Counts are returned using a `COUNT` response in the form `{"count": }`. Relays may use probabilistic counts to reduce compute requirements. ``` ["COUNT", , {"count": }] From 1678c53dcd3a2cefcf953722d501c03920ce6092 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sat, 6 May 2023 23:31:22 +0200 Subject: [PATCH 2/4] Update old link to fiatjaf/nostr --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4a63a4a..94e945c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # NIPs NIPs stand for **Nostr Implementation Possibilities**. -They exist to document what may be implemented by [Nostr](https://github.com/fiatjaf/nostr)-compatible _relay_ and _client_ software. +They exist to document what may be implemented by [Nostr](https://github.com/nostr-protocol/nostr)-compatible _relay_ and _client_ software. --- From ee018ef8a4af08dcf8f4c090bb3815ee13f4c627 Mon Sep 17 00:00:00 2001 From: Josua Schmid Date: Sun, 7 May 2023 21:53:35 +0200 Subject: [PATCH 3/4] Rephrase Markdown special rule --- 01.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/01.md b/01.md index a07a0dff..3d8c7450 100644 --- a/01.md +++ b/01.md @@ -99,7 +99,8 @@ This NIP defines no rules for how `NOTICE` messages should be sent or treated. ## Basic Event Kinds - `0`: `set_metadata`: the `content` is set to a stringified JSON object `{name: , about: , picture: }` describing the user who created the event. A relay may delete past `set_metadata` events once it gets a new one for the same pubkey. - - `1`: `text_note`: the `content` is set to the plaintext content of a note (anything the user wants to say). Markdown links (`[]()` stuff) are not plaintext. + - `1`: `text_note`: the `content` is set to the plaintext content of a note (anything the user wants to say).\ + Do not use Markdown! Clients should not have to guess how to interpret content like `[Example](https://example.com)`. Use different event kinds for parsable content. - `2`: `recommend_server`: the `content` is set to the URL (e.g., `wss://somerelay.com`) of a relay the event creator wants to recommend to its followers. A relay may choose to treat different message kinds differently, and it may or may not choose to have a default way to handle kinds it doesn't know about. From 89a7aa0ea0197b478e96d2a281ac4d096c44caad Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 8 May 2023 11:05:58 -0300 Subject: [PATCH 4/4] nip01: remove misleading markdown example. --- 01.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/01.md b/01.md index 3d8c7450..713e6550 100644 --- a/01.md +++ b/01.md @@ -99,8 +99,7 @@ This NIP defines no rules for how `NOTICE` messages should be sent or treated. ## Basic Event Kinds - `0`: `set_metadata`: the `content` is set to a stringified JSON object `{name: , about: , picture: }` describing the user who created the event. A relay may delete past `set_metadata` events once it gets a new one for the same pubkey. - - `1`: `text_note`: the `content` is set to the plaintext content of a note (anything the user wants to say).\ - Do not use Markdown! Clients should not have to guess how to interpret content like `[Example](https://example.com)`. Use different event kinds for parsable content. + - `1`: `text_note`: the `content` is set to the plaintext content of a note (anything the user wants to say). Do not use Markdown! Clients should not have to guess how to interpret content like `[]()`. Use different event kinds for parsable content. - `2`: `recommend_server`: the `content` is set to the URL (e.g., `wss://somerelay.com`) of a relay the event creator wants to recommend to its followers. A relay may choose to treat different message kinds differently, and it may or may not choose to have a default way to handle kinds it doesn't know about.