From 142cb8d655d411628517b44a1cbafdc8c1fbcc68 Mon Sep 17 00:00:00 2001 From: starbuilder <101296187+starbackr-dev@users.noreply.github.com> Date: Sun, 15 Oct 2023 10:44:07 -0400 Subject: [PATCH 01/48] Update 90.md Added optional Encryption to params and payload if the user require the input and output to be a secret. --- 90.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/90.md b/90.md index 4c0eff6a..7de34fc9 100644 --- a/90.md +++ b/90.md @@ -67,6 +67,37 @@ All tags are optional. * `relays`: List of relays where Service Providers SHOULD publish responses to * `p`: Service Providers the customer is interested in. Other SPs MIGHT still choose to process the job +## Encrypted Params + +If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. The user also indicates whether the output should be encrypted or not as one of the parameters. + +```json +[ + [ "i", "what is the capital of France? ", "prompt" ], + [ "param", "model", "LLaMA-2" ], + [ "param", "max_tokens", "512" ], + [ "param", "temperature", "0.5" ], + [ "param", "top-k", "50" ], + [ "param", "top-p", "0.7" ], + [ "param", "frequency_penalty", "1" ], + [ "param", "output", "encrypted"] +] + +``` + +This param data will be encrypted and added to the `content` field and `p` tag should be present + +``` +"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", + "tags": [ + [`p`, `04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f`] + + ] + + +``` + + ## Job result (`kind:6000-6999`) Service providers publish job results, providing the output of the job result. They should tag the original job request event id as well as the customer's pubkey. @@ -110,6 +141,8 @@ Service providers can give feedback about a job back to the customer. * `amount` tag: as defined in the [Job Result](#job-result) section. * `status` tag: Service Providers SHOULD indicate what this feedback status refers to. [Appendix 1](#appendix-1-job-feedback-status) defines status. Extra human-readable information can be added as an extra argument. +* NOTE: If the input params requires input to be encryped, then `content` field will have encrypted payload with `p` tag as key. + ### Job feedback status | status | description | @@ -168,4 +201,4 @@ Service Providers MAY use NIP-89 announcements to advertise their support for jo } ``` -Customers can use NIP-89 to see what service providers their follows use. \ No newline at end of file +Customers can use NIP-89 to see what service providers their follows use. From 9f4a4cf9d2f0a626fc2a341cff6d7f66d73c12e4 Mon Sep 17 00:00:00 2001 From: starbuilder <101296187+starbackr-dev@users.noreply.github.com> Date: Sun, 15 Oct 2023 14:59:13 -0400 Subject: [PATCH 02/48] Update 90.md changed `prompt` to 'text` --- 90.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/90.md b/90.md index 7de34fc9..a55d4915 100644 --- a/90.md +++ b/90.md @@ -73,7 +73,7 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i ```json [ - [ "i", "what is the capital of France? ", "prompt" ], + [ "i", "what is the capital of France? ", "text" ], [ "param", "model", "LLaMA-2" ], [ "param", "max_tokens", "512" ], [ "param", "temperature", "0.5" ], From c2020929fbbcd667caa8ac67b706844512d19d7c Mon Sep 17 00:00:00 2001 From: starbuilder <101296187+starbackr-dev@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:56:24 -0500 Subject: [PATCH 03/48] Update 90.md updated based on Pablo's feedback. --- 90.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/90.md b/90.md index a55d4915..0ac4b981 100644 --- a/90.md +++ b/90.md @@ -79,8 +79,8 @@ If the user wants to keep the input parameters a secret, they can encrypt the `i [ "param", "temperature", "0.5" ], [ "param", "top-k", "50" ], [ "param", "top-p", "0.7" ], - [ "param", "frequency_penalty", "1" ], - [ "param", "output", "encrypted"] + [ "param", "frequency_penalty", "1" ] + ] ``` @@ -90,8 +90,8 @@ This param data will be encrypted and added to the `content` field and `p` tag s ``` "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", "tags": [ - [`p`, `04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f`] - + [`p`, `04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f`], + [ `param`, `encrypted`, true] ] @@ -121,6 +121,10 @@ Service providers publish job results, providing the output of the job result. T * `amount`: millisats that the Service Provider is requesting to be paid. An optional third value can be a bolt11 invoice. * `i`: The original input(s) specified in the request. +## Encrypted Output + +If the request has encrypted params, then output should be encrypted and placed in `content` field with `p` tag. If the output is encrypted, then avoid including `i` tag with input-data as clear text. + ## Job feedback Service providers can give feedback about a job back to the customer. From 749c9b0a2d49d09ccbd00f6bdb4843182e334ddf Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Wed, 25 Oct 2023 12:21:24 +0900 Subject: [PATCH 04/48] clearly define the term "READ/WRITE relay" --- 65.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/65.md b/65.md index b6760290..573e1df2 100644 --- a/65.md +++ b/65.md @@ -8,7 +8,7 @@ Relay List Metadata Defines a replaceable event using `kind:10002` to advertise preferred relays for discovering a user's content and receiving fresh content from others. -The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. If the marker is omitted, the relay is used for both purposes. +The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. Relays marked as `read` / `write` are called READ / WRITE relays, respectively. If the marker is omitted, the relay is used for both purposes. The `.content` is not used. @@ -27,7 +27,7 @@ The `.content` is not used. This NIP doesn't fully replace relay lists that are designed to configure a client's usage of relays (such as `kind:3` style relay lists). Clients MAY use other relay lists in situations where a `kind:10002` relay list cannot be found. -## When to Use Read and Write +## When to Use Read and Write Relays When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002` From 6b566e897cf0a75d9b6671e73bc614333b89d7ae Mon Sep 17 00:00:00 2001 From: jiftechnify Date: Wed, 25 Oct 2023 12:27:18 +0900 Subject: [PATCH 05/48] make the usage of punctuations uniform --- 65.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/65.md b/65.md index 573e1df2..939b2639 100644 --- a/65.md +++ b/65.md @@ -23,26 +23,27 @@ The `.content` is not used. ], "content": "", ...other fields +} ``` This NIP doesn't fully replace relay lists that are designed to configure a client's usage of relays (such as `kind:3` style relay lists). Clients MAY use other relay lists in situations where a `kind:10002` relay list cannot be found. ## When to Use Read and Write Relays -When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002` +When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002`. -When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002` +When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002`. When broadcasting an event, Clients SHOULD: - Broadcast the event to the WRITE relays of the author -- Broadcast the event all READ relays of each tagged user. +- Broadcast the event all READ relays of each tagged user ## Motivation The old model of using a fixed relay list per user centralizes in large relay operators: - - Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience. + - Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience - Many users are pulling events from a large number of relays in order to get more data at the expense of duplication - Events are being copied between relays, oftentimes to many different relays From 108b7f16f9f75157cffde590a55077e4dfe7c955 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 6 Nov 2023 13:18:11 -0300 Subject: [PATCH 06/48] clarify that the OK array must have 4 items. --- 01.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01.md b/01.md index 183e0ba2..cb4f522d 100644 --- a/01.md +++ b/01.md @@ -150,7 +150,7 @@ Relays can send 4 types of messages, which must also be JSON arrays, according t This NIP defines no rules for how `NOTICE` messages should be sent or treated. - `EVENT` messages MUST be sent only with a subscription ID related to a subscription previously initiated by the client (using the `REQ` message above). -- `OK` messages MUST be sent in response to `EVENT` messages received from clients, they must have the 3rd parameter set to `true` when an event has been accepted by the relay, `false` otherwise. The 4th parameter MAY be empty when the 3rd is `true`, otherwise it MUST be a string containing a machine-readable single-word prefix followed by a `:` and then a human-readable message. The standardized machine-readable prefixes are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, and `error` for when none of that fits. Some examples: +- `OK` messages MUST be sent in response to `EVENT` messages received from clients, they must have the 3rd parameter set to `true` when an event has been accepted by the relay, `false` otherwise. The 4th parameter MUST always be present, but MAY be an empty string when the 3rd is `true`, otherwise it MUST be a string formed by a machine-readable single-word prefix followed by a `:` and then a human-readable message. The standardized machine-readable prefixes are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, and `error` for when none of that fits. Some examples: * `["OK", "b1a649ebe8...", true, ""]` * `["OK", "b1a649ebe8...", true, "pow: difficulty 25>=24"]` From 56dbb7722c3d1a2c759277391960f41ba6948dcd Mon Sep 17 00:00:00 2001 From: starbuilder <101296187+starbackr-dev@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:31:37 -0500 Subject: [PATCH 07/48] Update 90.md changed and added [`encrypted`] to both 5xxx and 6xxx events --- 90.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/90.md b/90.md index 0ac4b981..24da99c0 100644 --- a/90.md +++ b/90.md @@ -91,7 +91,7 @@ This param data will be encrypted and added to the `content` field and `p` tag s "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", "tags": [ [`p`, `04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f`], - [ `param`, `encrypted`, true] + [`encrypted`] ] @@ -124,6 +124,23 @@ Service providers publish job results, providing the output of the job result. T ## Encrypted Output If the request has encrypted params, then output should be encrypted and placed in `content` field with `p` tag. If the output is encrypted, then avoid including `i` tag with input-data as clear text. +Add a tag encrypted to mark the output content as `encrypted` +```json +{ + "pubkey": "", + "content": "", + "kind": 6xxx, + "tags": [ + [ "request", "" ], + [ "e", "", "" ], + [ "p", "" ], + [ "amount", "requested-payment-amount", "" ], + [`encrypted`] + + ] +} +``` + ## Job feedback Service providers can give feedback about a job back to the customer. From 7e3b7cd90c6e5c4ccba94b58231312aaac421551 Mon Sep 17 00:00:00 2001 From: starbuilder <101296187+starbackr-dev@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:22:50 -0500 Subject: [PATCH 08/48] Update 90.md updated based on comments --- 90.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/90.md b/90.md index 24da99c0..8394c383 100644 --- a/90.md +++ b/90.md @@ -69,7 +69,7 @@ All tags are optional. ## Encrypted Params -If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. The user also indicates whether the output should be encrypted or not as one of the parameters. +If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret ```json [ @@ -90,8 +90,8 @@ This param data will be encrypted and added to the `content` field and `p` tag s ``` "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", "tags": [ - [`p`, `04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f`], - [`encrypted`] + ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], + ["encrypted"] ] @@ -123,7 +123,7 @@ Service providers publish job results, providing the output of the job result. T ## Encrypted Output -If the request has encrypted params, then output should be encrypted and placed in `content` field with `p` tag. If the output is encrypted, then avoid including `i` tag with input-data as clear text. +If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text. Add a tag encrypted to mark the output content as `encrypted` ```json { @@ -135,7 +135,7 @@ Add a tag encrypted to mark the output content as `encrypted` [ "e", "", "" ], [ "p", "" ], [ "amount", "requested-payment-amount", "" ], - [`encrypted`] + ["encrypted"] ] } From b128ad98ade41b2b1f029e7460329554748fea73 Mon Sep 17 00:00:00 2001 From: Pablo Fernandez Date: Tue, 7 Nov 2023 14:16:43 +0200 Subject: [PATCH 09/48] NIP-84: Highlights (#501) Co-authored-by: Alejandro Co-authored-by: arthurfranca Co-authored-by: fiatjaf_ --- 84.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 100 insertions(+) create mode 100644 84.md diff --git a/84.md b/84.md new file mode 100644 index 00000000..b4a4be72 --- /dev/null +++ b/84.md @@ -0,0 +1,98 @@ +NIP-84 +====== + +Highlights +---------- + +`draft` `optional` `author:pablof7z` + +This NIP defines `kind:9802`, a "highlight" event, to signal content a user finds valuable. + +## Format +The `.content` of these events is the highlighted portion of the text. + +`.content` might be empty for highlights of non-text based media (e.g. NIP-94 audio/video). + +### References +Events SHOULD tag the source of the highlight, whether nostr-native or not. +`a` or `e` tags should be used for nostr events and `r` tags for URLs. + +When tagging a URL, clients generating these events SHOULD do a best effort of cleaning the URL from trackers +or obvious non-useful information from the query string. + +### Attribution +Clients MAY include one or more `p` tags, tagging the original authors of the material being highlighted; this is particularly +useful when highlighting non-nostr content for which the client might be able to get a nostr pubkey somehow +(e.g. prompting the user or reading a `` tag on the document). A role MAY be included as the +last value of the tag. + +```json +[ "p", "...", "author" ], +[ "p", "...", "author" ], +[ "p", "...", "editor" ], +``` + +### Context +Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the +surrounding content might be beneficial to give context to the higlight. + +### Ranges +Clients MAY include `range` tags with the start/end indexes of where the highlight begins and finishes within +the referenced article/tagged-event. + +``` +[ "range", , ] +``` + +Additionally a range with `context` as the third value of the tag MAY be added to indicate the begin/finish indexes +of the highlight within the included `context` tag. + +``` +[ "range", , , "context" ] +``` + +#### Text-based nostr events' highlights + +Highlights of Nostr events SHOULD use the range index of the content as-is +(e.g. NIP-23 articles include the markdown instead of computing the index from the rendered markdown). + +``` +[ "range", 3000, 3042 ] # highlight begins at index position 3000 of the tagged event's `.content` +[ "range", 42, 84, "context" ] # highlight begins at index position 42 of the `context` tag's value +``` + +#### Non-text-based nostr events' highlights + +A `kind:9802` event that tags a NIP-94 event which includes a video or audio file can use ranges to +indicate the start/end time position in seconds. + +#### Ranges in URL highlights + +When creating a highlight from a URL the range should be expressed over +the extracted plain text of the formatted content (e.g. rendered HTML instead of including the HTML markup); +this helps make finding the correct indexes easier on websites with markup variations on each render. + +e.g. `hello, world` + +Tagging `hello, world` would result in using a range tag like `["range", 0, 12 ]`. + +Text extraction (i.e. translation from non-plain text medium like HTML or PDF) is highly subjective and the value +of the range should be carefully interpreted by the different clients that support this. + +```json +{ + "created_at": 1682707885, + "content": "while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands", + "tags": [ + [ "r", "https://footstr.com/zapvertise/" ], + [ "p", "c48e29f04b482cc01ca1f9ef8c86ef8318c059e0e9353235162f080f26e14c11", "wss://relay.url", "author" ], + [ "context", "The Nostr zapvertising model creates a truly free market for advertisers, while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands, they just have to create high quality content people find valuable, and companies will naturally want to zapvertise on their posts." ] + [ "range", 3916, 4032 ], + [ "range", 74, 190, "context" ], + ], + "kind": 9802, + "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", + "id": "59e5887a3cdf32d5f11edf9b8cd098c620d278514b2edde3e6d1ba8a541d262c", + "sig": "f2d15b8bc2csf6d198350f8df0a31dcf66d7c32ec9c54e6b3f102d579370b7de9d164d70350a5b32a2911db3b124e972bafa9a1bc8fd60c1e338903d2f6306b0" +} +``` diff --git a/README.md b/README.md index 8be05951..f818b043 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-72: Moderated Communities](72.md) - [NIP-75: Zap Goals](75.md) - [NIP-78: Application-specific data](78.md) +- [NIP-84: Highlights](84.md) - [NIP-89: Recommended Application Handlers](89.md) - [NIP-90: Data Vending Machines](90.md) - [NIP-94: File Metadata](94.md) @@ -101,6 +102,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `9041` | Zap Goal | [75](75.md) | | `9734` | Zap Request | [57](57.md) | | `9735` | Zap | [57](57.md) | +| `9802` | Highlights | [84](84.md) | | `10000` | Mute List | [51](51.md) | | `10001` | Pin List | [51](51.md) | | `10002` | Relay List Metadata | [65](65.md) | From d85f9269ca300fb3bee627733c8086df4fcff875 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Tue, 7 Nov 2023 09:19:11 -0300 Subject: [PATCH 10/48] 84: fix markers example. --- 84.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/84.md b/84.md index b4a4be72..89bf88b1 100644 --- a/84.md +++ b/84.md @@ -27,9 +27,9 @@ useful when highlighting non-nostr content for which the client might be able to last value of the tag. ```json -[ "p", "...", "author" ], -[ "p", "...", "author" ], -[ "p", "...", "editor" ], +[ "p", "", "", "author" ], +[ "p", "", "", "author" ], +[ "p", "", "", "editor" ], ``` ### Context From c5930de1076a747eb8181267a76ddaba8a8aad67 Mon Sep 17 00:00:00 2001 From: gsovereignty Date: Wed, 8 Nov 2023 13:46:50 +0800 Subject: [PATCH 11/48] Problem: nostrocket problem tracker event kind not included in list Mostly just letting people know that this event kind is now in use by Nostrocket. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f818b043..36dfada6 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `1063` | File Metadata | [94](94.md) | | `1311` | Live Chat Message | [53](53.md) | | `1040` | OpenTimestamps | [03](03.md) | +| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) | | `1984` | Reporting | [56](56.md) | | `1985` | Label | [32](32.md) | | `4550` | Community Post Approval | [72](72.md) | From 2392dfc9a8b10873cf81c9366291e5971cb9d28c Mon Sep 17 00:00:00 2001 From: Akiomi Kamakura Date: Fri, 10 Nov 2023 05:45:29 +0900 Subject: [PATCH 12/48] Fix typo in 65.md --- 65.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/65.md b/65.md index 939b2639..cdfe9bf5 100644 --- a/65.md +++ b/65.md @@ -53,7 +53,7 @@ This NIP allows Clients to connect directly with the most up-to-date relay set f 1. Clients SHOULD guide users to keep `kind:10002` lists small (2-4 relays). -2. Clients SHOULD spread an author's `kind:10002` events to as many relays as viable. +2. Clients SHOULD spread an author's `kind:10002` event to as many relays as viable. 3. `kind:10002` events should primarily be used to advertise the user's preferred relays to others. A user's own client may use other heuristics for selecting relays for fetching data. From 05cad663f8f4eb022620e2e27f0761733f05ce14 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 10 Nov 2023 07:00:40 -0300 Subject: [PATCH 13/48] improve nip-24. closes https://github.com/nostr-protocol/nips/pull/828 --- 24.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/24.md b/24.md index dee9daa3..b88d990a 100644 --- a/24.md +++ b/24.md @@ -13,7 +13,7 @@ kind 0 These are extra fields not specified in NIP-01 that may be present in the stringified JSON of metadata events: - - `display_name`: a bigger name with richer characters than `name`. Implementations should fallback to `name` when this is not available. + - `display_name`: an alternative, bigger name with richer characters than `name`. `name` should always be set regardless of the presence of `display_name` in the metadata. - `website`: a web URL related in any way to the event author. - `banner`: an URL to a wide (~1024x768) picture to be optionally displayed in the background of a profile screen. From c945d8bd9d14f928b52ba20e0441f311b046f0f6 Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 9 Nov 2023 13:05:31 -0800 Subject: [PATCH 14/48] Remove label annotations from NIP 32 --- 32.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/32.md b/32.md index ddd364ae..c5c62728 100644 --- a/32.md +++ b/32.md @@ -6,7 +6,7 @@ Labeling `draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay` -A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, from distributed moderation and content recommendations to reviews and ratings. +A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, including distributed moderation, collection management, license assignment, and content classification. Label Target ---- @@ -41,16 +41,6 @@ MAY be used when the label content is provided by an end user. `l` and `L` tags MAY be added to other event kinds to support self-reporting. For events with a kind other than 1985, labels refer to the event itself. -Label Annotations ------ - -A label tag MAY include a 4th positional element detailing extra metadata about the label in question. This string -should be a json-encoded object. Any key MAY be used, but the following are recommended: - -- `quality` may have a value of 0 to 1. This allows for an absolute, granular scale that can be represented in any way (5 stars, color scale, etc). -- `confidence` may have a value of 0 to 1. This indicates the certainty which the author has about their rating. -- `context` may be an array of urls (including NIP-21 urls) indicating other context that should be considered when interpreting labels. - Content ------- @@ -83,8 +73,9 @@ A review of a relay. "kind": 1985, "tags": [ ["L", "com.example.ontology"], - ["l", "relay/review", "com.example.ontology", "{\"quality\": 0.1}"], - ["r", ] + ["l", "relay/review", "com.example.ontology"], + ["r", ], + ["rating", "0.1"] ], "content": "This relay is full of mean people.", ... From 2e652f03d5d645b77f233d16cd3f2c29e1d1a1ec Mon Sep 17 00:00:00 2001 From: Asai Toshiya Date: Fri, 10 Nov 2023 23:59:00 +0900 Subject: [PATCH 15/48] Update TOC --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f818b043..a42aa20d 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [List](#list) - [Event Kinds](#event-kinds) - - [Event Kind Ranges](#event-kind-ranges) - [Message Types](#message-types) - [Client to Relay](#client-to-relay) - [Relay to Client](#relay-to-client) - [Standardized Tags](#standardized-tags) - [Criteria for acceptance of NIPs](#criteria-for-acceptance-of-nips) +- [Mailing Lists](#mailing-lists) - [License](#license) --- From e7777c30315969b3097d4b7940a92e49519b1556 Mon Sep 17 00:00:00 2001 From: Asai Toshiya Date: Sat, 11 Nov 2023 00:50:47 +0900 Subject: [PATCH 16/48] Add DVM kinds to list --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a42aa20d..9d3ee62c 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `1984` | Reporting | [56](56.md) | | `1985` | Label | [32](32.md) | | `4550` | Community Post Approval | [72](72.md) | +| `5000`-`5999` | Job Request | [90](90.md) | +| `6000`-`6999` | Job Result | [90](90.md) | | `7000` | Job Feedback | [90](90.md) | | `9041` | Zap Goal | [75](75.md) | | `9734` | Zap Request | [57](57.md) | From b303240a2b9a168069d94b4fefb3f156316215cd Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 10 Nov 2023 13:11:11 -0300 Subject: [PATCH 17/48] format kinds table. --- README.md | 118 +++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 9d3ee62c..3f7cb41f 100644 --- a/README.md +++ b/README.md @@ -75,65 +75,65 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos ## Event Kinds -| kind | description | NIP | -| ------- | -------------------------- | ----------- | -| `0` | Metadata | [1](01.md) | -| `1` | Short Text Note | [1](01.md) | -| `2` | Recommend Relay | | -| `3` | Contacts | [2](02.md) | -| `4` | Encrypted Direct Messages | [4](04.md) | -| `5` | Event Deletion | [9](09.md) | -| `6` | Repost | [18](18.md) | -| `7` | Reaction | [25](25.md) | -| `8` | Badge Award | [58](58.md) | -| `16` | Generic Repost | [18](18.md) | -| `40` | Channel Creation | [28](28.md) | -| `41` | Channel Metadata | [28](28.md) | -| `42` | Channel Message | [28](28.md) | -| `43` | Channel Hide Message | [28](28.md) | -| `44` | Channel Mute User | [28](28.md) | -| `1063` | File Metadata | [94](94.md) | -| `1311` | Live Chat Message | [53](53.md) | -| `1040` | OpenTimestamps | [03](03.md) | -| `1984` | Reporting | [56](56.md) | -| `1985` | Label | [32](32.md) | -| `4550` | Community Post Approval | [72](72.md) | -| `5000`-`5999` | Job Request | [90](90.md) | -| `6000`-`6999` | Job Result | [90](90.md) | -| `7000` | Job Feedback | [90](90.md) | -| `9041` | Zap Goal | [75](75.md) | -| `9734` | Zap Request | [57](57.md) | -| `9735` | Zap | [57](57.md) | -| `9802` | Highlights | [84](84.md) | -| `10000` | Mute List | [51](51.md) | -| `10001` | Pin List | [51](51.md) | -| `10002` | Relay List Metadata | [65](65.md) | -| `13194` | Wallet Info | [47](47.md) | -| `22242` | Client Authentication | [42](42.md) | -| `23194` | Wallet Request | [47](47.md) | -| `23195` | Wallet Response | [47](47.md) | -| `24133` | Nostr Connect | [46](46.md) | -| `27235` | HTTP Auth | [98](98.md) | -| `30000` | Categorized People List | [51](51.md) | -| `30001` | Categorized Bookmark List | [51](51.md) | -| `30008` | Profile Badges | [58](58.md) | -| `30009` | Badge Definition | [58](58.md) | -| `30017` | Create or update a stall | [15](15.md) | -| `30018` | Create or update a product | [15](15.md) | -| `30023` | Long-form Content | [23](23.md) | -| `30024` | Draft Long-form Content | [23](23.md) | -| `30078` | Application-specific Data | [78](78.md) | -| `30311` | Live Event | [53](53.md) | -| `30315` | User Statuses | [38](38.md) | -| `30402` | Classified Listing | [99](99.md) | -| `30403` | Draft Classified Listing | [99](99.md) | -| `31922` | Date-Based Calendar Event | [52](52.md) | -| `31923` | Time-Based Calendar Event | [52](52.md) | -| `31924` | Calendar | [52](52.md) | -| `31925` | Calendar Event RSVP | [52](52.md) | -| `31989` | Handler recommendation | [89](89.md) | -| `31990` | Handler information | [89](89.md) | -| `34550` | Community Definition | [72](72.md) | +| kind | description | NIP | +| ------------- | -------------------------- | ----------- | +| `0` | Metadata | [1](01.md) | +| `1` | Short Text Note | [1](01.md) | +| `2` | Recommend Relay | | +| `3` | Contacts | [2](02.md) | +| `4` | Encrypted Direct Messages | [4](04.md) | +| `5` | Event Deletion | [9](09.md) | +| `6` | Repost | [18](18.md) | +| `7` | Reaction | [25](25.md) | +| `8` | Badge Award | [58](58.md) | +| `16` | Generic Repost | [18](18.md) | +| `40` | Channel Creation | [28](28.md) | +| `41` | Channel Metadata | [28](28.md) | +| `42` | Channel Message | [28](28.md) | +| `43` | Channel Hide Message | [28](28.md) | +| `44` | Channel Mute User | [28](28.md) | +| `1063` | File Metadata | [94](94.md) | +| `1311` | Live Chat Message | [53](53.md) | +| `1040` | OpenTimestamps | [03](03.md) | +| `1984` | Reporting | [56](56.md) | +| `1985` | Label | [32](32.md) | +| `4550` | Community Post Approval | [72](72.md) | +| `5000`-`5999` | Job Request | [90](90.md) | +| `6000`-`6999` | Job Result | [90](90.md) | +| `7000` | Job Feedback | [90](90.md) | +| `9041` | Zap Goal | [75](75.md) | +| `9734` | Zap Request | [57](57.md) | +| `9735` | Zap | [57](57.md) | +| `9802` | Highlights | [84](84.md) | +| `10000` | Mute List | [51](51.md) | +| `10001` | Pin List | [51](51.md) | +| `10002` | Relay List Metadata | [65](65.md) | +| `13194` | Wallet Info | [47](47.md) | +| `22242` | Client Authentication | [42](42.md) | +| `23194` | Wallet Request | [47](47.md) | +| `23195` | Wallet Response | [47](47.md) | +| `24133` | Nostr Connect | [46](46.md) | +| `27235` | HTTP Auth | [98](98.md) | +| `30000` | Categorized People List | [51](51.md) | +| `30001` | Categorized Bookmark List | [51](51.md) | +| `30008` | Profile Badges | [58](58.md) | +| `30009` | Badge Definition | [58](58.md) | +| `30017` | Create or update a stall | [15](15.md) | +| `30018` | Create or update a product | [15](15.md) | +| `30023` | Long-form Content | [23](23.md) | +| `30024` | Draft Long-form Content | [23](23.md) | +| `30078` | Application-specific Data | [78](78.md) | +| `30311` | Live Event | [53](53.md) | +| `30315` | User Statuses | [38](38.md) | +| `30402` | Classified Listing | [99](99.md) | +| `30403` | Draft Classified Listing | [99](99.md) | +| `31922` | Date-Based Calendar Event | [52](52.md) | +| `31923` | Time-Based Calendar Event | [52](52.md) | +| `31924` | Calendar | [52](52.md) | +| `31925` | Calendar Event RSVP | [52](52.md) | +| `31989` | Handler recommendation | [89](89.md) | +| `31990` | Handler information | [89](89.md) | +| `34550` | Community Definition | [72](72.md) | ## Message types From cbdca1e9643711c62e06a19d9c2d889699a7978d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 10 Nov 2023 13:16:35 -0300 Subject: [PATCH 18/48] nip-84: remove all the "range" stuff, we can add later if the need arises. --- 84.md | 61 ----------------------------------------------------------- 1 file changed, 61 deletions(-) diff --git a/84.md b/84.md index 89bf88b1..4caab62a 100644 --- a/84.md +++ b/84.md @@ -35,64 +35,3 @@ last value of the tag. ### Context Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the surrounding content might be beneficial to give context to the higlight. - -### Ranges -Clients MAY include `range` tags with the start/end indexes of where the highlight begins and finishes within -the referenced article/tagged-event. - -``` -[ "range", , ] -``` - -Additionally a range with `context` as the third value of the tag MAY be added to indicate the begin/finish indexes -of the highlight within the included `context` tag. - -``` -[ "range", , , "context" ] -``` - -#### Text-based nostr events' highlights - -Highlights of Nostr events SHOULD use the range index of the content as-is -(e.g. NIP-23 articles include the markdown instead of computing the index from the rendered markdown). - -``` -[ "range", 3000, 3042 ] # highlight begins at index position 3000 of the tagged event's `.content` -[ "range", 42, 84, "context" ] # highlight begins at index position 42 of the `context` tag's value -``` - -#### Non-text-based nostr events' highlights - -A `kind:9802` event that tags a NIP-94 event which includes a video or audio file can use ranges to -indicate the start/end time position in seconds. - -#### Ranges in URL highlights - -When creating a highlight from a URL the range should be expressed over -the extracted plain text of the formatted content (e.g. rendered HTML instead of including the HTML markup); -this helps make finding the correct indexes easier on websites with markup variations on each render. - -e.g. `hello, world` - -Tagging `hello, world` would result in using a range tag like `["range", 0, 12 ]`. - -Text extraction (i.e. translation from non-plain text medium like HTML or PDF) is highly subjective and the value -of the range should be carefully interpreted by the different clients that support this. - -```json -{ - "created_at": 1682707885, - "content": "while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands", - "tags": [ - [ "r", "https://footstr.com/zapvertise/" ], - [ "p", "c48e29f04b482cc01ca1f9ef8c86ef8318c059e0e9353235162f080f26e14c11", "wss://relay.url", "author" ], - [ "context", "The Nostr zapvertising model creates a truly free market for advertisers, while allowing creators to simply keep doing what they’re doing. Creators don’t need to be blatant shills for brands, they just have to create high quality content people find valuable, and companies will naturally want to zapvertise on their posts." ] - [ "range", 3916, 4032 ], - [ "range", 74, 190, "context" ], - ], - "kind": 9802, - "pubkey": "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", - "id": "59e5887a3cdf32d5f11edf9b8cd098c620d278514b2edde3e6d1ba8a541d262c", - "sig": "f2d15b8bc2csf6d198350f8df0a31dcf66d7c32ec9c54e6b3f102d579370b7de9d164d70350a5b32a2911db3b124e972bafa9a1bc8fd60c1e338903d2f6306b0" -} -``` From b6c7a255102a65c4978b465a85f124e910e82a2d Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Fri, 10 Nov 2023 08:13:04 -0800 Subject: [PATCH 19/48] Clarify NIP 32 --- 32.md | 113 +++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 41 deletions(-) diff --git a/32.md b/32.md index c5c62728..f8dc0029 100644 --- a/32.md +++ b/32.md @@ -6,7 +6,30 @@ Labeling `draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay` -A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, including distributed moderation, collection management, license assignment, and content classification. +A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, +including distributed moderation, collection management, license assignment, and content classification. + +This NIP introduces two new tags: + +- `L` denotes a label namespace +- `l` denotes a label + +Label Namespace Tag +---- + +An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace +(such as an ISO standard) or reverse domain name notation. + +`L` tags are REQUIRED in order to support searching by namespace rather than by a specific tag. The special `ugc` +("user generated content") namespace MAY be used when the label content is provided by an end user. + +`L` tags starting with `#` indicate that the label target should be associated with the label's value. +This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc. + +Label Tag +---- + +An `l` tag's value can be any string. `l` tags MUST include a `mark` matching an `L` tag value in the same event. Label Target ---- @@ -16,37 +39,18 @@ labeled: `e`, `p`, `a`, `r`, or `t` tags. This allows for labeling of events, pe or topics respectively. As with NIP-01, a relay hint SHOULD be included when using `e` and `p` tags. -Label Tag ----- - -This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. -A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature -external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD -ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation. - -Namespaces starting with `#` indicate that the label target should be associated with the label's value. -This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc. - -Some examples: - -- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied. -- `["l", "", "#p"]` - the publisher thinks the given entity is related to `` -- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2. -- `["l", "VI-hum", "com.example.ontology"]` - Violence toward a human being as defined by ontology.example.com. - -`L` tags containing the label namespaces MUST be included in order to support searching by -namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace -MAY be used when the label content is provided by an end user. - -`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events -with a kind other than 1985, labels refer to the event itself. - Content ------- Labels should be short, meaningful strings. Longer discussions, such as for a review, or an explanation of why something was labeled the way it was, should go in the event's `content` field. +Self-Reporting +------- + +`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events +with a kind other than 1985, labels refer to the event itself. + Example events -------------- @@ -60,39 +64,61 @@ A suggestion that multiple pubkeys be associated with the `permies` topic. ["l", "permies", "#t"], ["p", , ], ["p", , ] - ], - "content": "", - ... + ] } ``` -A review of a relay. +A report flagging violence toward a human being as defined by ontology.example.com. ```json { "kind": 1985, "tags": [ ["L", "com.example.ontology"], - ["l", "relay/review", "com.example.ontology"], - ["r", ], - ["rating", "0.1"] - ], - "content": "This relay is full of mean people.", - ... + ["l", "VI-hum", "com.example.ontology"], + ["p", , ], + ["p", , ] + ] } ``` -Publishers can self-label by adding `l` tags to their own non-1985 events. +A moderation suggestion for a chat event. + +```json +{ + "kind": 1985, + "tags": [ + ["L", "nip28.moderation"], + ["l", "approve", "nip28.moderation"], + ["e", , ] + ], +} +``` + +Assignment of a license to an event. + +```json +{ + "kind": 1985, + "tags": [ + ["L", "license"], + ["l", "MIT", "license"], + ["e", , ] + ], +} +``` + +Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author +is labeling their note as being related to Milan, Italy using ISO 3166-2. ```json { "kind": 1, "tags": [ - ["L", "com.example.ontology"], - ["l", "IL-frd", "com.example.ontology"] + ["L", "ISO-3166-2"], + ["l", "IT-MI", "ISO-3166-2"] ], - "content": "Send me 100 sats and I'll send you 200 back", - ... + "content": "It's beautiful here in Milan!", } ``` @@ -115,3 +141,8 @@ Vocabularies MAY choose to fully qualify all labels within a namespace (for exam formal vocabularies that should not be confused with another namespace when querying without an `L` tag. For these vocabularies, all labels SHOULD include the namespace (rather than mixing qualified and unqualified labels). + +A good heuristic for whether a use case fits this NIP is whether labels would ever be unique. +For example, many events might be labeled with a particular place, topic, or pubkey, but labels +with specific values like "John Doe" or "3.18743" are not labels, they are values, and should +be handled in some other way. From f1433e0f0cb28d17102b530081b48d47e0ee38ac Mon Sep 17 00:00:00 2001 From: fiatjaf_ Date: Tue, 14 Nov 2023 18:38:48 -0300 Subject: [PATCH 20/48] add relay sets kind to nip-51 (#786) --- 51.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/51.md b/51.md index cbd6be11..e4d7c24e 100644 --- a/51.md +++ b/51.md @@ -129,6 +129,7 @@ Then the user would create a 'Categorized Bookmarks' list event like below: | 10001 | Pin | | 30000 | Categorized People | | 30001 | Categorized Bookmarks | +| 30002 | Categorized Relay Sets | ### Mute List @@ -145,4 +146,8 @@ An event with kind `30000` is defined as a parameterized replaceable list event ### Categorized Bookmarks List -An event of kind `30001` is defined as a parameterized replaceable list event for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. The bookmark lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). Any standardized tag can be included in a Categorized Bookmark List. \ No newline at end of file +An event of kind `30001` is defined as a parameterized replaceable list event for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. The bookmark lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). Any standardized tag can be included in a Categorized Bookmark List. + +### Categorized Relay Set + +An event of kind `30002` is defined as a parameterized replaceable list event for categorizing relays. The 'd' parameter for this event holds the category name of the list. The relays lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). These sets can be used by clients in order to determine which relays to query in different scenarios. From 5dc6071978bc7c2dcee807d16ef085192971ac27 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 00:22:09 -0300 Subject: [PATCH 21/48] cut, simplify and update NIP-51 to reflect the real-world usage. --- 51.md | 151 ++++-------------------------------------------------- README.md | 117 +++++++++++++++++++++--------------------- 2 files changed, 69 insertions(+), 199 deletions(-) diff --git a/51.md b/51.md index e4d7c24e..c74487f6 100644 --- a/51.md +++ b/51.md @@ -6,148 +6,19 @@ Lists `draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus` -A "list" event is defined as having a list of public and/or private tags. Public tags will be listed in the event `tags`. Private tags will be encrypted in the event `content`. Encryption for private tags will use [NIP-04 - Encrypted Direct Message](04.md) encryption, using the list author's private and public key for the shared secret. A distinct event kind should be used for each list type created. +This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**. -If a list should only be defined once per user (like the "mute" list) the list is declared as a _replaceable event_. These lists may be referred to as "replaceable lists". Otherwise, the list is a _parameterized replaceable event_ and the list name will be used as the `d` tag. These lists may be referred to as "parameterized replaceable lists". +Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`. -## Replaceable List Event Example +## Generic lists -Lets say a user wants to create a 'Mute' list and has keys: -``` -priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1 -pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d -``` -The user wants to publicly include these users: +The kinds `30000` and `30001` have been reserved for generic lists. These must be accompanied by a `d` tag identifying the list, but these are generally client-specific, except in the standard cases specified below. -```json -["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], -["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] -``` -and privately include these users (below is the JSON that would be encrypted and placed in the event content): +## Standard lists -```json -[ - ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"], - ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"] -] -``` - -Then the user would create a 'Mute' list event like below: - -```json -{ - "kind": 10000, - "tags": [ - ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], - ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], - ], - "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", - ...other fields -} -``` - - -## Parameterized Replaceable List Event Example - -Lets say a user wants to create a 'Categorized People' list of `nostr` people and has keys: -``` -priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1 -pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d -``` -The user wants to publicly include these users: - -```json -["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], -["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"] -``` -and privately include these users (below is the JSON that would be encrypted and placed in the event content): - -```json -[ - ["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"], - ["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"] -] -``` - -Then the user would create a 'Categorized People' list event like below: - -```json -{ - "kind": 30000, - "tags": [ - ["d", "nostr"], - ["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], - ["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], - ], - "content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", - ...other fields -} -``` - -Lets say a user wants to create a 'Categorized Bookmarks' list of `bookmarks` and has keys: -``` -priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1 -pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d -``` -The user wants to publicly include these bookmarks: - -```json -["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"], -["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], -["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"], -``` -and privately include these bookmarks (below is the JSON that would be encrypted and placed in the event content): - -```json -[ - ["r", "https://my-private.bookmark", "My private bookmark"], - ["a", "30001:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], -] -``` - -Then the user would create a 'Categorized Bookmarks' list event like below: - -```json -{ - "kind": 30001, - "tags": [ - ["d", "bookmarks"], - ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"], - ["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], - ["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"], - ], - "content": "y3AyaLJfnmYr9x9Od9o4aYrmL9+Ynmsim5y2ONrU0urOTq+V81CyAthQ2mUOWE9xwGgrizhY7ILdQwWhy6FK0sA33GHtC0egUJw1zIdknPe7BZjznD570yk/8RXYgGyDKdexME+RMYykrnYFxq1+y/h00kmJg4u+Gpn+ZjmVhNYxl9b+TiBOAXG9UxnK/H0AmUqDpcldn6+j1/AiStwYZhD1UZ3jzDIk2qcCDy7MlGnYhSP+kNmG+2b0T/D1L0Z7?iv=PGJJfPE84gacAh7T0e6duQ==", - ...other fields -} -``` - -## List Event Kinds - -| kind | list type | -| ------ | ----------------------- | -| 10000 | Mute | -| 10001 | Pin | -| 30000 | Categorized People | -| 30001 | Categorized Bookmarks | -| 30002 | Categorized Relay Sets | - - -### Mute List - -An event with kind `10000` is defined as a replaceable list event for listing content a user wants to mute. Any standardized tag can be included in a Mute List. - -### Pin List - -An event with kind `10001` is defined as a replaceable list event for listing content a user wants to pin. Any standardized tag can be included in a Pin List. - -### Categorized People List - -An event with kind `30000` is defined as a parameterized replaceable list event for categorizing people. The 'd' parameter for this event holds the category name of the list. The tags included in these lists MUST follow the format of kind 3 events as defined in [NIP-02 - Contact List and Petnames](02.md). - -### Categorized Bookmarks List - -An event of kind `30001` is defined as a parameterized replaceable list event for categorizing bookmarks. The 'd' parameter for this event holds the category name of the list. The bookmark lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). Any standardized tag can be included in a Categorized Bookmark List. - -### Categorized Relay Set - -An event of kind `30002` is defined as a parameterized replaceable list event for categorizing relays. The 'd' parameter for this event holds the category name of the list. The relays lists may contain metadata tags such as 'title', 'image', 'summary' as defined in [NIP-23 - Long-form Content](23.md). These sets can be used by clients in order to determine which relays to query in different scenarios. +| name | kind | "d" tag | description | expected tag items | +| --- | --- | --- | --- | --- | +| Muted list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | +| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | +| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | diff --git a/README.md b/README.md index 483056dc..74411ca5 100644 --- a/README.md +++ b/README.md @@ -74,66 +74,65 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-99: Classified Listings](99.md) ## Event Kinds -| kind | description | NIP | -| ------------- | -------------------------- | ----------- | -| `0` | Metadata | [1](01.md) | -| `1` | Short Text Note | [1](01.md) | -| `2` | Recommend Relay | | -| `3` | Contacts | [2](02.md) | -| `4` | Encrypted Direct Messages | [4](04.md) | -| `5` | Event Deletion | [9](09.md) | -| `6` | Repost | [18](18.md) | -| `7` | Reaction | [25](25.md) | -| `8` | Badge Award | [58](58.md) | -| `16` | Generic Repost | [18](18.md) | -| `40` | Channel Creation | [28](28.md) | -| `41` | Channel Metadata | [28](28.md) | -| `42` | Channel Message | [28](28.md) | -| `43` | Channel Hide Message | [28](28.md) | -| `44` | Channel Mute User | [28](28.md) | -| `1063` | File Metadata | [94](94.md) | -| `1311` | Live Chat Message | [53](53.md) | -| `1040` | OpenTimestamps | [03](03.md) | +| kind | description | NIP | +| ------------- | -------------------------- | ----------- | +| `0` | Metadata | [1](01.md) | +| `1` | Short Text Note | [1](01.md) | +| `2` | Recommend Relay | | +| `3` | Contacts | [2](02.md) | +| `4` | Encrypted Direct Messages | [4](04.md) | +| `5` | Event Deletion | [9](09.md) | +| `6` | Repost | [18](18.md) | +| `7` | Reaction | [25](25.md) | +| `8` | Badge Award | [58](58.md) | +| `16` | Generic Repost | [18](18.md) | +| `40` | Channel Creation | [28](28.md) | +| `41` | Channel Metadata | [28](28.md) | +| `42` | Channel Message | [28](28.md) | +| `43` | Channel Hide Message | [28](28.md) | +| `44` | Channel Mute User | [28](28.md) | +| `1063` | File Metadata | [94](94.md) | +| `1311` | Live Chat Message | [53](53.md) | +| `1040` | OpenTimestamps | [03](03.md) | | `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) | -| `1984` | Reporting | [56](56.md) | -| `1985` | Label | [32](32.md) | -| `4550` | Community Post Approval | [72](72.md) | -| `5000`-`5999` | Job Request | [90](90.md) | -| `6000`-`6999` | Job Result | [90](90.md) | -| `7000` | Job Feedback | [90](90.md) | -| `9041` | Zap Goal | [75](75.md) | -| `9734` | Zap Request | [57](57.md) | -| `9735` | Zap | [57](57.md) | -| `9802` | Highlights | [84](84.md) | -| `10000` | Mute List | [51](51.md) | -| `10001` | Pin List | [51](51.md) | -| `10002` | Relay List Metadata | [65](65.md) | -| `13194` | Wallet Info | [47](47.md) | -| `22242` | Client Authentication | [42](42.md) | -| `23194` | Wallet Request | [47](47.md) | -| `23195` | Wallet Response | [47](47.md) | -| `24133` | Nostr Connect | [46](46.md) | -| `27235` | HTTP Auth | [98](98.md) | -| `30000` | Categorized People List | [51](51.md) | -| `30001` | Categorized Bookmark List | [51](51.md) | -| `30008` | Profile Badges | [58](58.md) | -| `30009` | Badge Definition | [58](58.md) | -| `30017` | Create or update a stall | [15](15.md) | -| `30018` | Create or update a product | [15](15.md) | -| `30023` | Long-form Content | [23](23.md) | -| `30024` | Draft Long-form Content | [23](23.md) | -| `30078` | Application-specific Data | [78](78.md) | -| `30311` | Live Event | [53](53.md) | -| `30315` | User Statuses | [38](38.md) | -| `30402` | Classified Listing | [99](99.md) | -| `30403` | Draft Classified Listing | [99](99.md) | -| `31922` | Date-Based Calendar Event | [52](52.md) | -| `31923` | Time-Based Calendar Event | [52](52.md) | -| `31924` | Calendar | [52](52.md) | -| `31925` | Calendar Event RSVP | [52](52.md) | -| `31989` | Handler recommendation | [89](89.md) | -| `31990` | Handler information | [89](89.md) | -| `34550` | Community Definition | [72](72.md) | +| `1984` | Reporting | [56](56.md) | +| `1985` | Label | [32](32.md) | +| `4550` | Community Post Approval | [72](72.md) | +| `5000`-`5999` | Job Request | [90](90.md) | +| `6000`-`6999` | Job Result | [90](90.md) | +| `7000` | Job Feedback | [90](90.md) | +| `9041` | Zap Goal | [75](75.md) | +| `9734` | Zap Request | [57](57.md) | +| `9735` | Zap | [57](57.md) | +| `9802` | Highlights | [84](84.md) | +| `10002` | Relay List Metadata | [65](65.md) | +| `13194` | Wallet Info | [47](47.md) | +| `22242` | Client Authentication | [42](42.md) | +| `23194` | Wallet Request | [47](47.md) | +| `23195` | Wallet Response | [47](47.md) | +| `24133` | Nostr Connect | [46](46.md) | +| `27235` | HTTP Auth | [98](98.md) | +| `30000` | People List | [51](51.md) | +| `30001` | Things List | [51](51.md) | +| `30002` | Relay Set | [51](51.md) | +| `30008` | Profile Badges | [58](58.md) | +| `30009` | Badge Definition | [58](58.md) | +| `30017` | Create or update a stall | [15](15.md) | +| `30018` | Create or update a product | [15](15.md) | +| `30023` | Long-form Content | [23](23.md) | +| `30024` | Draft Long-form Content | [23](23.md) | +| `30078` | Application-specific Data | [78](78.md) | +| `30311` | Live Event | [53](53.md) | +| `30315` | User Statuses | [38](38.md) | +| `30402` | Classified Listing | [99](99.md) | +| `30403` | Draft Classified Listing | [99](99.md) | +| `31922` | Date-Based Calendar Event | [52](52.md) | +| `31923` | Time-Based Calendar Event | [52](52.md) | +| `31924` | Calendar | [52](52.md) | +| `31925` | Calendar Event RSVP | [52](52.md) | +| `31989` | Handler recommendation | [89](89.md) | +| `31990` | Handler information | [89](89.md) | +| `34550` | Community Definition | [72](72.md) | ## Message types From da05b5d9150200cec5a498ac180b6391abeddd69 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 00:47:15 -0300 Subject: [PATCH 22/48] add "communities" list and examples. --- 51.md | 44 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/51.md b/51.md index c74487f6..3ac89959 100644 --- a/51.md +++ b/51.md @@ -16,9 +16,41 @@ The kinds `30000` and `30001` have been reserved for generic lists. These must b ## Standard lists -| name | kind | "d" tag | description | expected tag items | -| --- | --- | --- | --- | --- | -| Muted list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | -| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | -| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | -| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | +| name | kind | "d" tag | description | expected tag items | +| --- | --- | --- | --- | --- | +| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | +| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | +| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | +| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | + +## Examples + +### A _Mute list_ with some public items and some encrypted items + +```json +{ + "id": "a92a316b75e44cfdc19986c634049158d4206fcc0b7b9c7ccbcdabe28beebcd0", + "pubkey": "854043ae8f1f97430ca8c1f1a090bdde6488bd5115c7a45307a2a212750ae4cb", + "created_at": 1699597889, + "kind": 30000, + "tags": [ + ["d", "mute"], + ["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"], + ["p", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"] + ], + "content": "TJob1dQrf2ndsmdbeGU+05HT5GMnBSx3fx8QdDY/g3NvCa7klfzgaQCmRZuo1d3WQjHDOjzSY1+MgTK5WjewFFumCcOZniWtOMSga9tJk1ky00tLoUUzyLnb1v9x95h/iT/KpkICJyAwUZ+LoJBUzLrK52wNTMt8M5jSLvCkRx8C0BmEwA/00pjOp4eRndy19H4WUUehhjfV2/VV/k4hMAjJ7Bb5Hp9xdmzmCLX9+64+MyeIQQjQAHPj8dkSsRahP7KS3MgMpjaF8nL48Bg5suZMxJayXGVp3BLtgRZx5z5nOk9xyrYk+71e2tnP9IDvSMkiSe76BcMct+m7kGVrRcavDI4n62goNNh25IpghT+a1OjjkpXt9me5wmaL7fxffV1pchdm+A7KJKIUU3kLC7QbUifF22EucRA9xiEyxETusNludBXN24O3llTbOy4vYFsq35BeZl4v1Cse7n2htZicVkItMz3wjzj1q1I1VqbnorNXFgllkRZn4/YXfTG/RMnoK/bDogRapOV+XToZ+IvsN0BqwKSUDx+ydKpci6htDRF2WDRkU+VQMqwM0CoLzy2H6A2cqyMMMD9SLRRzBg==?iv=S3rFeFr1gsYqmQA7bNnNTQ==", + "sig": "1173822c53261f8cffe7efbf43ba4a97a9198b3e402c2a1df130f42a8985a2d0d3430f4de350db184141e45ca844ab4e5364ea80f11d720e36357e1853dba6ca" +} +``` + +## Encryption process pseudocode + +```scala +val private_items = [ + ["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"], + ["a", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"], +] +val base64blob = nip04.encrypt(json.encode_to_string(private_items)) +event.content = base64blob +``` From 1bbd87c42fe6ca6caa7582fdb89a355b6dfc70f4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 07:33:26 -0300 Subject: [PATCH 23/48] distinction between lists and sets. --- 51.md | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/51.md b/51.md index 3ac89959..b184f428 100644 --- a/51.md +++ b/51.md @@ -14,19 +14,31 @@ Public items in a list are specified in the event `tags` array, while private it The kinds `30000` and `30001` have been reserved for generic lists. These must be accompanied by a `d` tag identifying the list, but these are generally client-specific, except in the standard cases specified below. -## Standard lists +### Standard lists -| name | kind | "d" tag | description | expected tag items | -| --- | --- | --- | --- | --- | -| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | -| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | -| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | -| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | -| Relay sets | 30002 | (user-defined) | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | +These are some standards that emerged in the wild: + +| name | kind | "d" tag | description | expected tag items | +| --- | --- | --- | --- | --- | +| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | +| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | +| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | + +## Sets + +Sets are lists with well-defined meaning and purpose and user-assigned `d` tags meant to be displayed in the UI. For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which relays they will publish an event or from which relays they will read the replies to an event; or _curation sets_ can be used by apps to showcase curations made by others tagged to different topics. + +Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tag that can be used to enhance their UI. + +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | +| Article Curation sets | 30003 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles) | ## Examples -### A _Mute list_ with some public items and some encrypted items +### A _mute list_ with some public items and some encrypted items ```json { From cf1b17280f5ba97c7f3bf1f699494f1551de8064 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 08:24:46 -0300 Subject: [PATCH 24/48] bring back kind:10000 mute lists, deprecation notice about kind:30000/"mute" and more examples. --- 51.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 105 insertions(+), 15 deletions(-) diff --git a/51.md b/51.md index b184f428..d113f805 100644 --- a/51.md +++ b/51.md @@ -6,35 +6,64 @@ Lists `draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus` -This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**. +This NIP defines lists of things that users can create. Lists can contain references to anything, and these +references can be **public** or **private**. -Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`. +Public items in a list are specified in the event `tags` array, while private items are specified in a JSON +array that mimics the structure of the event `tags` array, but stringified and encrypted using the same +scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and +stored in the `.content`. -## Generic lists +## Types of lists -The kinds `30000` and `30001` have been reserved for generic lists. These must be accompanied by a `d` tag identifying the list, but these are generally client-specific, except in the standard cases specified below. +### Generic lists -### Standard lists +The kind `30001` has been reserved for generic lists. These must be accompanied by a `d` tag identifying the +list, but these have no standard meaning and are generally client-specific (except in the standard cases +specified below). -These are some standards that emerged in the wild: +## Standard lists + +Users are expected to have a single list of each of these types. They have special meaning and clients may +rely on them to augment the user profile or browsing experience. + +For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in +their feeds or receive annoying notifications from. | name | kind | "d" tag | description | expected tag items | | --- | --- | --- | --- | --- | -| Mute list | 30000 | `"mute"` | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | +| Mute list | 10000 | | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | | Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | | Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | | Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | ## Sets -Sets are lists with well-defined meaning and purpose and user-assigned `d` tags meant to be displayed in the UI. For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which relays they will publish an event or from which relays they will read the replies to an event; or _curation sets_ can be used by apps to showcase curations made by others tagged to different topics. +Sets are lists with well-defined meaning that can enhance the functionality and the UI of clients that rely +on them. Unlike standard lists, users are expected to have more than one set of each kind, therefore each of +them must be assigned a different `"d"` identifier. -Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tag that can be used to enhance their UI. +For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which +relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ +can be used by apps to showcase curations made by others tagged to different topics. -| name | kind | description | expected tag items | -| --- | --- | --- | --- | -| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | -| Article Curation sets | 30003 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles) | +Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a +`"description"` tag that can be used to enhance their UI. + +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | +| Article Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | + +## Deprecated standard lists + +Some clients have used these lists in the past, but they should work on transitioning to the [standard formats](#standard-lists) above: + +- kind:30000 and `d` "mute" + +| kind | "d" tag | use instead | +| --- | --- | --- | +| 30000 | `"mute"` | kind 10000 _mute list_ | ## Examples @@ -45,9 +74,8 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti "id": "a92a316b75e44cfdc19986c634049158d4206fcc0b7b9c7ccbcdabe28beebcd0", "pubkey": "854043ae8f1f97430ca8c1f1a090bdde6488bd5115c7a45307a2a212750ae4cb", "created_at": 1699597889, - "kind": 30000, + "kind": 10000, "tags": [ - ["d", "mute"], ["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"], ["p", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"] ], @@ -56,6 +84,68 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti } ``` +### A _communities list_ with just public items + +```json +{ + "id": "da6b18c5452b5a60bf49588fc13ae4d1a047519c13e49a77b3184e6188c7bb1c", + "pubkey": "83fd07de9b763334cc9d46f2785c2558e6c2eabfe7d0c6ec214667cbaec50d47", + "created_at": 1689082210, + "kind": 30001, + "tags": [ + [ + "d", + "communities" + ], + [ + "a", + "34550:83fd07de9b763334cc9d46f2785c2558e6c2eabfe7d0c6ec214667cbaec50d47:meme" + ], + [ + "a", + "34550:b9a537523bba2fcdae857d90d8a760de4f2139c9f90d986f747ce7d0ec0d173d:NoBullshitBitcoin" + ] + ], + "content": "", + "sig": "e400cc8bf24955243137e4456b22142fdff400a7950cf0b0ac2ee86ed78671e2fddf9a9b40c77ccf8397f9c21d608b3fab3678ff13713fc3f97a4394cf766079" +} +``` + +### A _curation set_ of articles and notes about yaks + +``` +{ + "id": "567b41fc9060c758c4216fe5f8d3df7c57daad7ae757fa4606f0c39d4dd220ef", + "pubkey": "d6dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c", + "created_at": 1695327657, + "kind": 30004, + "tags": [ + [ + "d", + "jvdy9i4" + ], + [ + "title", + "Yaks" + ], + [ + "summary", + "The domestic yak, also known as the Tartary ox, grunting ox, or hairy cattle, is a species of long-haired domesticated cattle found throughout the Himalayan region of the Indian subcontinent, the Tibetan Plateau, Gilgit-Baltistan, Tajikistan and as far north as Mongolia and Siberia." + ], + [ + "image", + "https://cdn.britannica.com/40/188540-050-9AC748DE/Yak-Himalayas-Nepal.jpg" + ], + ["a", "30023:26dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:95ODQzw3ajNoZ8SyMDOzQ"], + ["a", "30023:54af95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:1-MYP8dAhramH9J5gJWKx"], + ["a", "30023:f8fe95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:D2Tbd38bGrFvU0bIbvSMt"], + ["e", "d78ba0d5dce22bfff9db0a9e996c9ef27e2c91051de0c4e1da340e0326b4941e"] + ], + "content": "", + "sig": "a9a4e2192eede77e6c9d24ddfab95ba3ff7c03fbd07ad011fff245abea431fb4d3787c2d04aad001cb039cb8de91d83ce30e9a94f82ac3c5a2372aa1294a96bd" +} +``` + ## Encryption process pseudocode ```scala From fd288d4ea9c5aef08747f91db90339b73cce0640 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 08:28:59 -0300 Subject: [PATCH 25/48] update readme kind list. --- README.md | 121 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 74411ca5..94be17e7 100644 --- a/README.md +++ b/README.md @@ -74,65 +74,68 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-99: Classified Listings](99.md) ## Event Kinds -| kind | description | NIP | -| ------------- | -------------------------- | ----------- | -| `0` | Metadata | [1](01.md) | -| `1` | Short Text Note | [1](01.md) | -| `2` | Recommend Relay | | -| `3` | Contacts | [2](02.md) | -| `4` | Encrypted Direct Messages | [4](04.md) | -| `5` | Event Deletion | [9](09.md) | -| `6` | Repost | [18](18.md) | -| `7` | Reaction | [25](25.md) | -| `8` | Badge Award | [58](58.md) | -| `16` | Generic Repost | [18](18.md) | -| `40` | Channel Creation | [28](28.md) | -| `41` | Channel Metadata | [28](28.md) | -| `42` | Channel Message | [28](28.md) | -| `43` | Channel Hide Message | [28](28.md) | -| `44` | Channel Mute User | [28](28.md) | -| `1063` | File Metadata | [94](94.md) | -| `1311` | Live Chat Message | [53](53.md) | -| `1040` | OpenTimestamps | [03](03.md) | -| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) | -| `1984` | Reporting | [56](56.md) | -| `1985` | Label | [32](32.md) | -| `4550` | Community Post Approval | [72](72.md) | -| `5000`-`5999` | Job Request | [90](90.md) | -| `6000`-`6999` | Job Result | [90](90.md) | -| `7000` | Job Feedback | [90](90.md) | -| `9041` | Zap Goal | [75](75.md) | -| `9734` | Zap Request | [57](57.md) | -| `9735` | Zap | [57](57.md) | -| `9802` | Highlights | [84](84.md) | -| `10002` | Relay List Metadata | [65](65.md) | -| `13194` | Wallet Info | [47](47.md) | -| `22242` | Client Authentication | [42](42.md) | -| `23194` | Wallet Request | [47](47.md) | -| `23195` | Wallet Response | [47](47.md) | -| `24133` | Nostr Connect | [46](46.md) | -| `27235` | HTTP Auth | [98](98.md) | -| `30000` | People List | [51](51.md) | -| `30001` | Things List | [51](51.md) | -| `30002` | Relay Set | [51](51.md) | -| `30008` | Profile Badges | [58](58.md) | -| `30009` | Badge Definition | [58](58.md) | -| `30017` | Create or update a stall | [15](15.md) | -| `30018` | Create or update a product | [15](15.md) | -| `30023` | Long-form Content | [23](23.md) | -| `30024` | Draft Long-form Content | [23](23.md) | -| `30078` | Application-specific Data | [78](78.md) | -| `30311` | Live Event | [53](53.md) | -| `30315` | User Statuses | [38](38.md) | -| `30402` | Classified Listing | [99](99.md) | -| `30403` | Draft Classified Listing | [99](99.md) | -| `31922` | Date-Based Calendar Event | [52](52.md) | -| `31923` | Time-Based Calendar Event | [52](52.md) | -| `31924` | Calendar | [52](52.md) | -| `31925` | Calendar Event RSVP | [52](52.md) | -| `31989` | Handler recommendation | [89](89.md) | -| `31990` | Handler information | [89](89.md) | -| `34550` | Community Definition | [72](72.md) | +| kind | description | NIP | +| ------------- | -------------------------- | ----------- | +| `0` | Metadata | [1](01.md) | +| `1` | Short Text Note | [1](01.md) | +| `2` | Recommend Relay | | +| `3` | Contacts | [2](02.md) | +| `4` | Encrypted Direct Messages | [4](04.md) | +| `5` | Event Deletion | [9](09.md) | +| `6` | Repost | [18](18.md) | +| `7` | Reaction | [25](25.md) | +| `8` | Badge Award | [58](58.md) | +| `16` | Generic Repost | [18](18.md) | +| `40` | Channel Creation | [28](28.md) | +| `41` | Channel Metadata | [28](28.md) | +| `42` | Channel Message | [28](28.md) | +| `43` | Channel Hide Message | [28](28.md) | +| `44` | Channel Mute User | [28](28.md) | +| `1063` | File Metadata | [94](94.md) | +| `1311` | Live Chat Message | [53](53.md) | +| `1040` | OpenTimestamps | [03](03.md) | +| `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] | +| `1984` | Reporting | [56](56.md) | +| `1985` | Label | [32](32.md) | +| `4550` | Community Post Approval | [72](72.md) | +| `5000`-`5999` | Job Request | [90](90.md) | +| `6000`-`6999` | Job Result | [90](90.md) | +| `7000` | Job Feedback | [90](90.md) | +| `9041` | Zap Goal | [75](75.md) | +| `9734` | Zap Request | [57](57.md) | +| `9735` | Zap | [57](57.md) | +| `9802` | Highlights | [84](84.md) | +| `10000` | Mute list | [65](65.md) | +| `10002` | Relay List Metadata | [65](65.md) | +| `13194` | Wallet Info | [47](47.md) | +| `22242` | Client Authentication | [42](42.md) | +| `23194` | Wallet Request | [47](47.md) | +| `23195` | Wallet Response | [47](47.md) | +| `24133` | Nostr Connect | [46](46.md) | +| `27235` | HTTP Auth | [98](98.md) | +| `30001` | Generic lists | [51](51.md) | +| `30002` | Relay sets | [51](51.md) | +| `30004` | Curation sets | [51](51.md) | +| `30008` | Profile Badges | [58](58.md) | +| `30009` | Badge Definition | [58](58.md) | +| `30017` | Create or update a stall | [15](15.md) | +| `30018` | Create or update a product | [15](15.md) | +| `30023` | Long-form Content | [23](23.md) | +| `30024` | Draft Long-form Content | [23](23.md) | +| `30078` | Application-specific Data | [78](78.md) | +| `30311` | Live Event | [53](53.md) | +| `30315` | User Statuses | [38](38.md) | +| `30402` | Classified Listing | [99](99.md) | +| `30403` | Draft Classified Listing | [99](99.md) | +| `31922` | Date-Based Calendar Event | [52](52.md) | +| `31923` | Time-Based Calendar Event | [52](52.md) | +| `31924` | Calendar | [52](52.md) | +| `31925` | Calendar Event RSVP | [52](52.md) | +| `31989` | Handler recommendation | [89](89.md) | +| `31990` | Handler information | [89](89.md) | +| `34550` | Community Definition | [72](72.md) | + +[nostrocket-1971]: https://github.com/nostrocket/NIPS/blob/main/Problems.md ## Message types From 54befcc09a3fdd804ee3f98a8a670c582cd101cc Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 15:32:09 -0300 Subject: [PATCH 26/48] deprecate the 30001 ad-hoc pin/bookmark/communities lists and use new kinds. --- 51.md | 23 ++++++++++++----------- README.md | 5 ++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/51.md b/51.md index d113f805..d316bad1 100644 --- a/51.md +++ b/51.md @@ -30,12 +30,12 @@ rely on them to augment the user profile or browsing experience. For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. -| name | kind | "d" tag | description | expected tag items | -| --- | --- | --- | --- | --- | -| Mute list | 10000 | | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | -| Bookmarks list | 30001 | `"bookmark"` | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | -| Pin list | 30001 | `"pin"` | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | -| Communities list | 30001 | `"communities"` | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | +| Pin list | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Bookmarks list | 10003 | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | +| Communities list | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | ## Sets @@ -59,11 +59,12 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti Some clients have used these lists in the past, but they should work on transitioning to the [standard formats](#standard-lists) above: -- kind:30000 and `d` "mute" - -| kind | "d" tag | use instead | -| --- | --- | --- | -| 30000 | `"mute"` | kind 10000 _mute list_ | +| kind | "d" tag | use instead | +| --- | --- | --- | +| 30000 | `"mute"` | kind 10000 _mute list_ | +| 30001 | `"pin"` | kind 10001 _pin list_ | +| 30001 | `"bookmark"` | kind 10003 _bookmarks list_ | +| 30001 | `"communities"` | kind 10004 _communities list_ | ## Examples diff --git a/README.md b/README.md index 94be17e7..c0286ca4 100644 --- a/README.md +++ b/README.md @@ -105,8 +105,11 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `9734` | Zap Request | [57](57.md) | | `9735` | Zap | [57](57.md) | | `9802` | Highlights | [84](84.md) | -| `10000` | Mute list | [65](65.md) | +| `10000` | Mute list | [51](51.md) | +| `10001` | Pin list | [51](51.md) | | `10002` | Relay List Metadata | [65](65.md) | +| `10003` | Bookmark list | [51](51.md) | +| `10004` | Communities list | [51](51.md) | | `13194` | Wallet Info | [47](47.md) | | `22242` | Client Authentication | [42](42.md) | | `23194` | Wallet Request | [47](47.md) | From 61b736574cde8e954efe70da3c8c9116297cebf0 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 15:32:22 -0300 Subject: [PATCH 27/48] add kind 30005 follow sets. --- 51.md | 9 +++++---- README.md | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/51.md b/51.md index d316bad1..e0bafdb8 100644 --- a/51.md +++ b/51.md @@ -50,10 +50,11 @@ can be used by apps to showcase curations made by others tagged to different top Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tag that can be used to enhance their UI. -| name | kind | description | expected tag items | -| --- | --- | --- | --- | -| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | -| Article Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | +| Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | +| Follow sets | 30005 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | ## Deprecated standard lists diff --git a/README.md b/README.md index c0286ca4..6894daa9 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30001` | Generic lists | [51](51.md) | | `30002` | Relay sets | [51](51.md) | | `30004` | Curation sets | [51](51.md) | +| `30005` | Follow sets | [51](51.md) | | `30008` | Profile Badges | [58](58.md) | | `30009` | Badge Definition | [58](58.md) | | `30017` | Create or update a stall | [15](15.md) | From 4db99145d7ae9df84f3d99681fa2df8320702a75 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 15:34:46 -0300 Subject: [PATCH 28/48] remove legacy communities list example. --- 51.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/51.md b/51.md index e0bafdb8..3fc68309 100644 --- a/51.md +++ b/51.md @@ -86,33 +86,6 @@ Some clients have used these lists in the past, but they should work on transiti } ``` -### A _communities list_ with just public items - -```json -{ - "id": "da6b18c5452b5a60bf49588fc13ae4d1a047519c13e49a77b3184e6188c7bb1c", - "pubkey": "83fd07de9b763334cc9d46f2785c2558e6c2eabfe7d0c6ec214667cbaec50d47", - "created_at": 1689082210, - "kind": 30001, - "tags": [ - [ - "d", - "communities" - ], - [ - "a", - "34550:83fd07de9b763334cc9d46f2785c2558e6c2eabfe7d0c6ec214667cbaec50d47:meme" - ], - [ - "a", - "34550:b9a537523bba2fcdae857d90d8a760de4f2139c9f90d986f747ce7d0ec0d173d:NoBullshitBitcoin" - ] - ], - "content": "", - "sig": "e400cc8bf24955243137e4456b22142fdff400a7950cf0b0ac2ee86ed78671e2fddf9a9b40c77ccf8397f9c21d608b3fab3678ff13713fc3f97a4394cf766079" -} -``` - ### A _curation set_ of articles and notes about yaks ``` From 804ee187c2c18d6896ff2ef4e001eb55bd1e7af6 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 15:39:23 -0300 Subject: [PATCH 29/48] make follow sets kind 30000 as per @monlovesmango's comment. --- 51.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/51.md b/51.md index 3fc68309..d319b815 100644 --- a/51.md +++ b/51.md @@ -52,9 +52,9 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti | name | kind | description | expected tag items | | --- | --- | --- | --- | +| Follow sets | 30000 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | | Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | | Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | -| Follow sets | 30005 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | ## Deprecated standard lists diff --git a/README.md b/README.md index 6894daa9..23772adf 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,10 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `23195` | Wallet Response | [47](47.md) | | `24133` | Nostr Connect | [46](46.md) | | `27235` | HTTP Auth | [98](98.md) | +| `30000` | Follow sets | [51](51.md) | | `30001` | Generic lists | [51](51.md) | | `30002` | Relay sets | [51](51.md) | | `30004` | Curation sets | [51](51.md) | -| `30005` | Follow sets | [51](51.md) | | `30008` | Profile Badges | [58](58.md) | | `30009` | Badge Definition | [58](58.md) | | `30017` | Create or update a stall | [15](15.md) | From cd598bad5b90eba56eea67bfa512038112fb1ac8 Mon Sep 17 00:00:00 2001 From: fiatjaf_ Date: Wed, 15 Nov 2023 20:06:00 -0300 Subject: [PATCH 30/48] remove the point that makes kind 30001 be a grab-bag of things Co-authored-by: hodlbod --- 51.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/51.md b/51.md index d319b815..b3256f79 100644 --- a/51.md +++ b/51.md @@ -18,9 +18,6 @@ stored in the `.content`. ### Generic lists -The kind `30001` has been reserved for generic lists. These must be accompanied by a `d` tag identifying the -list, but these have no standard meaning and are generally client-specific (except in the standard cases -specified below). ## Standard lists From 6c3eebf510cd7adb5db6a2598ffb5796693fc4dd Mon Sep 17 00:00:00 2001 From: fiatjaf_ Date: Wed, 15 Nov 2023 20:06:49 -0300 Subject: [PATCH 31/48] clarify that standard lists use normal replaceable events Co-authored-by: hodlbod --- 51.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/51.md b/51.md index b3256f79..1fd3ef58 100644 --- a/51.md +++ b/51.md @@ -21,8 +21,9 @@ stored in the `.content`. ## Standard lists -Users are expected to have a single list of each of these types. They have special meaning and clients may -rely on them to augment the user profile or browsing experience. +Standard lists use non-parameterized replaceable events, meaning users may only have a single list +of each kind. They have special meaning and clients may rely on them to augment a user's profile or +browsing experience. For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. From 31382e57a1fabea855300461e7ef2dc751aaba61 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 20:52:10 -0300 Subject: [PATCH 32/48] add muted words, blocked relays, search relays, chat groups, emoji list and emoji sets. update set metadata tags. following @vitorpamplona, @frnandu, @snowcait, @hzrd149 closes https://github.com/nostr-protocol/nips/pull/559 closes https://github.com/nostr-protocol/nips/pull/673 --- 51.md | 46 ++++++++++++++++++---------------------------- README.md | 5 +++++ 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/51.md b/51.md index 1fd3ef58..86713701 100644 --- a/51.md +++ b/51.md @@ -16,9 +16,6 @@ stored in the `.content`. ## Types of lists -### Generic lists - - ## Standard lists Standard lists use non-parameterized replaceable events, meaning users may only have a single list @@ -28,12 +25,16 @@ browsing experience. For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. -| name | kind | description | expected tag items | -| --- | --- | --- | --- | -| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags) | -| Pin list | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | -| Bookmarks list | 10003 | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | -| Communities list | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) | +| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Bookmarks | 10003 | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | +| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | +| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 community definitions) | +| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | +| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | +| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) | ## Sets @@ -45,18 +46,19 @@ For example, _relay sets_ can be displayed in a dropdown UI to give users the op relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ can be used by apps to showcase curations made by others tagged to different topics. -Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a -`"description"` tag that can be used to enhance their UI. +Aside from their main identifier, the `"d"` tag, sets can optionally have a `"name"`, a `"picture"` and an +`"about"` tag that can be used to enhance their UI. | name | kind | description | expected tag items | | --- | --- | --- | --- | | Follow sets | 30000 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | | Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | | Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | +| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | ## Deprecated standard lists -Some clients have used these lists in the past, but they should work on transitioning to the [standard formats](#standard-lists) above: +Some clients have used these lists in the past, but they should work on transitioning to the [standard formats](#standard-lists) above. | kind | "d" tag | use instead | | --- | --- | --- | @@ -93,22 +95,10 @@ Some clients have used these lists in the past, but they should work on transiti "created_at": 1695327657, "kind": 30004, "tags": [ - [ - "d", - "jvdy9i4" - ], - [ - "title", - "Yaks" - ], - [ - "summary", - "The domestic yak, also known as the Tartary ox, grunting ox, or hairy cattle, is a species of long-haired domesticated cattle found throughout the Himalayan region of the Indian subcontinent, the Tibetan Plateau, Gilgit-Baltistan, Tajikistan and as far north as Mongolia and Siberia." - ], - [ - "image", - "https://cdn.britannica.com/40/188540-050-9AC748DE/Yak-Himalayas-Nepal.jpg" - ], + ["d", "jvdy9i4"], + ["name", "Yaks"], + ["picture", "https://cdn.britannica.com/40/188540-050-9AC748DE/Yak-Himalayas-Nepal.jpg"], + ["about", "The domestic yak, also known as the Tartary ox, grunting ox, or hairy cattle, is a species of long-haired domesticated cattle found throughout the Himalayan region of the Indian subcontinent, the Tibetan Plateau, Gilgit-Baltistan, Tajikistan and as far north as Mongolia and Siberia."], ["a", "30023:26dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:95ODQzw3ajNoZ8SyMDOzQ"], ["a", "30023:54af95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:1-MYP8dAhramH9J5gJWKx"], ["a", "30023:f8fe95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c:D2Tbd38bGrFvU0bIbvSMt"], diff --git a/README.md b/README.md index 23772adf..91d6f84a 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,10 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10002` | Relay List Metadata | [65](65.md) | | `10003` | Bookmark list | [51](51.md) | | `10004` | Communities list | [51](51.md) | +| `10005` | Public chats list | [51](51.md) | +| `10006` | Blocked relays list | [51](51.md) | +| `10007` | Search relays list | [51](51.md) | +| `10030` | User emoji list | [51](51.md) | | `13194` | Wallet Info | [47](47.md) | | `22242` | Client Authentication | [42](42.md) | | `23194` | Wallet Request | [47](47.md) | @@ -122,6 +126,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30004` | Curation sets | [51](51.md) | | `30008` | Profile Badges | [58](58.md) | | `30009` | Badge Definition | [58](58.md) | +| `30030` | Emoji sets | [51](51.md) | | `30017` | Create or update a stall | [15](15.md) | | `30018` | Create or update a product | [15](15.md) | | `30023` | Long-form Content | [23](23.md) | From 37f6cbb775126b386414220f783ca0f5f85e7614 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Wed, 15 Nov 2023 21:42:51 -0300 Subject: [PATCH 33/48] remove all NIP authors. --- 01.md | 2 +- 02.md | 2 +- 03.md | 2 +- 04.md | 2 +- 05.md | 2 +- 06.md | 2 +- 07.md | 2 +- 08.md | 2 +- 09.md | 2 +- 10.md | 2 +- 11.md | 2 +- 12.md | 2 +- 13.md | 2 +- 14.md | 2 +- 15.md | 2 +- 16.md | 2 +- 18.md | 2 +- 19.md | 2 +- 20.md | 2 +- 21.md | 2 +- 22.md | 2 +- 23.md | 2 +- 24.md | 2 +- 25.md | 2 +- 26.md | 2 +- 27.md | 2 +- 28.md | 2 +- 30.md | 2 +- 31.md | 2 +- 32.md | 2 +- 33.md | 2 +- 36.md | 2 +- 38.md | 2 +- 39.md | 2 +- 40.md | 2 +- 42.md | 2 +- 45.md | 2 +- 46.md | 2 +- 47.md | 2 +- 48.md | 2 +- 50.md | 2 +- 51.md | 2 +- 52.md | 2 +- 53.md | 2 +- 56.md | 2 +- 57.md | 2 +- 58.md | 2 +- 65.md | 2 +- 72.md | 2 +- 75.md | 2 +- 78.md | 2 +- 84.md | 2 +- 89.md | 2 +- 90.md | 2 +- 94.md | 2 +- 98.md | 2 +- 99.md | 2 +- 57 files changed, 57 insertions(+), 57 deletions(-) diff --git a/01.md b/01.md index cb4f522d..dafea1d0 100644 --- a/01.md +++ b/01.md @@ -4,7 +4,7 @@ NIP-01 Basic protocol flow description ------------------------------- -`draft` `mandatory` `author:fiatjaf` `author:distbit` `author:scsibug` `author:kukks` `author:jb55` `author:semisol` `author:cameri` `author:Giszmo` +`draft` `mandatory` This NIP defines the basic protocol that should be implemented by everybody. New NIPs may add new optional (or mandatory) fields and messages and features to the structures and flows described here. diff --git a/02.md b/02.md index 2f199080..0653d062 100644 --- a/02.md +++ b/02.md @@ -4,7 +4,7 @@ NIP-02 Contact List and Petnames ------------------------- -`final` `optional` `author:fiatjaf` `author:arcbtc` +`final` `optional` A special event with kind `3`, meaning "contact list" is defined as having a list of `p` tags, one for each of the followed/known profiles one is following. diff --git a/03.md b/03.md index 680cc8b2..8b7deb62 100644 --- a/03.md +++ b/03.md @@ -4,7 +4,7 @@ NIP-03 OpenTimestamps Attestations for Events -------------------------------------- -`draft` `optional` `author:fiatjaf` `author:constant` +`draft` `optional` This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps](https://opentimestamps.org/) proof for any other event: diff --git a/04.md b/04.md index 6e45b74b..bf6767b7 100644 --- a/04.md +++ b/04.md @@ -4,7 +4,7 @@ NIP-04 Encrypted Direct Message ------------------------ -`final` `optional` `author:arcbtc` +`final` `optional` A special event with kind `4`, meaning "encrypted direct message". It is supposed to have the following attributes: diff --git a/05.md b/05.md index 00d69af6..64375506 100644 --- a/05.md +++ b/05.md @@ -4,7 +4,7 @@ NIP-05 Mapping Nostr keys to DNS-based internet identifiers ---------------------------------------------------- -`final` `optional` `author:fiatjaf` `author:mikedilger` +`final` `optional` On events of kind `0` (`metadata`) one can specify the key `"nip05"` with an [internet identifier](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) (an email-like address) as the value. Although there is a link to a very liberal "internet identifier" specification above, NIP-05 assumes the `` part will be restricted to the characters `a-z0-9-_.`, case-insensitive. diff --git a/06.md b/06.md index a0b4a01b..0e502543 100644 --- a/06.md +++ b/06.md @@ -4,7 +4,7 @@ NIP-06 Basic key derivation from mnemonic seed phrase ---------------------------------------------- -`draft` `optional` `author:fiatjaf` +`draft` `optional` [BIP39](https://bips.xyz/39) is used to generate mnemonic seed words and derive a binary seed from them. diff --git a/07.md b/07.md index 51ddc165..01af6f40 100644 --- a/07.md +++ b/07.md @@ -4,7 +4,7 @@ NIP-07 `window.nostr` capability for web browsers ------------------------------------------ -`draft` `optional` `author:fiatjaf` +`draft` `optional` The `window.nostr` object may be made available by web browsers or extensions and websites or web-apps may make use of it after checking its availability. diff --git a/08.md b/08.md index 6793e0bb..f4f4341d 100644 --- a/08.md +++ b/08.md @@ -6,7 +6,7 @@ NIP-08 Handling Mentions ----------------- -`final` `unrecommended` `optional` `author:fiatjaf` `author:scsibug` +`final` `unrecommended` `optional` This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of `text_note`s. diff --git a/09.md b/09.md index 9dab90ff..f92410fa 100644 --- a/09.md +++ b/09.md @@ -4,7 +4,7 @@ NIP-09 Event Deletion -------------- -`draft` `optional` `author:scsibug` +`draft` `optional` A special event with kind `5`, meaning "deletion" is defined as having a list of one or more `e` tags, each referencing an event the author is requesting to be deleted. diff --git a/10.md b/10.md index 9c79b4a2..5b19fbd3 100644 --- a/10.md +++ b/10.md @@ -5,7 +5,7 @@ NIP-10 On "e" and "p" tags in Text Events (kind 1). -------------------------------------------- -`draft` `optional` `author:unclebobmartin` +`draft` `optional` ## Abstract This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event. diff --git a/11.md b/11.md index deb6f197..017e5d42 100644 --- a/11.md +++ b/11.md @@ -4,7 +4,7 @@ NIP-11 Relay Information Document --------------------------- -`draft` `optional` `author:scsibug` `author:doc-hex` `author:cameri` +`draft` `optional` Relays may provide server metadata to clients to inform them of capabilities, administrative contacts, and various server attributes. This is made available as a JSON document over HTTP, on the same URI as the relay's websocket. diff --git a/12.md b/12.md index 93579779..bf0eda9e 100644 --- a/12.md +++ b/12.md @@ -4,6 +4,6 @@ NIP-12 Generic Tag Queries ------------------- -`final` `mandatory` `author:scsibug` `author:fiatjaf` +`final` `mandatory` Moved to [NIP-01](01.md). diff --git a/13.md b/13.md index 01787336..4b15bbe5 100644 --- a/13.md +++ b/13.md @@ -4,7 +4,7 @@ NIP-13 Proof of Work ------------- -`draft` `optional` `author:jb55` `author:cameri` +`draft` `optional` This NIP defines a way to generate and interpret Proof of Work for nostr notes. Proof of Work (PoW) is a way to add a proof of computational work to a note. This is a bearer proof that all relays and clients can universally validate with a small amount of code. This proof can be used as a means of spam deterrence. diff --git a/14.md b/14.md index 7384394e..72e5e396 100644 --- a/14.md +++ b/14.md @@ -4,7 +4,7 @@ NIP-14 Subject tag in Text events -------------------------- -`draft` `optional` `author:unclebobmartin` +`draft` `optional` This NIP defines the use of the "subject" tag in text (kind: 1) events. (implemented in more-speech) diff --git a/15.md b/15.md index 68d28ff1..0ee000fa 100644 --- a/15.md +++ b/15.md @@ -4,7 +4,7 @@ NIP-15 Nostr Marketplace (for resilient marketplaces) ----------------------------------- -`draft` `optional` `author:fiatjaf` `author:benarc` `author:motorina0` `author:talvasconcelos` +`draft` `optional` > Based on https://github.com/lnbits/Diagon-Alley diff --git a/16.md b/16.md index 78ec7086..00320832 100644 --- a/16.md +++ b/16.md @@ -4,6 +4,6 @@ NIP-16 Event Treatment --------------- -`final` `mandatory` `author:Semisol` +`final` `mandatory` Moved to [NIP-01](01.md). diff --git a/18.md b/18.md index 75c4100c..ba96c895 100644 --- a/18.md +++ b/18.md @@ -4,7 +4,7 @@ NIP-18 Reposts ------- -`draft` `optional` `author:jb55` `author:fiatjaf` `author:arthurfranca` +`draft` `optional` A repost is a `kind 6` event that is used to signal to followers that a `kind 1` text note is worth reading. diff --git a/19.md b/19.md index cd989e21..ef808870 100644 --- a/19.md +++ b/19.md @@ -4,7 +4,7 @@ NIP-19 bech32-encoded entities ----------------------- -`draft` `optional` `author:jb55` `author:fiatjaf` `author:Semisol` +`draft` `optional` This NIP standardizes bech32-formatted strings that can be used to display keys, ids and other information in clients. These formats are not meant to be used anywhere in the core protocol, they are only meant for displaying to users, copy-pasting, sharing, rendering QR codes and inputting data. diff --git a/20.md b/20.md index ec6127a0..6feed6a9 100644 --- a/20.md +++ b/20.md @@ -4,6 +4,6 @@ NIP-20 Command Results --------------- -`final` `mandatory` `author:jb55` +`final` `mandatory` Moved to [NIP-01](01.md). diff --git a/21.md b/21.md index 6246eb49..6ed141a8 100644 --- a/21.md +++ b/21.md @@ -4,7 +4,7 @@ NIP-21 `nostr:` URI scheme ------------------- -`draft` `optional` `author:fiatjaf` +`draft` `optional` This NIP standardizes the usage of a common URI scheme for maximum interoperability and openness in the network. diff --git a/22.md b/22.md index f595ebf3..06af4937 100644 --- a/22.md +++ b/22.md @@ -4,7 +4,7 @@ NIP-22 Event `created_at` Limits ------------------------- -`draft` `optional` `author:jeffthibault` `author:Giszmo` +`draft` `optional` Relays may define both upper and lower limits within which they will consider an event's `created_at` to be acceptable. Both the upper and lower limits MUST be unix timestamps in seconds as defined in [NIP-01](01.md). diff --git a/23.md b/23.md index 76c0a69b..382df837 100644 --- a/23.md +++ b/23.md @@ -4,7 +4,7 @@ NIP-23 Long-form Content ----------------- -`draft` `optional` `author:fiatjaf` +`draft` `optional` This NIP defines `kind:30023` (a _parameterized replaceable event_) for long-form text content, generally referred to as "articles" or "blog posts". `kind:30024` has the same structure as `kind:30023` and is used to save long form drafts. diff --git a/24.md b/24.md index b88d990a..f830b68d 100644 --- a/24.md +++ b/24.md @@ -4,7 +4,7 @@ NIP-24 Extra metadata fields and tags ------------------------------ -`draft` `optional` `author:fiatjaf` +`draft` `optional` This NIP defines extra optional fields added to events. diff --git a/25.md b/25.md index 7b29140a..3b4aa590 100644 --- a/25.md +++ b/25.md @@ -5,7 +5,7 @@ NIP-25 Reactions --------- -`draft` `optional` `author:jb55` +`draft` `optional` A reaction is a `kind 7` event that is used to react to other events. diff --git a/26.md b/26.md index 59cf807f..86c46e1f 100644 --- a/26.md +++ b/26.md @@ -4,7 +4,7 @@ NIP-26 Delegated Event Signing ----- -`draft` `optional` `author:markharding` `author:minds` +`draft` `optional` This NIP defines how events can be delegated so that they can be signed by other keypairs. diff --git a/27.md b/27.md index 6d761206..efd2c122 100644 --- a/27.md +++ b/27.md @@ -4,7 +4,7 @@ NIP-27 Text Note References -------------------- -`draft` `optional` `author:arthurfranca` `author:hodlbod` `author:fiatjaf` +`draft` `optional` This document standardizes the treatment given by clients of inline references of other events and profiles inside the `.content` of any event that has readable text in its `.content` (such as kinds 1 and 30023). diff --git a/28.md b/28.md index 62ab398f..59e9389b 100644 --- a/28.md +++ b/28.md @@ -5,7 +5,7 @@ NIP-28 Public Chat ----------- -`draft` `optional` `author:ChristopherDavid` `author:fiatjaf` `author:jb55` `author:Cameri` +`draft` `optional` This NIP defines new event kinds for public chat channels, channel messages, and basic client-side moderation. diff --git a/30.md b/30.md index ffc5aeb3..5a6f84de 100644 --- a/30.md +++ b/30.md @@ -4,7 +4,7 @@ NIP-30 Custom Emoji ------------ -`draft` `optional` `author:alexgleason` +`draft` `optional` Custom emoji may be added to **kind 0** and **kind 1** events by including one or more `"emoji"` tags, in the form: diff --git a/31.md b/31.md index e77ae341..ee920528 100644 --- a/31.md +++ b/31.md @@ -4,7 +4,7 @@ NIP-31 Dealing with unknown event kinds -------------------------------- -`draft` `optional` `author:pablof7z` `author:fiatjaf` +`draft` `optional` When creating a new custom event kind that is part of a custom protocol and isn't meant to be read as text (like `kind:1`), clients should use an `alt` tag to write a short human-readable plaintext summary of what that event is about. diff --git a/32.md b/32.md index f8dc0029..dfcb35ea 100644 --- a/32.md +++ b/32.md @@ -4,7 +4,7 @@ NIP-32 Labeling --------- -`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay` +`draft` `optional` A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, including distributed moderation, collection management, license assignment, and content classification. diff --git a/33.md b/33.md index 1e7a9fc9..337a1f9b 100644 --- a/33.md +++ b/33.md @@ -4,6 +4,6 @@ NIP-33 Parameterized Replaceable Events -------------------------------- -`final` `mandatory` `author:Semisol` `author:Kukks` `author:Cameri` `author:Giszmo` +`final` `mandatory` Moved to [NIP-01](01.md). diff --git a/36.md b/36.md index 6d1cf639..db4c4f2f 100644 --- a/36.md +++ b/36.md @@ -4,7 +4,7 @@ NIP-36 Sensitive Content / Content Warning ----------------------------------- -`draft` `optional` `author:fernandolguevara` +`draft` `optional` The `content-warning` tag enables users to specify if the event's content needs to be approved by readers to be shown. Clients can hide the content until the user acts on it. diff --git a/38.md b/38.md index f1eddcd8..911d5b18 100644 --- a/38.md +++ b/38.md @@ -5,7 +5,7 @@ NIP-38 User Statuses -------------- -`draft` `optional` `author:jb55` +`draft` `optional` ## Abstract diff --git a/39.md b/39.md index b84603c9..c9970fa5 100644 --- a/39.md +++ b/39.md @@ -4,7 +4,7 @@ NIP-39 External Identities in Profiles ------------------------------- -`draft` `optional` `author:pseudozach` `author:Semisol` +`draft` `optional` ## Abstract diff --git a/40.md b/40.md index 32680db8..b8a03365 100644 --- a/40.md +++ b/40.md @@ -4,7 +4,7 @@ NIP-40 Expiration Timestamp ----------------------------------- -`draft` `optional` `author:0xtlt` +`draft` `optional` The `expiration` tag enables users to specify a unix timestamp at which the message SHOULD be considered expired (by relays and clients) and SHOULD be deleted by relays. diff --git a/42.md b/42.md index 9b0c45b4..9f0c24dd 100644 --- a/42.md +++ b/42.md @@ -4,7 +4,7 @@ NIP-42 Authentication of clients to relays ----------------------------------- -`draft` `optional` `author:Semisol` `author:fiatjaf` +`draft` `optional` This NIP defines a way for clients to authenticate to relays by signing an ephemeral event. diff --git a/45.md b/45.md index 7b11950a..a3abd19d 100644 --- a/45.md +++ b/45.md @@ -4,7 +4,7 @@ NIP-45 Event Counts -------------- -`draft` `optional` `author:staab` +`draft` `optional` Relays may support the verb `COUNT`, which provides a mechanism for obtaining event counts. diff --git a/46.md b/46.md index 90fa1a06..53185416 100644 --- a/46.md +++ b/46.md @@ -4,7 +4,7 @@ NIP-46 Nostr Connect ------------------------ -`draft` `optional` `author:tiero` `author:giowe` `author:vforvalerio87` +`draft` `optional` ## Rationale diff --git a/47.md b/47.md index b6a4f2bc..d4b7c1f7 100644 --- a/47.md +++ b/47.md @@ -4,7 +4,7 @@ NIP-47 Nostr Wallet Connect -------------------- -`draft` `optional` `author:kiwiidb` `author:bumi` `author:semisol` `author:vitorpamplona` +`draft` `optional` ## Rationale diff --git a/48.md b/48.md index 8f227811..2f03e002 100644 --- a/48.md +++ b/48.md @@ -4,7 +4,7 @@ NIP-48 Proxy Tags ---------- -`draft` `optional` `author:alexgleason` +`draft` `optional` Nostr events bridged from other protocols such as ActivityPub can link back to the source object by including a `"proxy"` tag, in the form: diff --git a/50.md b/50.md index 5bda3559..2bdf1ff1 100644 --- a/50.md +++ b/50.md @@ -4,7 +4,7 @@ NIP-50 Search Capability ----------------- -`draft` `optional` `author:brugeman` `author:mikedilger` `author:fiatjaf` +`draft` `optional` ## Abstract diff --git a/51.md b/51.md index e4d7c24e..a8a8e956 100644 --- a/51.md +++ b/51.md @@ -4,7 +4,7 @@ NIP-51 Lists ----- -`draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus` +`draft` `optional` A "list" event is defined as having a list of public and/or private tags. Public tags will be listed in the event `tags`. Private tags will be encrypted in the event `content`. Encryption for private tags will use [NIP-04 - Encrypted Direct Message](04.md) encryption, using the list author's private and public key for the shared secret. A distinct event kind should be used for each list type created. diff --git a/52.md b/52.md index 69507441..15cc8fc5 100644 --- a/52.md +++ b/52.md @@ -4,7 +4,7 @@ NIP-52 Calendar Events --------------- -`draft` `optional` `author:tyiu` +`draft` `optional` This specification defines calendar events representing an occurrence at a specific moment or between moments. These calendar events are _parameterized replaceable_ and deletable per [NIP-09](09.md). diff --git a/53.md b/53.md index b3d416b7..c4789ea1 100644 --- a/53.md +++ b/53.md @@ -4,7 +4,7 @@ NIP-53 Live Activities --------------- -`draft` `optional` `author:vitorpamplona` `author:v0l` +`draft` `optional` ## Abstract diff --git a/56.md b/56.md index 259118d7..0c951b5b 100644 --- a/56.md +++ b/56.md @@ -5,7 +5,7 @@ NIP-56 Reporting --------- -`draft` `optional` `author:jb55` +`draft` `optional` A report is a `kind 1984` note that is used to report other notes for spam, illegal and explicit content. diff --git a/57.md b/57.md index 849c8696..2b2c97b9 100644 --- a/57.md +++ b/57.md @@ -4,7 +4,7 @@ NIP-57 Lightning Zaps -------------- -`draft` `optional` `author:jb55` `author:kieran` +`draft` `optional` This NIP defines two new event types for recording lightning payments between users. `9734` is a `zap request`, representing a payer's request to a recipient's lightning wallet for an invoice. `9735` is a `zap receipt`, representing the confirmation by the recipient's lightning wallet that the invoice issued in response to a `zap request` has been paid. diff --git a/58.md b/58.md index ccabc7b6..9725c82a 100644 --- a/58.md +++ b/58.md @@ -4,7 +4,7 @@ NIP-58 Badges ------ -`draft` `optional` `author:cameri` +`draft` `optional` Three special events are used to define, award and display badges in user profiles: diff --git a/65.md b/65.md index cdfe9bf5..4a6f5a11 100644 --- a/65.md +++ b/65.md @@ -4,7 +4,7 @@ NIP-65 Relay List Metadata ------------------- -`draft` `optional` `author:mikedilger` `author:vitorpamplona` +`draft` `optional` Defines a replaceable event using `kind:10002` to advertise preferred relays for discovering a user's content and receiving fresh content from others. diff --git a/72.md b/72.md index 599a4c45..833336ce 100644 --- a/72.md +++ b/72.md @@ -4,7 +4,7 @@ NIP-72 Moderated Communities (Reddit Style) ------------------------------------ -`draft` `optional` `author:vitorpamplona` `author:arthurfranca` +`draft` `optional` The goal of this NIP is to create moderator-approved public communities around a topic. It defines the replaceable event `kind:34550` to define the community and the current list of moderators/administrators. Users that want to post into the community, simply tag any Nostr event with the community's `a` tag. Moderators issue an approval event `kind:4550` that links the community with the new post. diff --git a/75.md b/75.md index 6c8cb7b1..3a89f904 100644 --- a/75.md +++ b/75.md @@ -2,7 +2,7 @@ ## Zap Goals -`draft` `optional` `author:verbiricha` +`draft` `optional` This NIP defines an event for creating fundraising goals. Users can contribute funds towards the goal by zapping the goal event. diff --git a/78.md b/78.md index 10ff5358..0f2fadac 100644 --- a/78.md +++ b/78.md @@ -4,7 +4,7 @@ NIP-78 Arbitrary custom app data ------------------------- -`draft` `optional` `author:sandwich` `author:fiatjaf` +`draft` `optional` The goal of this NIP is to enable [remoteStorage](https://remotestorage.io/)-like capabilities for custom applications that do not care about interoperability. diff --git a/84.md b/84.md index 4caab62a..308cbddd 100644 --- a/84.md +++ b/84.md @@ -4,7 +4,7 @@ NIP-84 Highlights ---------- -`draft` `optional` `author:pablof7z` +`draft` `optional` This NIP defines `kind:9802`, a "highlight" event, to signal content a user finds valuable. diff --git a/89.md b/89.md index 4503ecfd..2e5b7992 100644 --- a/89.md +++ b/89.md @@ -4,7 +4,7 @@ NIP-89 Recommended Application Handlers -------------------------------- -`draft` `optional` `author:pablof7z` +`draft` `optional` This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds. diff --git a/90.md b/90.md index 31447f28..fe0d89cd 100644 --- a/90.md +++ b/90.md @@ -4,7 +4,7 @@ NIP-90 Data Vending Machine -------------------- -`draft` `optional` `author:pablof7z` `author:dontbelievethehype` +`draft` `optional` This NIP defines the interaction between customers and Service Providers for performing on-demand computation. diff --git a/94.md b/94.md index c5e0f182..0b76c25b 100644 --- a/94.md +++ b/94.md @@ -4,7 +4,7 @@ NIP-94 File Metadata ------------- -`draft` `optional` `author:frbitten` `author:kieran` `author:lovvtide` `author:fiatjaf` `author:staab` +`draft` `optional` The purpose of this NIP is to allow an organization and classification of shared files. So that relays can filter and organize in any way that is of interest. With that, multiple types of filesharing clients can be created. NIP-94 support is not expected to be implemented by "social" clients that deal with kind:1 notes or by longform clients that deal with kind:30023 articles. diff --git a/98.md b/98.md index c8cba0f5..e04c7fc1 100644 --- a/98.md +++ b/98.md @@ -4,7 +4,7 @@ NIP-98 HTTP Auth ------------------------- -`draft` `optional` `author:kieran` `author:melvincarvalho` +`draft` `optional` This NIP defines an ephemeral event used to authorize requests to HTTP servers using nostr events. diff --git a/99.md b/99.md index 274e5afb..9e8f1dad 100644 --- a/99.md +++ b/99.md @@ -2,7 +2,7 @@ ## Classified Listings -`draft` `optional` `author:erskingardner` +`draft` `optional` This NIP defines `kind:30402`: a parameterized replaceable event to describe classified listings that list any arbitrary product, service, or other thing for sale or offer and includes enough structured metadata to make them useful. From 7f27800e27c437ce17d223799f37631105d1ae5f Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Thu, 16 Nov 2023 05:43:28 -0800 Subject: [PATCH 34/48] Add client tag to nip 89 --- 89.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/89.md b/89.md index 4503ecfd..04f19179 100644 --- a/89.md +++ b/89.md @@ -74,6 +74,19 @@ Multiple tags might be registered by the app, following NIP-19 nomenclature as t A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag. +# Client tag +When publishing events, clients MAY include a `client` tag in the same format as the recommendation event's `a` tags. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag. + +```json +{ + "kind": 1, + "tags": [ + ["client", "31990:app1-pubkey:", "wss://relay1", "ios"] + ] + ... +} +``` + # User flow A user A who uses a non-`kind:1`-centric nostr app could choose to announce/recommend a certain kind-handler application. @@ -113,4 +126,4 @@ User B's client sees the application's `kind:31990` which includes the informati ## Alternative query bypassing `kind:31989` Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms to avoid directing users to malicious handlers. -`["REQ", , '[{ "kinds": [31990], "#k": [], 'authors': [...] }]']` \ No newline at end of file +`["REQ", , '[{ "kinds": [31990], "#k": [], 'authors': [...] }]']` From 2a0b701ff77d4ffd686661d829b7b7091e29589b Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 16 Nov 2023 12:26:50 -0300 Subject: [PATCH 35/48] add bookmark sets (following @staab). --- 51.md | 33 +++++++++++++++++---------------- README.md | 1 + 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/51.md b/51.md index 86713701..ab15be48 100644 --- a/51.md +++ b/51.md @@ -25,16 +25,16 @@ browsing experience. For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. -| name | kind | description | expected tag items | -| --- | --- | --- | --- | -| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) | -| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | -| Bookmarks | 10003 | things the user intends to save for the future | `"e"` (kind:1 notes), `"a"` (kind:30023 articles) | -| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | -| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 community definitions) | -| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | -| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | -| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) | +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Mute list | 10000 | things the user doesn't want to see in their feeds | `"p"` (pubkeys), `"t"` (hashtags), `"word"` (lowercase string), `"e"` (threads) | +| Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | +| Bookmarks | 10003 | uncategorized, "global" list of things a user wants to save | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` | +| Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | +| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 community definitions) | +| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | +| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | +| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) | ## Sets @@ -49,12 +49,13 @@ can be used by apps to showcase curations made by others tagged to different top Aside from their main identifier, the `"d"` tag, sets can optionally have a `"name"`, a `"picture"` and an `"about"` tag that can be used to enhance their UI. -| name | kind | description | expected tag items | -| --- | --- | --- | --- | -| Follow sets | 30000 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | -| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during variadic operations | `"relay"` (relay URLs) | -| Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | -| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | +| name | kind | description | expected tag items | +| --- | --- | --- | --- | +| Follow sets | 30000 | categorized groups of users a client may choose to check out in different circumstances | `"p"` (pubkeys) | +| Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during various operations | `"relay"` (relay URLs) | +| Bookmark sets | 30003 | user-defined bookmarks categories , for when bookmarks must be in labeled separate groups | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` | +| Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | +| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | ## Deprecated standard lists diff --git a/README.md b/README.md index 91d6f84a..36d5fc07 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30000` | Follow sets | [51](51.md) | | `30001` | Generic lists | [51](51.md) | | `30002` | Relay sets | [51](51.md) | +| `30003` | Bookmark sets | [51](51.md) | | `30004` | Curation sets | [51](51.md) | | `30008` | Profile Badges | [58](58.md) | | `30009` | Badge Definition | [58](58.md) | From 4a77fc5c402ec6c4cbdb574f9260e62fd2fc7bf4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 16 Nov 2023 15:50:39 -0300 Subject: [PATCH 36/48] add interests list and interests sets (following @erskingardner and @pablof7z). --- 51.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/51.md b/51.md index ab15be48..bcab8b8d 100644 --- a/51.md +++ b/51.md @@ -34,6 +34,7 @@ their feeds or receive annoying notifications from. | Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 community definitions) | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | +| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a" (kind:30015 interest set)` | | Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) | ## Sets @@ -55,6 +56,7 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"na | Relay sets | 30002 | user-defined relay groups the user can easily pick and choose from during various operations | `"relay"` (relay URLs) | | Bookmark sets | 30003 | user-defined bookmarks categories , for when bookmarks must be in labeled separate groups | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` | | Curation sets | 30004 | groups of articles picked by users as interesting and/or belonging to the same category | `"a"` (kind:30023 articles), `"e"` (kind:1 notes) | +| Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) | | Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | ## Deprecated standard lists diff --git a/README.md b/README.md index 36d5fc07..790f0b6a 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `10005` | Public chats list | [51](51.md) | | `10006` | Blocked relays list | [51](51.md) | | `10007` | Search relays list | [51](51.md) | +| `10015` | Interests list | [51](51.md) | | `10030` | User emoji list | [51](51.md) | | `13194` | Wallet Info | [47](47.md) | | `22242` | Client Authentication | [42](42.md) | @@ -127,6 +128,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos | `30004` | Curation sets | [51](51.md) | | `30008` | Profile Badges | [58](58.md) | | `30009` | Badge Definition | [58](58.md) | +| `30015` | Interest sets | [51](51.md) | | `30030` | Emoji sets | [51](51.md) | | `30017` | Create or update a stall | [15](15.md) | | `30018` | Create or update a product | [15](15.md) | From e7e64af04aaf57461392acf117438038c4613eb0 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 17 Nov 2023 12:22:43 +0900 Subject: [PATCH 37/48] fix typos --- 84.md | 2 +- 90.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/84.md b/84.md index 308cbddd..303cd933 100644 --- a/84.md +++ b/84.md @@ -34,4 +34,4 @@ last value of the tag. ### Context Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the -surrounding content might be beneficial to give context to the higlight. +surrounding content might be beneficial to give context to the highlight. diff --git a/90.md b/90.md index fe0d89cd..c498cddd 100644 --- a/90.md +++ b/90.md @@ -162,7 +162,7 @@ Service providers can give feedback about a job back to the customer. * `amount` tag: as defined in the [Job Result](#job-result) section. * `status` tag: Service Providers SHOULD indicate what this feedback status refers to. [Appendix 1](#appendix-1-job-feedback-status) defines status. Extra human-readable information can be added as an extra argument. -* NOTE: If the input params requires input to be encryped, then `content` field will have encrypted payload with `p` tag as key. +* NOTE: If the input params requires input to be encrypted, then `content` field will have encrypted payload with `p` tag as key. ### Job feedback status From 5f1d10fad24a1c860dc46e87e371b517500ed49b Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 17 Nov 2023 18:05:23 -0500 Subject: [PATCH 38/48] Adds contributor images to the readme. --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 483056dc..1274b926 100644 --- a/README.md +++ b/README.md @@ -230,3 +230,9 @@ mailing lists where you can work on NIPs before submitting them here: ## License All NIPs are public domain. + +## Contributors + + + + From 33e7650bab299b980e053e8c44e93fb895dc4df5 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 16 Nov 2023 10:52:35 -0300 Subject: [PATCH 39/48] give a better and updated explanation of how nips work in the readme. --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1274b926..8e970ead 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # NIPs NIPs stand for **Nostr Implementation Possibilities**. + They exist to document what may be implemented by [Nostr](https://github.com/nostr-protocol/nostr)-compatible _relay_ and _client_ software. --- @@ -12,7 +13,8 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [Relay to Client](#relay-to-client) - [Standardized Tags](#standardized-tags) - [Criteria for acceptance of NIPs](#criteria-for-acceptance-of-nips) -- [Mailing Lists](#mailing-lists) +- [Is this repository a centralizing factor?](#is-this-repository-a-centralizing-factor) +- [How this repository works](#how-this-repository-works) - [License](#license) --- @@ -212,20 +214,19 @@ Please update these lists when proposing NIPs introducing new event kinds. 4. There should be no more than one way of doing the same thing. 5. Other rules will be made up when necessary. -## Mailing Lists +## Is this repository a centralizing factor? -The nostr ecosystem is getting large with many different organizations, relays -and clients. Following the nips repo on github is becoming more difficult and -noisy. To coordinate on protocol development outside of github, there are -mailing lists where you can work on NIPs before submitting them here: +To promote interoperability, we standards that everybody can follow, and we need them to define a **single way of doing each thing** without ever hurting **backwards-compatibility**, and for that purpose there is no way around getting everybody to agree on the same thing and keep a centralized index of these standards. However the fact that such index exists doesn't hurt the decentralization of Nostr. _At any point the central index can be challenged if it is failing to fulfill the needs of the protocol_ and it can migrate to other places and be maintained by other people. -* [w3c nostr community group][w3-nostr] - [public-nostr@w3.org][mailto-w3] - requires signup -* [nostr-protocol google group][nostr-google-group] - [nostr-protocol@googlegroups.com][mailto-google] - no signup required +It can even fork into multiple and then some clients would go one way, others would go another way, and some clients would adhere to both competing standards. This would hurt the simplicity, openness and interoperability of Nostr a little, but everything would still work in the short term. -[w3-nostr]: https://www.w3.org/community/nostr/ -[mailto-w3]: mailto:public-nostr@w3.org -[nostr-google-group]: https://groups.google.com/g/nostr-protocol -[mailto-google]: mailto:nostr-protocol@googlegroups.com +There is a list of notable Nostr software developers who have commit access to this repository, but that exists mostly for practical reasons, as by the nature of the thing we're dealing with the repository owner can revoke membership and rewrite history as they want -- and if these actions are unjustified or perceived as bad or evil the community must react. + +## How this repository works + +Standards may emerge in two ways: the first way is that someone starts doing something, then others copy it; the second way is that someone has an idea of a new standard that could benefit multiple clients and the protocol in general without breaking **backwards-compatibility** and the principle of having **a single way of doing things**, then they write that idea and submit it to this repository, other interested parties read it and give their feedback, then once most people reasonably agree we codify that in a NIP which client and relay developers that are interested in the feature can proceed to implement. + +These two ways of standardizing things are supported by this repository. Although the second is preferred, an effort will be made to codify standards emerged outside this repository into NIPs that can be later referenced and easily understood and implemented by others -- but obviously as in any human system discretion may be applied when standards are considered harmful. ## License From b5b46b629fb1b4dae4780d8d165bddd68d4cda68 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 08:21:15 -0300 Subject: [PATCH 40/48] reformat NIP-11. --- 11.md | 154 +++++++++++++++++++++++++++++++--------------------------- 1 file changed, 82 insertions(+), 72 deletions(-) diff --git a/11.md b/11.md index 017e5d42..e05cb1fa 100644 --- a/11.md +++ b/11.md @@ -25,42 +25,42 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application Any field may be omitted, and clients MUST ignore any additional fields they do not understand. Relays MUST accept CORS requests by sending `Access-Control-Allow-Origin`, `Access-Control-Allow-Headers`, and `Access-Control-Allow-Methods` headers. Field Descriptions ------------------ +------------------ -### Name ### +### Name A relay may select a `name` for use in client software. This is a string, and SHOULD be less than 30 characters to avoid client truncation. -### Description ### +### Description Detailed plain-text information about the relay may be contained in the `description` string. It is recommended that this contain no markup, formatting or line breaks for word wrapping, and simply use double newline characters to separate paragraphs. There are no limitations on length. -### Pubkey ### +### Pubkey An administrative contact may be listed with a `pubkey`, in the same format as Nostr events (32-byte hex for a `secp256k1` public key). If a contact is listed, this provides clients with a recommended address to send encrypted direct messages (See `NIP-04`) to a system administrator. Expected uses of this address are to report abuse or illegal content, file bug reports, or request other technical assistance. Relay operators have no obligation to respond to direct messages. -### Contact ### +### Contact An alternative contact may be listed under the `contact` field as well, with the same purpose as `pubkey`. Use of a Nostr public key and direct message SHOULD be preferred over this. Contents of this field SHOULD be a URI, using schemes such as `mailto` or `https` to provide users with a means of contact. -### Supported NIPs ### +### Supported NIPs As the Nostr protocol evolves, some functionality may only be available by relays that implement a specific `NIP`. This field is an array of the integer identifiers of `NIP`s that are implemented in the relay. Examples would include `1`, for `"NIP-01"` and `9`, for `"NIP-09"`. Client-side `NIPs` SHOULD NOT be advertised, and can be ignored by clients. -### Software ### +### Software The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage. -### Version ### +### Version The relay MAY choose to publish its software version as a string attribute. The string format is defined by the relay implementation. It is recommended this be a version number or commit identifier. Extra Fields ------------------ +------------ -### Server Limitations ### +### Server Limitations These are limitations imposed by the relay on clients. Your client should expect that requests which exceed these *practical* limitations @@ -68,22 +68,21 @@ are rejected or fail immediately. ```json { -... + ... "limitation": { - "max_message_length": 16384, - "max_subscriptions": 20, - "max_filters": 100, - "max_limit": 5000, - "max_subid_length": 100, - "max_event_tags": 100, - "max_content_length": 8196, - "min_pow_difficulty": 30, - "auth_required": true, - "payment_required": true, - "created_at_lower_limit":31536000, - "created_at_upper_limit":3, + "max_message_length": 16384, + "max_subscriptions": 20, + "max_filters": 100, + "max_limit": 5000, + "max_subid_length": 100, + "max_event_tags": 100, + "max_content_length": 8196, + "min_pow_difficulty": 30, + "auth_required": true, + "payment_required": true, + "created_at_lower_limit": 31536000, + "created_at_upper_limit": 3 } -... } ``` @@ -129,7 +128,7 @@ Even if set to False, authentication may be required for specific actions. - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) -### Event Retention ### +### Event Retention There may be a cost associated with storing data forever, so relays may wish to state retention times. The values stated here are defaults @@ -142,14 +141,12 @@ all, and preferably an error will be provided when those are received. ```json { -... "retention": [ - { "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 }, - { "kinds": [[40000, 49999]], "time": 100 }, - { "kinds": [[30000, 39999]], "count": 1000 }, - { "time": 3600, "count": 10000 } + {"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600}, + {"kinds": [[40000, 49999]], "time": 100}, + {"kinds": [[30000, 39999]], "count": 1000}, + {"time": 3600, "count": 10000} ] -... } ``` @@ -165,8 +162,7 @@ support their protocol quickly via a single HTTP fetch. There is no need to specify retention times for _ephemeral events_ since they are not retained. - -### Content Limitations ### +### Content Limitations Some relays may be governed by the arbitrary laws of a nation state. This may limit what content can be stored in cleartext on those relays. All @@ -185,9 +181,8 @@ flexibility is up to the client software. ```json { -... - "relay_countries": [ "CA", "US" ], -... + ... + "relay_countries": [ "CA", "US" ] } ``` @@ -199,7 +194,7 @@ country of the legal entities who own the relay, so it's very likely a number of countries are involved. -### Community Preferences ### +### Community Preferences For public text notes at least, a relay may try to foster a local community. This would encourage users to follow the global @@ -208,11 +203,10 @@ To support this goal, relays MAY specify some of the following values. ```json { -... + ... "language_tags": [ "en", "en-419" ], "tags": [ "sfw-only", "bitcoin-only", "anime" ], - "posting_policy": "https://example.com/posting-policy.html", -... + "posting_policy": "https://example.com/posting-policy.html" } ``` @@ -239,59 +233,75 @@ detail and legal terms. Use the `tags` field to signify limitations on content, or topics to be discussed, which could be machine processed by appropriate client software. -### Pay-To-Relay ### +### Pay-to-Relay Relays that require payments may want to expose their fee schedules. ```json { -... + ... "payments_url": "https://my-relay/payments", "fees": { "admission": [{ "amount": 1000000, "unit": "msats" }], "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], - }, -... + } } ``` -### Icon ### +### Icon A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape. ```json { -... + ... "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", -... } ``` -### Examples ### -As of 2 May 2023 the following `curl` command provided these results. +### Examples - >curl -H "Accept: application/nostr+json" https://eden.nostr.land +As of 2 May 2023 the following command provided these results: - {"name":"eden.nostr.land", - "description":"Eden Nostr Land - Toronto 1-01", - "pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700", - "contact":"me@ricardocabral.io", - "supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40], - "supported_nip_extensions":["11a"], - "software":"git+https://github.com/Cameri/nostream.git", - "version":"1.22.6", - "limitation":{"max_message_length":1048576, - "max_subscriptions":10, - "max_filters":2500, - "max_limit":5000, - "max_subid_length":256, - "max_event_tags":2500, - "max_content_length":65536, - "min_pow_difficulty":0, - "auth_required":false, - "payment_required":true}, - "payments_url":"https://eden.nostr.land/invoices", - "fees":{"admission":[{"amount":5000000,"unit":"msats"}], - "publication":[]}}, - "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" +``` +~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq + +{ + "description": "nostr.land family of relays (us-or-01)", + "name": "nostr.land", + "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd", + "software": "custom", + "supported_nips": [ + 1, + 2, + 4, + 9, + 11, + 12, + 16, + 20, + 22, + 28, + 33, + 40 + ], + "version": "1.0.1", + "limitation": { + "payment_required": true, + "max_message_length": 65535, + "max_event_tags": 2000, + "max_subscriptions": 20, + "auth_required": false + }, + "payments_url": "https://eden.nostr.land", + "fees": { + "subscription": [ + { + "amount": 2500000, + "unit": "msats", + "period": 2592000 + } + ] + }, +} From 7aa751be46d515d7612998a4da88285cb0957cd3 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 08:22:42 -0300 Subject: [PATCH 41/48] NIP-03: explain why a single attestation is recommended. --- 03.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/03.md b/03.md index 8b7deb62..74e010cb 100644 --- a/03.md +++ b/03.md @@ -20,7 +20,7 @@ This NIP defines an event with `kind:1040` that can contain an [OpenTimestamps]( ``` - The OpenTimestamps proof MUST prove the referenced `e` event id as its digest. -- The `content` MUST be the full content of an `.ots` file containing at least one Bitcoin attestation. This file SHOULD contain a **single** Bitcoin attestation and no reference to "pending" attestations since they are useless in this context. +- The `content` MUST be the full content of an `.ots` file containing at least one Bitcoin attestation. This file SHOULD contain a **single** Bitcoin attestation (as not more than one valid attestation is necessary and less bytes is better than more) and no reference to "pending" attestations since they are useless in this context. ### Example OpenTimestamps proof verification flow From b0df71824f9967130b54150b64cc70fa94bffec2 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 08:48:49 -0300 Subject: [PATCH 42/48] NIP-72: reformat and clarify some things. --- 72.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/72.md b/72.md index 833336ce..74c7f086 100644 --- a/72.md +++ b/72.md @@ -10,16 +10,15 @@ The goal of this NIP is to create moderator-approved public communities around a # Community Definition -`Kind:34550` SHOULD include any field that helps define the community and the set of moderators. `relay` tags MAY be used to describe the preferred relay to download requests and approvals. +`kind:34550` SHOULD include any field that helps define the community and the set of moderators. `relay` tags MAY be used to describe the preferred relay to download requests and approvals. ```json { - "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", - "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", + ... "created_at": , "kind": 34550, "tags": [ - ["d", ""], + ["d", ""], ["description", ""], ["image", "", "x"], @@ -41,18 +40,16 @@ The goal of this NIP is to create moderator-approved public communities around a # New Post Request -Any Nostr event can be a post request. Clients MUST add the community's `a` tag to the new post event in order to be presented for the moderator's approval. +Any Nostr event can be submitted to a community by anyone for approval. Clients MUST add the community's `a` tag to the new post event in order to be presented for the moderator's approval. ```json { - "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", - "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", - "created_at": , + ... "kind": 1, "tags": [ - ["a", "34550::", ""], + ["a", "34550::", ""], ], - "content": "" + "content": "hello world" } ``` @@ -64,17 +61,16 @@ The post-approval event MUST include `a` tags of the communities the moderator i ```json { - "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", + ... "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", - "created_at": , "kind": 4550, "tags": [ - ["a", "34550::", ""], - ["e", "", ""], - ["p", "", ""], - ["k", ""], + ["a", "34550::", ""], + ["e", "", ""], + ["p", "", ""], + ["k", ""] ], - "content": "" + "content": "" } ``` @@ -91,11 +87,15 @@ Community clients SHOULD display posts that have been approved by at least 1 mod The following filter displays the approved posts. ```js -{ - "authors": ["", "", "", "", ...], - "kinds": [4550], - "#a": ["34550::"], -} +[ + "REQ", + "_", + { + "authors": ["", "", "", "", ...], + "kinds": [4550], + "#a": ["34550::"], + } +] ``` Clients MAY hide approvals by blocked moderators at the user's request. From 5dcfe85306434f21ecb1e7a47edd92b2e3e64f9a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 09:13:12 -0300 Subject: [PATCH 43/48] reformat a bunch of json things and small nitpicks. --- 11.md | 18 +++--- 13.md | 6 +- 14.md | 8 ++- 15.md | 205 ++++++++++++++++++++++++++++++---------------------------- 28.md | 46 ++++++------- 32.md | 9 ++- 36.md | 26 ++++---- 39.md | 28 ++++---- 40.md | 24 +++---- 42.md | 14 ++-- 45.md | 21 ++++-- 53.md | 30 ++++----- 56.md | 1 - 72.md | 14 ++-- 75.md | 17 +++-- 84.md | 11 +++- 89.md | 84 ++++++++++++------------ 90.md | 147 +++++++++++++++++++++-------------------- 94.md | 7 +- 98.md | 28 ++++---- 99.md | 6 +- 21 files changed, 385 insertions(+), 365 deletions(-) diff --git a/11.md b/11.md index e05cb1fa..ab05f31d 100644 --- a/11.md +++ b/11.md @@ -68,7 +68,6 @@ are rejected or fail immediately. ```json { - ... "limitation": { "max_message_length": 16384, "max_subscriptions": 20, @@ -82,7 +81,8 @@ are rejected or fail immediately. "payment_required": true, "created_at_lower_limit": 31536000, "created_at_upper_limit": 3 - } + }, + ... } ``` @@ -181,8 +181,8 @@ flexibility is up to the client software. ```json { + "relay_countries": [ "CA", "US" ], ... - "relay_countries": [ "CA", "US" ] } ``` @@ -203,10 +203,10 @@ To support this goal, relays MAY specify some of the following values. ```json { + "language_tags": ["en", "en-419"], + "tags": ["sfw-only", "bitcoin-only", "anime"], + "posting_policy": "https://example.com/posting-policy.html", ... - "language_tags": [ "en", "en-419" ], - "tags": [ "sfw-only", "bitcoin-only", "anime" ], - "posting_policy": "https://example.com/posting-policy.html" } ``` @@ -239,13 +239,13 @@ Relays that require payments may want to expose their fee schedules. ```json { - ... "payments_url": "https://my-relay/payments", "fees": { "admission": [{ "amount": 1000000, "unit": "msats" }], "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], - } + }, + ... } ``` @@ -255,8 +255,8 @@ A URL pointing to an image to be used as an icon for the relay. Recommended to b ```json { - ... "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", + ... } ``` diff --git a/13.md b/13.md index 4b15bbe5..53c4d1b6 100644 --- a/13.md +++ b/13.md @@ -35,11 +35,7 @@ Example mined note "created_at": 1651794653, "kind": 1, "tags": [ - [ - "nonce", - "776797", - "21" - ] + ["nonce", "776797", "21"] ], "content": "It's just me mining my own business", "sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977" diff --git a/14.md b/14.md index 72e5e396..480c4c57 100644 --- a/14.md +++ b/14.md @@ -6,14 +6,16 @@ Subject tag in Text events `draft` `optional` -This NIP defines the use of the "subject" tag in text (kind: 1) events. +This NIP defines the use of the "subject" tag in text (kind: 1) events. (implemented in more-speech) -`["subject": ]` +```json +["subject": ] +``` Browsers often display threaded lists of messages. The contents of the subject tag can be used in such lists, instead of the more ad hoc approach of using the first few words of the message. This is very similar to the way email browsers display lists of incoming emails by subject rather than by contents. When replying to a message with a subject, clients SHOULD replicate the subject tag. Clients MAY adorn the subject to denote -that it is a reply. e.g. by prepending "Re:". +that it is a reply. e.g. by prepending "Re:". Subjects should generally be shorter than 80 chars. Long subjects will likely be trimmed by clients. diff --git a/15.md b/15.md index 0ee000fa..51b7792e 100644 --- a/15.md +++ b/15.md @@ -1,14 +1,14 @@ NIP-15 ====== -Nostr Marketplace (for resilient marketplaces) ------------------------------------ +Nostr Marketplace +----------------- -`draft` `optional` +`draft` `optional` -> Based on https://github.com/lnbits/Diagon-Alley +Based on https://github.com/lnbits/Diagon-Alley. -> Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market) +Implemented in [NostrMarket](https://github.com/lnbits/nostrmarket) and [Plebeian Market](https://github.com/PlebeianTech/plebeian-market). ## Terms @@ -35,29 +35,30 @@ The `merchant` admin software can be purely clientside, but for `convenience` an A merchant can publish these events: | Kind | | Description | | --------- | ------------------ | --------------------------------------------------------------------------------------------------------------- | -| `0 ` | `set_meta` | The merchant description (similar with any `nostr` public key). | +| `0` | `set_meta` | The merchant description (similar with any `nostr` public key). | | `30017` | `set_stall` | Create or update a stall. | | `30018` | `set_product` | Create or update a product. | -| `4 ` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | -| `5 ` | `delete` | Delete a product or a stall. | +| `4` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | +| `5` | `delete` | Delete a product or a stall. | ### Event `30017`: Create or update a stall. -**Event Content**: +**Event Content** + ```json { - "id": , - "name": , - "description": , - "currency": , - "shipping": [ - { - "id": , - "name": , - "cost": , - "regions": [], - } - ] + "id": , + "name": , + "description": , + "currency": , + "shipping": [ + { + "id": , + "name": , + "cost": , + "regions": [], + } + ] } ``` @@ -70,34 +71,39 @@ Fields that are not self-explanatory: - each shipping zone contains the base cost for orders made to that shipping zone, but a specific shipping cost per product can also be specified if the shipping cost for that product is higher than what's specified by the base cost. -**Event Tags**: +**Event Tags** + ```json - "tags": [["d", , - "stall_id": , - "name": , - "description": , - "images": <[String], array of image URLs, optional>, - "currency": , - "price": , - "quantity": , - "specs": [ - [, ] - ], - "shipping": [ - { - "id": , - "cost": , - } - ] + "id": , + "stall_id": , + "name": , + "description": , + "images": <[string], array of image URLs, optional>, + "currency": , + "price": , + "quantity": , + "specs": [ + [, ] + ], + "shipping": [ + { + "id": , + "cost": , + } + ] } ``` @@ -114,16 +120,18 @@ Fields that are not self-explanatory: - the `id` should match the id of the shipping zone, as defined in the `shipping` field of the stall - to calculate the total cost of shipping for an order, the user will choose a shipping option during checkout, and then the client must consider this costs: - the `base cost from the stall` for the chosen shipping option - - the result of multiplying the product units by the `shipping costs specified in the product`, if any. + - the result of multiplying the product units by the `shipping costs specified in the product`, if any. + +**Event Tags** -**Event Tags**: ```json "tags": [ - ["d", , - "type": 0, - "name": , - "address": - "message": ", - "contact": { - "nostr": <32-bytes hex of a pubkey>, - "phone": , - "email": , - }, - "items": [ - { - "product_id": , - "quantity": - } - ], - "shipping_id": + "id": , + "type": 0, + "name": , + "address": + "message": ", + "contact": { + "nostr": <32-bytes hex of a pubkey>, + "phone": , + "email": , + }, + "items": [ + { + "product_id": , + "quantity": + } + ], + "shipping_id": } ``` @@ -186,23 +194,23 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni ```json { - "id": , - "type": 1, - "message": , - "payment_options": [ - { - "type": , - "link": - }, - { - "type": , - "link": - }, - { - "type": , - "link": - } - ] + "id": , + "type": 1, + "message": , + "payment_options": [ + { + "type": , + "link": + }, + { + "type": , + "link": + }, + { + "type": , + "link": + } + ] } ``` @@ -214,11 +222,11 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni ```json { - "id": , - "type": 2, - "message": , - "paid": , - "shipped": , + "id": , + "type": 2, + "message": , + "paid": , + "shipped": , } ``` ## Customize Marketplace @@ -226,19 +234,20 @@ Create a customized user experience using the `naddr` from [NIP-19](https://gith ### Event `30019`: Create or update marketplace UI/UX -**Event Content**: +**Event Content** + ```json { - "name": , - "about": , - "ui": { - "picture": , - "banner": , - "theme": , - "darkMode": - }, - "merchants": <[String] (optional), array of pubkeys>, - ... + "name": , + "about": , + "ui": { + "picture": , + "banner": , + "theme": , + "darkMode": + }, + "merchants": [array of pubkeys (optional)], + ... } ``` diff --git a/28.md b/28.md index 59e9389b..2dcf8003 100644 --- a/28.md +++ b/28.md @@ -27,8 +27,8 @@ In the channel creation `content` field, Client SHOULD include basic channel met ```json { - "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}", - ... + "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}", + ... } ``` @@ -37,7 +37,7 @@ In the channel creation `content` field, Client SHOULD include basic channel met Update a channel's public metadata. -Clients and relays SHOULD handle kind 41 events similar to kind 33 replaceable events, where the information is used to update the metadata, without modifying the event id for the channel. Only the most recent kind 41 is needed to be stored. +Clients and relays SHOULD handle kind 41 events similar to kind 33 replaceable events, where the information is used to update the metadata, without modifying the event id for the channel.Only the most recent kind 41 is needed to be stored. Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey. @@ -53,9 +53,9 @@ Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay. ```json { - "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", - "tags": [["e", , ]], - ... + "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", + "tags": [["e", , ]], + ... } ``` @@ -72,9 +72,9 @@ Root message: ```json { - "content": , - "tags": [["e", , , "root"]], - ... + "content": , + "tags": [["e", , , "root"]], + ... } ``` @@ -82,14 +82,14 @@ Reply to another message: ```json { - "content": , - "tags": [ - ["e", , , "root"], - ["e", , , "reply"], - ["p", , ], - ... - ], - ... + "content": , + "tags": [ + ["e", , , "root"], + ["e", , , "reply"], + ["p", , ], + ... + ], + ... } ``` @@ -108,9 +108,9 @@ Clients MAY hide event 42s for other users other than the user who sent the even ```json { - "content": "{\"reason\": \"Dick pic\"}", - "tags": [["e", ]], - ... + "content": "{\"reason\": \"Dick pic\"}", + "tags": [["e", ]], + ... } ``` @@ -126,9 +126,9 @@ Clients MAY hide event 42s for users other than the user who sent the event 44. ```json { - "content": "{\"reason\": \"Posting dick pics\"}", - "tags": [["p", ]], - ... + "content": "{\"reason\": \"Posting dick pics\"}", + "tags": [["p", ]], + ... } ``` diff --git a/32.md b/32.md index dfcb35ea..be4e8724 100644 --- a/32.md +++ b/32.md @@ -64,7 +64,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic. ["l", "permies", "#t"], ["p", , ], ["p", , ] - ] + ], + ... } ``` @@ -78,7 +79,8 @@ A report flagging violence toward a human being as defined by ontology.example.c ["l", "VI-hum", "com.example.ontology"], ["p", , ], ["p", , ] - ] + ], + ... } ``` @@ -92,6 +94,7 @@ A moderation suggestion for a chat event. ["l", "approve", "nip28.moderation"], ["e", , ] ], + ... } ``` @@ -105,6 +108,7 @@ Assignment of a license to an event. ["l", "MIT", "license"], ["e", , ] ], + ... } ``` @@ -119,6 +123,7 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2. ["l", "IT-MI", "ISO-3166-2"] ], "content": "It's beautiful here in Milan!", + ... } ``` diff --git a/36.md b/36.md index db4c4f2f..b10262c2 100644 --- a/36.md +++ b/36.md @@ -24,18 +24,18 @@ options: ```json { - "pubkey": "", - "created_at": 1000000000, - "kind": 1, - "tags": [ - ["t", "hastag"], - ["L", "content-warning"], - ["l", "reason", "content-warning"], - ["L", "social.nos.ontology"], - ["l", "NS-nud", "social.nos.ontology"], - ["content-warning", "reason"] /* reason is optional */ - ], - "content": "sensitive content with #hastag\n", - "id": "" + "pubkey": "", + "created_at": 1000000000, + "kind": 1, + "tags": [ + ["t", "hastag"], + ["L", "content-warning"], + ["l", "reason", "content-warning"], + ["L", "social.nos.ontology"], + ["l", "NS-nud", "social.nos.ontology"], + ["content-warning", ""] + ], + "content": "sensitive content with #hastag\n", + "id": "" } ``` diff --git a/39.md b/39.md index c9970fa5..c819e43b 100644 --- a/39.md +++ b/39.md @@ -15,15 +15,13 @@ Nostr protocol users may have other online identities such as usernames, profile A new optional `i` tag is introduced for `kind 0` metadata event contents in addition to name, about, picture fields as included in [NIP-01](https://github.com/nostr-protocol/nips/blob/master/01.md): ```json { - "id": , - "pubkey": , - ... - "tags": [ - ["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"], - ["i", "twitter:semisol_public", "1619358434134196225"], - ["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"] - ["i", "telegram:1087295469", "nostrdirectory/770"] - ] + "tags": [ + ["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"], + ["i", "twitter:semisol_public", "1619358434134196225"], + ["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"] + ["i", "telegram:1087295469", "nostrdirectory/770"] + ], + ... } ``` @@ -31,9 +29,9 @@ An `i` tag will have two parameters, which are defined as the following: 1. `platform:identity`: This is the platform name (for example `github`) and the identity on that platform (for example `semisol`) joined together with `:`. 2. `proof`: String or object that points to the proof of owning this identity. -Clients SHOULD process any `i` tags with more than 2 values for future extensibility. -Identity provider names SHOULD only include `a-z`, `0-9` and the characters `._-/` and MUST NOT include `:`. -Identity names SHOULD be normalized if possible by replacing uppercase letters with lowercase letters, and if there are multiple aliases for an entity the primary one should be used. +Clients SHOULD process any `i` tags with more than 2 values for future extensibility. +Identity provider names SHOULD only include `a-z`, `0-9` and the characters `._-/` and MUST NOT include `:`. +Identity names SHOULD be normalized if possible by replacing uppercase letters with lowercase letters, and if there are multiple aliases for an entity the primary one should be used. ## Claim types @@ -41,14 +39,14 @@ Identity names SHOULD be normalized if possible by replacing uppercase letters w Identity: A GitHub username. -Proof: A GitHub Gist ID. This Gist should be created by `` with a single file that has the text `Verifying that I control the following Nostr public key: `. +Proof: A GitHub Gist ID. This Gist should be created by `` with a single file that has the text `Verifying that I control the following Nostr public key: `. This can be located at `https://gist.github.com//`. ### `twitter` Identity: A Twitter username. -Proof: A Tweet ID. The tweet should be posted by `` and have the text `Verifying my account on nostr My Public Key: ""`. +Proof: A Tweet ID. The tweet should be posted by `` and have the text `Verifying my account on nostr My Public Key: ""`. This can be located at `https://twitter.com//status/`. ### `mastodon` @@ -62,5 +60,5 @@ This can be located at `https:///`. Identity: A Telegram user ID. -Proof: A string in the format `/` which points to a message published in the public channel or group with name `` and message ID ``. This message should be sent by user ID `` and have the text `Verifying that I control the following Nostr public key: ""`. +Proof: A string in the format `/` which points to a message published in the public channel or group with name `` and message ID ``. This message should be sent by user ID `` and have the text `Verifying that I control the following Nostr public key: ""`. This can be located at `https://t.me/`. diff --git a/40.md b/40.md index b8a03365..909747f5 100644 --- a/40.md +++ b/40.md @@ -2,7 +2,7 @@ NIP-40 ====== Expiration Timestamp ------------------------------------ +-------------------- `draft` `optional` @@ -20,14 +20,14 @@ values: ```json { - "pubkey": "", - "created_at": 1000000000, - "kind": 1, - "tags": [ - ["expiration", "1600000000"] - ], - "content": "This message will expire at the specified timestamp and be deleted by relays.\n", - "id": "" + "pubkey": "", + "created_at": 1000000000, + "kind": 1, + "tags": [ + ["expiration", "1600000000"] + ], + "content": "This message will expire at the specified timestamp and be deleted by relays.\n", + "id": "" } ``` @@ -43,9 +43,9 @@ Clients SHOULD ignore events that have expired. Relay Behavior -------------- -Relays MAY NOT delete expired messages immediately on expiration and MAY persist them indefinitely. -Relays SHOULD NOT send expired events to clients, even if they are stored. -Relays SHOULD drop any events that are published to them if they are expired. +Relays MAY NOT delete expired messages immediately on expiration and MAY persist them indefinitely. +Relays SHOULD NOT send expired events to clients, even if they are stored. +Relays SHOULD drop any events that are published to them if they are expired. An expiration timestamp does not affect storage of ephemeral events. Suggested Use Cases diff --git a/42.md b/42.md index 9f0c24dd..e380e89a 100644 --- a/42.md +++ b/42.md @@ -24,13 +24,13 @@ A relay may want to require clients to authenticate to access restricted resourc This NIP defines a new message, `AUTH`, which relays can send when they support authentication and clients can send to relays when they want to authenticate. When sent by relays, the message is of the following form: -``` +```json ["AUTH", ] ``` And, when sent by clients, of the following form: -``` +```json ["AUTH", ] ``` @@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client. ```json { - "id": "...", - "pubkey": "...", - "created_at": 1669695536, "kind": 22242, "tags": [ ["relay", "wss://relay.example.com/"], ["challenge", "challengestringhere"] ], - "content": "", - "sig": "..." + ... } ``` @@ -67,13 +63,13 @@ is expected to last for the duration of the WebSocket connection. Upon receiving a message from an unauthenticated user it can't fulfill without authentication, a relay may choose to notify the client. For that it can use a `NOTICE` or `OK` message with a standard prefix `"restricted: "` that is readable both by humans and machines, for example: -``` +```json ["NOTICE", "restricted: we can't serve DMs to unauthenticated users, does your client implement NIP-42?"] ``` or it can return an `OK` message noting the reason an event was not written using the same prefix: -``` +```json ["OK", , false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"] ``` diff --git a/45.md b/45.md index a3abd19d..998b9529 100644 --- a/45.md +++ b/45.md @@ -16,29 +16,36 @@ Some queries a client may want to execute against connected relays are prohibiti 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. -``` +```json ["COUNT", , ...] ``` Counts are returned using a `COUNT` response in the form `{"count": }`. Relays may use probabilistic counts to reduce compute requirements. In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": , "approximate": }`. -``` +```json ["COUNT", , {"count": }] ``` -Examples: +## Examples: -``` -# Followers count +### Followers count + +```json ["COUNT", , {"kinds": [3], "#p": []}] ["COUNT", , {"count": 238}] +``` -# Count posts and reactions +### Count posts and reactions + +```json ["COUNT", , {"kinds": [1, 7], "authors": []}] ["COUNT", , {"count": 5}] +``` -# Count posts approximately +### Count posts approximately + +``` ["COUNT", , {"kinds": [1]}] ["COUNT", , {"count": 93412452, "approximate": true}] ``` diff --git a/53.md b/53.md index c4789ea1..d3cc0afd 100644 --- a/53.md +++ b/53.md @@ -6,17 +6,17 @@ Live Activities `draft` `optional` -## Abstract - Service providers want to offer live activities to the Nostr network in such a way that participants can easily logged and queried by clients. This NIP describes a general framework to advertise the involvement of pubkeys in such live activities. -# Live Event +## Concepts + +### Live Event A special event with `kind:30311` "Live Event" is defined as a _parameterized replaceable event_ of public `p` tags. Each `p` tag SHOULD have a **displayable** marker name for the current role (e.g. `Host`, `Speaker`, `Participant`) of the user in the event and the relay information MAY be empty. This event will be constantly updated as participants join and leave the activity. For example: -```js +```json { "kind": 30311, "tags": [ @@ -38,7 +38,7 @@ For example: ["relays", "wss://one.com", "wss://two.com", ...] ], "content": "", - ...other fields + ... } ``` @@ -52,7 +52,7 @@ Live Activity management clients are expected to constantly update `kind:30311` The activity MUST be linked to using the [NIP-19](19.md) `naddr` code along with the `a` tag. -## Proof of Agreement to Participate +### Proof of Agreement to Participate Event owners can add proof as the 5th term in each `p` tag to clarify the participant's agreement in joining the event. The proof is a signed SHA256 of the complete `a` Tag of the event (`kind:pubkey:dTag`) by each `p`'s private key, encoded in hex. @@ -60,30 +60,28 @@ Clients MAY only display participants if the proof is available or MAY display p This feature is important to avoid malicious event owners adding large account holders to the event, without their knowledge, to lure their followers into the malicious owner's trap. -# Live Chat Message +### Live Chat Message Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used. -```js +```json { - "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", - "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", - "created_at": "", "kind": 1311, "tags": [ ["a", "30311::", "", "root"], ], - "content": "Zaps to live streams is beautiful." + "content": "Zaps to live streams is beautiful.", + ... } ``` -# Use Cases +## Use Cases Common use cases include meeting rooms/workshops, watch-together activities, or event spaces, such as [live.snort.social](https://live.snort.social) and [nostrnests.com](https://nostrnests.com). -# Example +## Example -Live Streaming +### Live Streaming ```json { @@ -107,7 +105,7 @@ Live Streaming } ``` -Live Streaming chat message +### Live Streaming chat message ```json { diff --git a/56.md b/56.md index 0c951b5b..a2861e35 100644 --- a/56.md +++ b/56.md @@ -1,4 +1,3 @@ - NIP-56 ====== diff --git a/72.md b/72.md index 74c7f086..c0fffffc 100644 --- a/72.md +++ b/72.md @@ -14,7 +14,6 @@ The goal of this NIP is to create moderator-approved public communities around a ```json { - ... "created_at": , "kind": 34550, "tags": [ @@ -34,7 +33,8 @@ The goal of this NIP is to create moderator-approved public communities around a ["relay", "", "requests"], ["relay", "", "approvals"], ["relay", ""] - ] + ], + ... } ``` @@ -44,12 +44,12 @@ Any Nostr event can be submitted to a community by anyone for approval. Clients ```json { - ... "kind": 1, "tags": [ ["a", "34550::", ""], ], - "content": "hello world" + "content": "hello world", + ... } ``` @@ -61,7 +61,6 @@ The post-approval event MUST include `a` tags of the communities the moderator i ```json { - ... "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", "kind": 4550, "tags": [ @@ -70,7 +69,8 @@ The post-approval event MUST include `a` tags of the communities the moderator i ["p", "", ""], ["k", ""] ], - "content": "" + "content": "", + ... } ``` @@ -86,7 +86,7 @@ Community clients SHOULD display posts that have been approved by at least 1 mod The following filter displays the approved posts. -```js +```json [ "REQ", "_", diff --git a/75.md b/75.md index 3a89f904..f3cf5d06 100644 --- a/75.md +++ b/75.md @@ -1,6 +1,8 @@ -# NIP-75 +NIP-75 +====== -## Zap Goals +Zap Goals +--------- `draft` `optional` @@ -27,7 +29,7 @@ Example event: ["amount", "210000"], ], "content": "Nostrasia travel expenses", - ...other fields + ... ``` The following tags are OPTIONAL. @@ -43,7 +45,8 @@ The following tags are OPTIONAL. ["closed_at", ""], ], "content": "Nostrasia travel expenses", - ...other fields + ... +} ``` The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event. @@ -54,12 +57,14 @@ Parameterized replaceable events can link to a goal by using a `goal` tag specif ```json { - "kind": 3XXXX, + ... + "kind": 3xxxx, "tags": [ ... ["goal", "", ""], ], - ...other fields + ... +} ``` ## Client behavior diff --git a/84.md b/84.md index 303cd933..d5f54d4c 100644 --- a/84.md +++ b/84.md @@ -27,9 +27,14 @@ useful when highlighting non-nostr content for which the client might be able to last value of the tag. ```json -[ "p", "", "", "author" ], -[ "p", "", "", "author" ], -[ "p", "", "", "editor" ], +{ + "tags": [ + ["p", "", "", "author"], + ["p", "", "", "author"], + ["p", "", "", "editor"] + ], + ... +} ``` ### Context diff --git a/89.md b/89.md index 73cb7bd5..be3d075d 100644 --- a/89.md +++ b/89.md @@ -9,10 +9,12 @@ Recommended Application Handlers This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds. ## Rationale + Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics. This NIP provides a simple way for clients to discover applications that handle events of a specific kind to ensure smooth cross-client and cross-kind interactions. ### Parties involved + There are three actors to this workflow: * application that handles a specific event kind (note that an application doesn't necessarily need to be a distinct entity and it could just be the same pubkey as user A) @@ -22,18 +24,18 @@ There are three actors to this workflow: * user B, who seeks a recommendation for an app that handles a specific event kind * Queries for `kind:31989` and, based on results, queries for `kind:31990` -# Events +## Events -## Recommendation event +### Recommendation event ```json { - "kind": 31989, - "pubkey": , - "tags": [ - [ "d", ], - [ "a", "31990:app1-pubkey:", "wss://relay1", "ios" ], - [ "a", "31990:app2-pubkey:", "wss://relay2", "web" ] - ] + "kind": 31989, + "pubkey": , + "tags": [ + ["d", ], + ["a", "31990:app1-pubkey:", "wss://relay1", "ios"], + ["a", "31990:app2-pubkey:", "wss://relay2", "web"] + ] } ``` @@ -47,34 +49,32 @@ The third value of the tag SHOULD be the platform where this recommendation migh ## Handler information ```json { - "kind": 31990, - "pubkey": , - "content": "", - "tags": [ - [ "d", ], - [ "k", ], - [ "web", "https://..../a/", "nevent" ], - [ "web", "https://..../p/", "nprofile" ], - [ "web", "https://..../e/" ], - [ "ios", ".../" ] - ] + "kind": 31990, + "pubkey": "", + "content": "", + "tags": [ + ["d", ], + ["k", ], + ["web", "https://..../a/", "nevent"], + ["web", "https://..../p/", "nprofile"], + ["web", "https://..../e/"], + ["ios", ".../"] + ] } ``` * `content` is an optional `metadata`-like stringified JSON object, as described in NIP-01. This content is useful when the pubkey creating the `kind:31990` is not an application. If `content` is empty, the `kind:0` of the pubkey should be used to display application information (e.g. name, picture, web, LUD16, etc.) - * `k` tags' value is the event kind that is supported by this `kind:31990`. Using a `k` tag(s) (instead of having the kind onf the NIP-33 `d` tag) provides: * Multiple `k` tags can exist in the same event if the application supports more than one event kind and their handler URLs are the same. * The same pubkey can have multiple events with different apps that handle the same event kind. - * `bech32` in a URL MUST be replaced by clients with the NIP-19-encoded entity that should be loaded by the application. Multiple tags might be registered by the app, following NIP-19 nomenclature as the second value of the array. A tag without a second value in the array SHOULD be considered a generic handler for any NIP-19 entity that is not handled by a different tag. -# Client tag +## Client tag When publishing events, clients MAY include a `client` tag in the same format as the recommendation event's `a` tags. This has privacy implications for users, so clients SHOULD allow users to opt-out of using this tag. ```json @@ -87,43 +87,45 @@ When publishing events, clients MAY include a `client` tag in the same format as } ``` -# User flow +## User flow A user A who uses a non-`kind:1`-centric nostr app could choose to announce/recommend a certain kind-handler application. When user B sees an unknown event kind, e.g. in a social-media centric nostr client, the client would allow user B to interact with the unknown-kind event (e.g. tapping on it). The client MIGHT query for the user's and the user's follows handler. -# Example +## Example -## User A recommends a `kind:31337`-handler +### User A recommends a `kind:31337`-handler User A might be a user of Zapstr, a `kind:31337`-centric client (tracks). Using Zapstr, user A publishes an event recommending Zapstr as a `kind:31337`-handler. ```json { - "kind": 31989, - "tags": [ - [ "d", "31337" ], - [ "a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", , "web" ] - ] + "kind": 31989, + "tags": [ + ["d", "31337"], + ["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", , "web"] + ], + ... } ``` -## User B interacts with a `kind:31337`-handler -User B might see in their timeline an event referring to a `kind:31337` event -(e.g. a `kind:1` tagging a `kind:31337`). +### User B interacts with a `kind:31337`-handler +User B might see in their timeline an event referring to a `kind:31337` event (e.g. a `kind:1` tagging a `kind:31337`). -User B's client, not knowing how to handle a `kind:31337` might display the event -using its `alt` tag (as described in NIP-31). When the user clicks on the event, -the application queries for a handler for this `kind`: +User B's client, not knowing how to handle a `kind:31337` might display the event using its `alt` tag (as described in NIP-31). When the user clicks on the event, the application queries for a handler for this `kind`: -`["REQ", , '[{ "kinds": [31989], "#d": ["31337"], 'authors': [, ] }]']` +```json +["REQ", , '[{ "kinds": [31989], "#d": ["31337"], 'authors': [, ] }]'] +``` User B, who follows User A, sees that `kind:31989` event and fetches the `a`-tagged event for the app and handler information. User B's client sees the application's `kind:31990` which includes the information to redirect the user to the relevant URL with the desired entity replaced in the URL. -## Alternative query bypassing `kind:31989` -Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms to avoid directing users to malicious handlers. +### Alternative query bypassing `kind:31989` +Alternatively, users might choose to query directly for `kind:31990` for an event kind. Clients SHOULD be careful doing this and use spam-prevention mechanisms or querying high-quality restricted relays to avoid directing users to malicious handlers. -`["REQ", , '[{ "kinds": [31990], "#k": [], 'authors': [...] }]']` +```json +["REQ", , '[{ "kinds": [31990], "#k": [], 'authors': [...] }]'] +``` diff --git a/90.md b/90.md index c498cddd..6017c98c 100644 --- a/90.md +++ b/90.md @@ -13,11 +13,11 @@ Money in, data out. ## Kinds This NIP reserves the range `5000-7000` for data vending machine use. -| Kind | Description | -| ---- | ----------- | +| Kind | Description | +| ---- | ----------- | | 5000-5999 | Job request kinds | -| 6000-6999 | Job result | -| 7000 | Job feedback | +| 6000-6999 | Job result | +| 7000 | Job feedback | Job results always use a kind number that is `1000` higher than the job request kind. (e.g. request: `kind:5001` gets a result: `kind:6001`). @@ -67,34 +67,34 @@ All tags are optional. * `relays`: List of relays where Service Providers SHOULD publish responses to * `p`: Service Providers the customer is interested in. Other SPs MIGHT still choose to process the job -## Encrypted Params +## Encrypted Params If the user wants to keep the input parameters a secret, they can encrypt the `i` and `param` tags with the service provider's 'p' tag and add it to the content field. Add a tag `encrypted` as tags. Encryption for private tags will use [NIP-04 - Encrypted Direct Message encryption](https://github.com/nostr-protocol/nips/blob/master/04.md), using the user's private and service provider's public key for the shared secret ```json [ - [ "i", "what is the capital of France? ", "text" ], - [ "param", "model", "LLaMA-2" ], - [ "param", "max_tokens", "512" ], - [ "param", "temperature", "0.5" ], - [ "param", "top-k", "50" ], - [ "param", "top-p", "0.7" ], - [ "param", "frequency_penalty", "1" ] - + ["i", "what is the capital of France? ", "text"], + ["param", "model", "LLaMA-2"], + ["param", "max_tokens", "512"], + ["param", "temperature", "0.5"], + ["param", "top-k", "50"], + ["param", "top-p", "0.7"], + ["param", "frequency_penalty", "1"] ] ``` -This param data will be encrypted and added to the `content` field and `p` tag should be present - -``` -"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", - "tags": [ - ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], - ["encrypted"] - ] - +This param data will be encrypted and added to the `content` field and `p` tag should be present +```json +{ + "content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...", + "tags": [ + ["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"], + ["encrypted"] + ], + ... +} ``` @@ -104,16 +104,17 @@ Service providers publish job results, providing the output of the job result. T ```json { - "pubkey": "", - "content": "", - "kind": 6xxx, - "tags": [ - [ "request", "" ], - [ "e", "", "" ], - [ "i", "" ], - [ "p", "" ], - [ "amount", "requested-payment-amount", "" ] - ] + "pubkey": "", + "content": "", + "kind": 6xxx, + "tags": [ + ["request", ""], + ["e", "", ""], + ["i", ""], + ["p", ""], + ["amount", "requested-payment-amount", ""] + ], + ... } ``` @@ -123,38 +124,40 @@ Service providers publish job results, providing the output of the job result. T ## Encrypted Output -If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text. +If the request has encrypted params, then output should be encrypted and placed in `content` field. If the output is encrypted, then avoid including `i` tag with input-data as clear text. Add a tag encrypted to mark the output content as `encrypted` + ```json { - "pubkey": "", - "content": "", - "kind": 6xxx, - "tags": [ - [ "request", "" ], - [ "e", "", "" ], - [ "p", "" ], - [ "amount", "requested-payment-amount", "" ], - ["encrypted"] - - ] + "pubkey": "", + "content": "", + "kind": 6xxx, + "tags": [ + ["request", ""], + ["e", "", ""], + ["p", ""], + ["amount", "requested-payment-amount", ""], + ["encrypted"] + ], + ... } ``` - ## Job feedback + Service providers can give feedback about a job back to the customer. ```json { - "kind": 7000, - "content": "", - "tags": [ - [ "status", "", "" ], - [ "amount", "requested-payment-amount", "" ], - [ "e", "", "" ], - [ "p", "" ], - ] + "kind": 7000, + "content": "", + "tags": [ + ["status", "", ""], + ["amount", "requested-payment-amount", ""], + ["e", "", ""], + ["p", ""], + ], + ... } ``` @@ -166,18 +169,19 @@ Service providers can give feedback about a job back to the customer. ### Job feedback status -| status | description | -|--------|-------------| -| `payment-required` | Service Provider requires payment before continuing. | -| `processing` | Service Provider is processing the job. | -| `error` | Service Provider was unable to process the job. | -| `success` | Service Provider successfully processed the job. | -| `partial` | Service Provider partially processed the job. The `.content` might include a sample of the partial results. | +| status | description | +| -------- | ------------- | +| `payment-required` | Service Provider requires payment before continuing. | +| `processing` | Service Provider is processing the job. | +| `error` | Service Provider was unable to process the job. | +| `success` | Service Provider successfully processed the job. | +| `partial` | Service Provider partially processed the job. The `.content` might include a sample of the partial results. | Any job feedback event MIGHT include results in the `.content` field, as described in the [Job Result](#job-result) section. This is useful for service providers to provide a sample of the results that have been processed so far. # Protocol Flow + * Customer publishes a job request (e.g. `kind:5000` speech-to-text). * Service Providers MAY submit `kind:7000` job-feedback events (e.g. `payment-required`, `processing`, `error`, etc.). * Upon completion, the service provider publishes the result of the job with a `kind:6000` job-result event. @@ -207,18 +211,19 @@ This gives a higher level of flexibility to service providers (which sophisticat # Appendix 2: Service provider discoverability Service Providers MAY use NIP-89 announcements to advertise their support for job kinds: -```json +```js { - "kind": 31990, - "pubkey": "", - "content": "{ - \"name\": \"Translating DVM\", - \"about\": \"I'm a DVM specialized in translating Bitcoin content.\" - }", - "tags": [ - [ "k", "5005" ], // e.g. translation - [ "t", "bitcoin" ] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" - ] + "kind": 31990, + "pubkey": "", + "content": "{ + \"name\": \"Translating DVM\", + \"about\": \"I'm a DVM specialized in translating Bitcoin content.\" + }", + "tags": [ + ["k", "5005"], // e.g. translation + ["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" + ], + ... } ``` diff --git a/94.md b/94.md index 0b76c25b..95b6a3bc 100644 --- a/94.md +++ b/94.md @@ -28,9 +28,6 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr ```json { - "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data>, - "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, - "created_at": , "kind": 1063, "tags": [ ["url",], @@ -47,8 +44,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr ["summary", ], ["alt", ] ], - "content": , - "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> + "content": "", + ... } ``` diff --git a/98.md b/98.md index e04c7fc1..ca523042 100644 --- a/98.md +++ b/98.md @@ -2,7 +2,7 @@ NIP-98 ====== HTTP Auth -------------------------- +--------- `draft` `optional` @@ -24,22 +24,16 @@ The following tags MUST be included. Example event: ```json { - "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734", - "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed", - "content": "", - "kind": 27235, - "created_at": 1682327852, - "tags": [ - [ - "u", - "https://api.snort.social/api/v1/n5sp/list" - ], - [ - "method", - "GET" - ] - ], - "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184" + "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734", + "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed", + "content": "", + "kind": 27235, + "created_at": 1682327852, + "tags": [ + ["u", "https://api.snort.social/api/v1/n5sp/list"], + ["method", "GET"] + ], + "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184" } ``` diff --git a/99.md b/99.md index 9e8f1dad..e65920c6 100644 --- a/99.md +++ b/99.md @@ -1,6 +1,8 @@ -# NIP-99 +NIP-99 +====== -## Classified Listings +Classified Listings +------------------- `draft` `optional` From 50d20123e2271e2d33323105414b01a0a69559d5 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 09:36:59 -0300 Subject: [PATCH 44/48] "restricted_writes" on NIP-11. --- 11.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/11.md b/11.md index ab05f31d..fe9f0e48 100644 --- a/11.md +++ b/11.md @@ -79,6 +79,7 @@ are rejected or fail immediately. "min_pow_difficulty": 30, "auth_required": true, "payment_required": true, + "restricted_writes": true, "created_at_lower_limit": 31536000, "created_at_upper_limit": 3 }, @@ -124,6 +125,9 @@ Even if set to False, authentication may be required for specific actions. - `payment_required`: this relay requires payment before a new connection may perform any action. +- `restricted_writes`: this relay requires some kind of condition to be fulfilled in order to +accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`). + - `created_at_lower_limit`: 'created_at' lower limit as defined in [NIP-22](22.md) - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) From 2d678bcd5a1beb56097fb9af037e1fe2b2598c5e Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 11:35:32 -0300 Subject: [PATCH 45/48] metadata tags for lists kept at "title", "image" and "description", following @erskingardner and @darecjo. --- 51.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/51.md b/51.md index bcab8b8d..b42bc8b2 100644 --- a/51.md +++ b/51.md @@ -47,8 +47,7 @@ For example, _relay sets_ can be displayed in a dropdown UI to give users the op relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ can be used by apps to showcase curations made by others tagged to different topics. -Aside from their main identifier, the `"d"` tag, sets can optionally have a `"name"`, a `"picture"` and an -`"about"` tag that can be used to enhance their UI. +Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tags that can be used to enhance their UI. | name | kind | description | expected tag items | | --- | --- | --- | --- | From 5e6e7a2bc85de7d251b2d7d111c355a9e5ddd0e4 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 18 Nov 2023 11:36:20 -0300 Subject: [PATCH 46/48] get rid of these arbitrary markdown linebreaks and put everything in the same line. --- 51.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/51.md b/51.md index b42bc8b2..f9f567a9 100644 --- a/51.md +++ b/51.md @@ -6,24 +6,17 @@ Lists `draft` `optional` `author:fiatjaf` `author:arcbtc` `author:monlovesmango` `author:eskema` `author:gzuuus` -This NIP defines lists of things that users can create. Lists can contain references to anything, and these -references can be **public** or **private**. +This NIP defines lists of things that users can create. Lists can contain references to anything, and these references can be **public** or **private**. -Public items in a list are specified in the event `tags` array, while private items are specified in a JSON -array that mimics the structure of the event `tags` array, but stringified and encrypted using the same -scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and -stored in the `.content`. +Public items in a list are specified in the event `tags` array, while private items are specified in a JSON array that mimics the structure of the event `tags` array, but stringified and encrypted using the same scheme from [NIP-04](04.md) (the shared key is computed using the author's public and private key) and stored in the `.content`. ## Types of lists ## Standard lists -Standard lists use non-parameterized replaceable events, meaning users may only have a single list -of each kind. They have special meaning and clients may rely on them to augment a user's profile or -browsing experience. +Standard lists use non-parameterized replaceable events, meaning users may only have a single list of each kind. They have special meaning and clients may rely on them to augment a user's profile or browsing experience. -For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in -their feeds or receive annoying notifications from. +For example, _mute lists_ can contain the public keys of spammers and bad actors users don't want to see in their feeds or receive annoying notifications from. | name | kind | description | expected tag items | | --- | --- | --- | --- | @@ -39,13 +32,9 @@ their feeds or receive annoying notifications from. ## Sets -Sets are lists with well-defined meaning that can enhance the functionality and the UI of clients that rely -on them. Unlike standard lists, users are expected to have more than one set of each kind, therefore each of -them must be assigned a different `"d"` identifier. +Sets are lists with well-defined meaning that can enhance the functionality and the UI of clients that rely on them. Unlike standard lists, users are expected to have more than one set of each kind, therefore each of them must be assigned a different `"d"` identifier. -For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which -relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ -can be used by apps to showcase curations made by others tagged to different topics. +For example, _relay sets_ can be displayed in a dropdown UI to give users the option to switch to which relays they will publish an event or from which relays they will read the replies to an event; _curation sets_ can be used by apps to showcase curations made by others tagged to different topics. Aside from their main identifier, the `"d"` tag, sets can optionally have a `"title"`, an `"image"` and a `"description"` tags that can be used to enhance their UI. From 33a719f34507bf2cbc6717eb5e4b9464daaad23a Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 19 Nov 2023 07:17:11 -0300 Subject: [PATCH 47/48] fix kind:40 name (following @snowcait). --- 51.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/51.md b/51.md index f9f567a9..54c09204 100644 --- a/51.md +++ b/51.md @@ -24,7 +24,7 @@ For example, _mute lists_ can contain the public keys of spammers and bad actors | Pinned notes | 10001 | events the user intends to showcase in their profile page | `"e"` (kind:1 notes) | | Bookmarks | 10003 | uncategorized, "global" list of things a user wants to save | `"e"` (kind:1 notes), `"a"` (kind:30023 articles), `"t"` (hashtags), `"r" (URLs)` | | Communities | 10004 | [NIP-72](72.md) communities the user belongs to | `"a"` (kind:34550 community definitions) | -| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 community definitions) | +| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | | Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a" (kind:30015 interest set)` | From 438812d0a4a9afa5b4985e07771ae2919765b514 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 19 Nov 2023 10:17:57 -0300 Subject: [PATCH 48/48] clarify that `restricted_writes` do not include normal anti-spam heuristics and other kinds of soft-restrictions. --- 11.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/11.md b/11.md index fe9f0e48..615e796f 100644 --- a/11.md +++ b/11.md @@ -127,6 +127,9 @@ Even if set to False, authentication may be required for specific actions. - `restricted_writes`: this relay requires some kind of condition to be fulfilled in order to accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`). +This should only be set to `true` when users are expected to know the relay policy before trying +to write to it -- like belonging to a special pubkey-based whitelist or writing only events of +a specific niche kind or content. Normal anti-spam heuristics, for example, do not qualify. - `created_at_lower_limit`: 'created_at' lower limit as defined in [NIP-22](22.md)