Compare commits

...

33 Commits

Author SHA1 Message Date
fiatjaf
bde51dfdd2 NIP-93: backwards-compatible alternative media URLs. 2023-11-23 01:00:13 -03:00
fiatjaf_
7822a8b126 Merge pull request #880 from nostr-protocol/save-nip-51 2023-11-19 14:47:02 -03:00
fiatjaf_
ea6d277c7c Merge pull request #889 from nostr-protocol/nip11-restricted-writes 2023-11-19 11:18:19 -03:00
fiatjaf
438812d0a4 clarify that restricted_writes do not include normal anti-spam heuristics and other kinds of soft-restrictions. 2023-11-19 10:17:57 -03:00
fiatjaf
33a719f345 fix kind:40 name (following @snowcait). 2023-11-19 07:17:11 -03:00
fiatjaf
5e6e7a2bc8 get rid of these arbitrary markdown linebreaks and put everything in the same line. 2023-11-18 11:36:20 -03:00
fiatjaf
2d678bcd5a metadata tags for lists kept at "title", "image" and "description", following @erskingardner and @darecjo. 2023-11-18 11:35:32 -03:00
fiatjaf
50d20123e2 "restricted_writes" on NIP-11. 2023-11-18 09:39:54 -03:00
fiatjaf
5dcfe85306 reformat a bunch of json things and small nitpicks. 2023-11-18 09:13:12 -03:00
fiatjaf
b0df71824f NIP-72: reformat and clarify some things. 2023-11-18 08:48:49 -03:00
fiatjaf
7aa751be46 NIP-03: explain why a single attestation is recommended. 2023-11-18 08:22:42 -03:00
fiatjaf
b5b46b629f reformat NIP-11. 2023-11-18 08:21:15 -03:00
fiatjaf
33e7650bab give a better and updated explanation of how nips work in the readme. 2023-11-18 08:19:45 -03:00
Leo Wandersleb
05e29aa10e Merge pull request #888 from vitorpamplona/contrib
Adds contributor images to the readme.
2023-11-17 21:19:43 -03:00
Vitor Pamplona
5f1d10fad2 Adds contributor images to the readme. 2023-11-17 18:05:23 -05:00
mattn
ba1078b6ce Merge pull request #886 from mattn/fix-typos5
fix typos
2023-11-17 12:23:31 +09:00
Yasuhiro Matsumoto
e7e64af04a fix typos 2023-11-17 12:22:43 +09:00
Pablo Fernandez
010b322fa1 Merge pull request #884 from coracle-social/client-tag 2023-11-16 22:03:13 +02:00
fiatjaf
4a77fc5c40 add interests list and interests sets (following @erskingardner and @pablof7z). 2023-11-16 15:50:39 -03:00
fiatjaf
2a0b701ff7 add bookmark sets (following @staab). 2023-11-16 12:26:50 -03:00
Jon Staab
7f27800e27 Add client tag to nip 89 2023-11-16 05:43:28 -08:00
fiatjaf
31382e57a1 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
2023-11-15 20:52:27 -03:00
fiatjaf_
6c3eebf510 clarify that standard lists use normal replaceable events
Co-authored-by: hodlbod <jstaab@protonmail.com>
2023-11-15 20:06:49 -03:00
fiatjaf_
cd598bad5b remove the point that makes kind 30001 be a grab-bag of things
Co-authored-by: hodlbod <jstaab@protonmail.com>
2023-11-15 20:06:00 -03:00
fiatjaf
804ee187c2 make follow sets kind 30000 as per @monlovesmango's comment. 2023-11-15 15:39:23 -03:00
fiatjaf
4db99145d7 remove legacy communities list example. 2023-11-15 15:34:46 -03:00
fiatjaf
61b736574c add kind 30005 follow sets. 2023-11-15 15:32:22 -03:00
fiatjaf
54befcc09a deprecate the 30001 ad-hoc pin/bookmark/communities lists and use new kinds. 2023-11-15 15:32:09 -03:00
fiatjaf
fd288d4ea9 update readme kind list. 2023-11-15 08:28:59 -03:00
fiatjaf
cf1b17280f bring back kind:10000 mute lists, deprecation notice about kind:30000/"mute" and more examples. 2023-11-15 08:24:46 -03:00
fiatjaf
1bbd87c42f distinction between lists and sets. 2023-11-15 07:33:26 -03:00
fiatjaf
da05b5d915 add "communities" list and examples. 2023-11-15 00:47:15 -03:00
fiatjaf
5dc6071978 cut, simplify and update NIP-51 to reflect the real-world usage. 2023-11-15 00:22:09 -03:00
25 changed files with 726 additions and 638 deletions

2
03.md
View File

@@ -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 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 ### Example OpenTimestamps proof verification flow

161
11.md
View File

@@ -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. 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 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. 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. 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. 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. 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. 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. 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. 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. 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 Extra Fields
----------------- ------------
### Server Limitations ### ### Server Limitations
These are limitations imposed by the relay on clients. Your client These are limitations imposed by the relay on clients. Your client
should expect that requests which exceed these *practical* limitations should expect that requests which exceed these *practical* limitations
@@ -68,22 +68,22 @@ are rejected or fail immediately.
```json ```json
{ {
...
"limitation": { "limitation": {
"max_message_length": 16384, "max_message_length": 16384,
"max_subscriptions": 20, "max_subscriptions": 20,
"max_filters": 100, "max_filters": 100,
"max_limit": 5000, "max_limit": 5000,
"max_subid_length": 100, "max_subid_length": 100,
"max_event_tags": 100, "max_event_tags": 100,
"max_content_length": 8196, "max_content_length": 8196,
"min_pow_difficulty": 30, "min_pow_difficulty": 30,
"auth_required": true, "auth_required": true,
"payment_required": true, "payment_required": true,
"created_at_lower_limit":31536000, "restricted_writes": true,
"created_at_upper_limit":3, "created_at_lower_limit": 31536000,
} "created_at_upper_limit": 3
... },
...
} }
``` ```
@@ -125,11 +125,17 @@ 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. - `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`).
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) - `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) - `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 There may be a cost associated with storing data forever, so relays
may wish to state retention times. The values stated here are defaults may wish to state retention times. The values stated here are defaults
@@ -142,14 +148,12 @@ all, and preferably an error will be provided when those are received.
```json ```json
{ {
...
"retention": [ "retention": [
{ "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 }, {"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600},
{ "kinds": [[40000, 49999]], "time": 100 }, {"kinds": [[40000, 49999]], "time": 100},
{ "kinds": [[30000, 39999]], "count": 1000 }, {"kinds": [[30000, 39999]], "count": 1000},
{ "time": 3600, "count": 10000 } {"time": 3600, "count": 10000}
] ]
...
} }
``` ```
@@ -165,8 +169,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. 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 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 may limit what content can be stored in cleartext on those relays. All
@@ -185,9 +188,8 @@ flexibility is up to the client software.
```json ```json
{ {
...
"relay_countries": [ "CA", "US" ], "relay_countries": [ "CA", "US" ],
... ...
} }
``` ```
@@ -199,7 +201,7 @@ country of the legal entities who own the relay, so it's very
likely a number of countries are involved. likely a number of countries are involved.
### Community Preferences ### ### Community Preferences
For public text notes at least, a relay may try to foster a For public text notes at least, a relay may try to foster a
local community. This would encourage users to follow the global local community. This would encourage users to follow the global
@@ -208,11 +210,10 @@ To support this goal, relays MAY specify some of the following values.
```json ```json
{ {
... "language_tags": ["en", "en-419"],
"language_tags": [ "en", "en-419" ], "tags": ["sfw-only", "bitcoin-only", "anime"],
"tags": [ "sfw-only", "bitcoin-only", "anime" ],
"posting_policy": "https://example.com/posting-policy.html", "posting_policy": "https://example.com/posting-policy.html",
... ...
} }
``` ```
@@ -239,59 +240,75 @@ detail and legal terms. Use the `tags` field to signify limitations
on content, or topics to be discussed, which could be machine on content, or topics to be discussed, which could be machine
processed by appropriate client software. processed by appropriate client software.
### Pay-To-Relay ### ### Pay-to-Relay
Relays that require payments may want to expose their fee schedules. Relays that require payments may want to expose their fee schedules.
```json ```json
{ {
...
"payments_url": "https://my-relay/payments", "payments_url": "https://my-relay/payments",
"fees": { "fees": {
"admission": [{ "amount": 1000000, "unit": "msats" }], "admission": [{ "amount": 1000000, "unit": "msats" }],
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], "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. A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape.
```json ```json
{ {
...
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
... ...
} }
``` ```
### Examples ### ### Examples
As of 2 May 2023 the following `curl` command provided these results.
>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", ~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
"pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700",
"contact":"me@ricardocabral.io", {
"supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40], "description": "nostr.land family of relays (us-or-01)",
"supported_nip_extensions":["11a"], "name": "nostr.land",
"software":"git+https://github.com/Cameri/nostream.git", "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
"version":"1.22.6", "software": "custom",
"limitation":{"max_message_length":1048576, "supported_nips": [
"max_subscriptions":10, 1,
"max_filters":2500, 2,
"max_limit":5000, 4,
"max_subid_length":256, 9,
"max_event_tags":2500, 11,
"max_content_length":65536, 12,
"min_pow_difficulty":0, 16,
"auth_required":false, 20,
"payment_required":true}, 22,
"payments_url":"https://eden.nostr.land/invoices", 28,
"fees":{"admission":[{"amount":5000000,"unit":"msats"}], 33,
"publication":[]}}, 40
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" ],
"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
}
]
},
}

6
13.md
View File

@@ -35,11 +35,7 @@ Example mined note
"created_at": 1651794653, "created_at": 1651794653,
"kind": 1, "kind": 1,
"tags": [ "tags": [
[ ["nonce", "776797", "21"]
"nonce",
"776797",
"21"
]
], ],
"content": "It's just me mining my own business", "content": "It's just me mining my own business",
"sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977" "sig": "284622fc0a3f4f1303455d5175f7ba962a3300d136085b9566801bc2e0699de0c7e31e44c81fb40ad9049173742e904713c3594a1da0fc5d2382a25c11aba977"

8
14.md
View File

@@ -6,14 +6,16 @@ Subject tag in Text events
`draft` `optional` `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) (implemented in more-speech)
`["subject": <string>]` ```json
["subject": <string>]
```
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. 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 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. Subjects should generally be shorter than 80 chars. Long subjects will likely be trimmed by clients.

205
15.md
View File

@@ -1,14 +1,14 @@
NIP-15 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 ## Terms
@@ -35,29 +35,30 @@ The `merchant` admin software can be purely clientside, but for `convenience` an
A merchant can publish these events: A merchant can publish these events:
| Kind | | Description | | 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. | | `30017` | `set_stall` | Create or update a stall. |
| `30018` | `set_product` | Create or update a product. | | `30018` | `set_product` | Create or update a product. |
| `4 ` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. | | `4` | `direct_message` | Communicate with the customer. The messages can be plain-text or JSON. |
| `5 ` | `delete` | Delete a product or a stall. | | `5` | `delete` | Delete a product or a stall. |
### Event `30017`: Create or update a stall. ### Event `30017`: Create or update a stall.
**Event Content**: **Event Content**
```json ```json
{ {
"id": <String, UUID generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>, "id": <string, id generated by the merchant. Sequential IDs (`0`, `1`, `2`...) are discouraged>,
"name": <String, stall name>, "name": <string, stall name>,
"description": <String (optional), stall description>, "description": <string (optional), stall description>,
"currency": <String, currency used>, "currency": <string, currency used>,
"shipping": [ "shipping": [
{ {
"id": <String, UUID of the shipping zone, generated by the merchant>, "id": <string, id of the shipping zone, generated by the merchant>,
"name": <String (optional), zone name>, "name": <string (optional), zone name>,
"cost": <float, base cost for shipping. The currency is defined at the stall level>, "cost": <float, base cost for shipping. The currency is defined at the stall level>,
"regions": [<String, regions included in this zone>], "regions": [<string, regions included in this zone>],
} }
] ]
} }
``` ```
@@ -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 - 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. 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 ```json
"tags": [["d", <String, id of stall]] {
"tags": [["d", <string, id of stall]],
...
}
``` ```
- the `d` tag is required, its value MUST be the same as the stall `id`. - the `d` tag is required, its value MUST be the same as the stall `id`.
### Event `30018`: Create or update a product ### Event `30018`: Create or update a product
**Event Content**: **Event Content**
```json ```json
{ {
"id": <String, UUID generated by the merchant.Sequential IDs (`0`, `1`, `2`...) are discouraged>, "id": <string, id generated by the merchant (sequential ids are discouraged)>,
"stall_id": <String, UUID of the stall to which this product belong to>, "stall_id": <string, id of the stall to which this product belong to>,
"name": <String, product name>, "name": <string, product name>,
"description": <String (optional), product description>, "description": <string (optional), product description>,
"images": <[String], array of image URLs, optional>, "images": <[string], array of image URLs, optional>,
"currency": <String, currency used>, "currency": <string, currency used>,
"price": <float, cost of product>, "price": <float, cost of product>,
"quantity": <int or null, available items>, "quantity": <int or null, available items>,
"specs": [ "specs": [
[<String, spec key>, <String, spec value>] [<string, spec key>, <string, spec value>]
], ],
"shipping": [ "shipping": [
{ {
"id": <String, UUID of the shipping zone. Must match one of the zones defined for the stall>, "id": <string, id of the shipping zone (must match one of the zones defined for the stall)>,
"cost": <float, extra cost for shipping. The currency is defined at the stall level>, "cost": <float, extra cost for shipping. The currency is defined at the stall level>,
} }
] ]
} }
``` ```
@@ -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 - 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: - 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 `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 ```json
"tags": [ "tags": [
["d", <String, id of product], ["d", <string, id of product],
["t", <String (optional), product category], ["t", <string (optional), product category],
["t", <String (optional), product category], ["t", <string (optional), product category],
... ...
] ],
...
``` ```
- the `d` tag is required, its value MUST be the same as the product `id`. - the `d` tag is required, its value MUST be the same as the product `id`.
@@ -147,23 +155,23 @@ The below json goes in content of [NIP04](https://github.com/nostr-protocol/nips
```json ```json
{ {
"id": <String, UUID generated by the customer>, "id": <string, id generated by the customer>,
"type": 0, "type": 0,
"name": <String (optional), ???>, "name": <string (optional), ???>,
"address": <String (optional), for physical goods an address should be provided> "address": <string (optional), for physical goods an address should be provided>
"message": "<String (optional), message for merchant>, "message": "<string (optional), message for merchant>,
"contact": { "contact": {
"nostr": <32-bytes hex of a pubkey>, "nostr": <32-bytes hex of a pubkey>,
"phone": <String (optional), if the customer wants to be contacted by phone>, "phone": <string (optional), if the customer wants to be contacted by phone>,
"email": <String (optional), if the customer wants to be contacted by email>, "email": <string (optional), if the customer wants to be contacted by email>,
}, },
"items": [ "items": [
{ {
"product_id": <String, UUID of the product>, "product_id": <string, id of the product>,
"quantity": <int, how many products the customer is ordering> "quantity": <int, how many products the customer is ordering>
} }
], ],
"shipping_id": <String, UUID of the shipping zone> "shipping_id": <string, id of the shipping zone>
} }
``` ```
@@ -186,23 +194,23 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
```json ```json
{ {
"id": <String, UUID of the order>, "id": <string, id of the order>,
"type": 1, "type": 1,
"message": <String, message to customer, optional>, "message": <string, message to customer, optional>,
"payment_options": [ "payment_options": [
{ {
"type": <String, option type>, "type": <string, option type>,
"link": <String, url, btc address, ln invoice, etc> "link": <string, url, btc address, ln invoice, etc>
}, },
{ {
"type": <String, option type>, "type": <string, option type>,
"link": <String, url, btc address, ln invoice, etc> "link": <string, url, btc address, ln invoice, etc>
}, },
{ {
"type": <String, option type>, "type": <string, option type>,
"link": <String, url, btc address, ln invoice, etc> "link": <string, url, btc address, ln invoice, etc>
} }
] ]
} }
``` ```
@@ -214,11 +222,11 @@ The below json goes in `content` of [NIP04](https://github.com/nostr-protocol/ni
```json ```json
{ {
"id": <String, UUID of the order>, "id": <string, id of the order>,
"type": 2, "type": 2,
"message": <String, message to customer>, "message": <string, message to customer>,
"paid": <Bool, true/false has received payment>, "paid": <bool: has received payment>,
"shipped": <Bool, true/false has been shipped>, "shipped": <bool: has been shipped>,
} }
``` ```
## Customize Marketplace ## 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 `30019`: Create or update marketplace UI/UX
**Event Content**: **Event Content**
```json ```json
{ {
"name": <String (optional), market name>, "name": <string (optional), market name>,
"about": <String (optional), market description>, "about": <string (optional), market description>,
"ui": { "ui": {
"picture": <String (optional), market logo image URL>, "picture": <string (optional), market logo image URL>,
"banner": <String (optional), market logo banner URL>, "banner": <string (optional), market logo banner URL>,
"theme": <String (optional), market theme>, "theme": <string (optional), market theme>,
"darkMode": <Bool, true/false> "darkMode": <bool, true/false>
}, },
"merchants": <[String] (optional), array of pubkeys>, "merchants": [array of pubkeys (optional)],
... ...
} }
``` ```

46
28.md
View File

@@ -27,8 +27,8 @@ In the channel creation `content` field, Client SHOULD include basic channel met
```json ```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. 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. 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 ```json
{ {
"content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}",
"tags": [["e", <channel_create_event_id>, <relay-url>]], "tags": [["e", <channel_create_event_id>, <relay-url>]],
... ...
} }
``` ```
@@ -72,9 +72,9 @@ Root message:
```json ```json
{ {
"content": <string>, "content": <string>,
"tags": [["e", <kind_40_event_id>, <relay-url>, "root"]], "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]],
... ...
} }
``` ```
@@ -82,14 +82,14 @@ Reply to another message:
```json ```json
{ {
"content": <string>, "content": <string>,
"tags": [ "tags": [
["e", <kind_40_event_id>, <relay-url>, "root"], ["e", <kind_40_event_id>, <relay-url>, "root"],
["e", <kind_42_event_id>, <relay-url>, "reply"], ["e", <kind_42_event_id>, <relay-url>, "reply"],
["p", <pubkey>, <relay-url>], ["p", <pubkey>, <relay-url>],
... ...
], ],
... ...
} }
``` ```
@@ -108,9 +108,9 @@ Clients MAY hide event 42s for other users other than the user who sent the even
```json ```json
{ {
"content": "{\"reason\": \"Dick pic\"}", "content": "{\"reason\": \"Dick pic\"}",
"tags": [["e", <kind_42_event_id>]], "tags": [["e", <kind_42_event_id>]],
... ...
} }
``` ```
@@ -126,9 +126,9 @@ Clients MAY hide event 42s for users other than the user who sent the event 44.
```json ```json
{ {
"content": "{\"reason\": \"Posting dick pics\"}", "content": "{\"reason\": \"Posting dick pics\"}",
"tags": [["p", <pubkey>]], "tags": [["p", <pubkey>]],
... ...
} }
``` ```

9
32.md
View File

@@ -64,7 +64,8 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
["l", "permies", "#t"], ["l", "permies", "#t"],
["p", <pubkey1>, <relay_url>], ["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>] ["p", <pubkey2>, <relay_url>]
] ],
...
} }
``` ```
@@ -78,7 +79,8 @@ A report flagging violence toward a human being as defined by ontology.example.c
["l", "VI-hum", "com.example.ontology"], ["l", "VI-hum", "com.example.ontology"],
["p", <pubkey1>, <relay_url>], ["p", <pubkey1>, <relay_url>],
["p", <pubkey2>, <relay_url>] ["p", <pubkey2>, <relay_url>]
] ],
...
} }
``` ```
@@ -92,6 +94,7 @@ A moderation suggestion for a chat event.
["l", "approve", "nip28.moderation"], ["l", "approve", "nip28.moderation"],
["e", <kind40_event_id>, <relay_url>] ["e", <kind40_event_id>, <relay_url>]
], ],
...
} }
``` ```
@@ -105,6 +108,7 @@ Assignment of a license to an event.
["l", "MIT", "license"], ["l", "MIT", "license"],
["e", <event_id>, <relay_url>] ["e", <event_id>, <relay_url>]
], ],
...
} }
``` ```
@@ -119,6 +123,7 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2.
["l", "IT-MI", "ISO-3166-2"] ["l", "IT-MI", "ISO-3166-2"]
], ],
"content": "It's beautiful here in Milan!", "content": "It's beautiful here in Milan!",
...
} }
``` ```

26
36.md
View File

@@ -24,18 +24,18 @@ options:
```json ```json
{ {
"pubkey": "<pub-key>", "pubkey": "<pub-key>",
"created_at": 1000000000, "created_at": 1000000000,
"kind": 1, "kind": 1,
"tags": [ "tags": [
["t", "hastag"], ["t", "hastag"],
["L", "content-warning"], ["L", "content-warning"],
["l", "reason", "content-warning"], ["l", "reason", "content-warning"],
["L", "social.nos.ontology"], ["L", "social.nos.ontology"],
["l", "NS-nud", "social.nos.ontology"], ["l", "NS-nud", "social.nos.ontology"],
["content-warning", "reason"] /* reason is optional */ ["content-warning", "<optional reason>"]
], ],
"content": "sensitive content with #hastag\n", "content": "sensitive content with #hastag\n",
"id": "<event-id>" "id": "<event-id>"
} }
``` ```

28
39.md
View File

@@ -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): 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 ```json
{ {
"id": <id>, "tags": [
"pubkey": <pubkey>, ["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"],
... ["i", "twitter:semisol_public", "1619358434134196225"],
"tags": [ ["i", "mastodon:bitcoinhackers.org/@semisol", "109775066355589974"]
["i", "github:semisol", "9721ce4ee4fceb91c9711ca2a6c9a5ab"], ["i", "telegram:1087295469", "nostrdirectory/770"]
["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 `:`. 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. 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. 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 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. 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 ## Claim types
@@ -41,14 +39,14 @@ Identity names SHOULD be normalized if possible by replacing uppercase letters w
Identity: A GitHub username. Identity: A GitHub username.
Proof: A GitHub Gist ID. This Gist should be created by `<identity>` with a single file that has the text `Verifying that I control the following Nostr public key: <npub encoded public key>`. Proof: A GitHub Gist ID. This Gist should be created by `<identity>` with a single file that has the text `Verifying that I control the following Nostr public key: <npub encoded public key>`.
This can be located at `https://gist.github.com/<identity>/<proof>`. This can be located at `https://gist.github.com/<identity>/<proof>`.
### `twitter` ### `twitter`
Identity: A Twitter username. Identity: A Twitter username.
Proof: A Tweet ID. The tweet should be posted by `<identity>` and have the text `Verifying my account on nostr My Public Key: "<npub encoded public key>"`. Proof: A Tweet ID. The tweet should be posted by `<identity>` and have the text `Verifying my account on nostr My Public Key: "<npub encoded public key>"`.
This can be located at `https://twitter.com/<identity>/status/<proof>`. This can be located at `https://twitter.com/<identity>/status/<proof>`.
### `mastodon` ### `mastodon`
@@ -62,5 +60,5 @@ This can be located at `https://<identity>/<proof>`.
Identity: A Telegram user ID. Identity: A Telegram user ID.
Proof: A string in the format `<ref>/<id>` which points to a message published in the public channel or group with name `<ref>` and message ID `<id>`. This message should be sent by user ID `<identity>` and have the text `Verifying that I control the following Nostr public key: "<npub encoded public key>"`. Proof: A string in the format `<ref>/<id>` which points to a message published in the public channel or group with name `<ref>` and message ID `<id>`. This message should be sent by user ID `<identity>` and have the text `Verifying that I control the following Nostr public key: "<npub encoded public key>"`.
This can be located at `https://t.me/<proof>`. This can be located at `https://t.me/<proof>`.

24
40.md
View File

@@ -2,7 +2,7 @@ NIP-40
====== ======
Expiration Timestamp Expiration Timestamp
----------------------------------- --------------------
`draft` `optional` `draft` `optional`
@@ -20,14 +20,14 @@ values:
```json ```json
{ {
"pubkey": "<pub-key>", "pubkey": "<pub-key>",
"created_at": 1000000000, "created_at": 1000000000,
"kind": 1, "kind": 1,
"tags": [ "tags": [
["expiration", "1600000000"] ["expiration", "1600000000"]
], ],
"content": "This message will expire at the specified timestamp and be deleted by relays.\n", "content": "This message will expire at the specified timestamp and be deleted by relays.\n",
"id": "<event-id>" "id": "<event-id>"
} }
``` ```
@@ -43,9 +43,9 @@ Clients SHOULD ignore events that have expired.
Relay Behavior Relay Behavior
-------------- --------------
Relays MAY NOT delete expired messages immediately on expiration and MAY persist them indefinitely. 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 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 SHOULD drop any events that are published to them if they are expired.
An expiration timestamp does not affect storage of ephemeral events. An expiration timestamp does not affect storage of ephemeral events.
Suggested Use Cases Suggested Use Cases

14
42.md
View File

@@ -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 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: to authenticate. When sent by relays, the message is of the following form:
``` ```json
["AUTH", <challenge-string>] ["AUTH", <challenge-string>]
``` ```
And, when sent by clients, of the following form: And, when sent by clients, of the following form:
``` ```json
["AUTH", <signed-event-json>] ["AUTH", <signed-event-json>]
``` ```
@@ -41,16 +41,12 @@ Relays MUST exclude `kind: 22242` events from being broadcasted to any client.
```json ```json
{ {
"id": "...",
"pubkey": "...",
"created_at": 1669695536,
"kind": 22242, "kind": 22242,
"tags": [ "tags": [
["relay", "wss://relay.example.com/"], ["relay", "wss://relay.example.com/"],
["challenge", "challengestringhere"] ["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 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: 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?"] ["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: or it can return an `OK` message noting the reason an event was not written using the same prefix:
``` ```json
["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"] ["OK", <event-id>, false, "restricted: we do not accept events from unauthenticated users, please sign up at https://example.com/"]
``` ```

21
45.md
View File

@@ -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. 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", <subscription_id>, <filters JSON>...] ["COUNT", <subscription_id>, <filters JSON>...]
``` ```
Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. Relays may use probabilistic counts to reduce compute requirements. Counts are returned using a `COUNT` response in the form `{"count": <integer>}`. 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": <integer>, "approximate": <true|false>}`. In case a relay uses probabilistic counts, it MAY indicate it in the response with `approximate` key i.e. `{"count": <integer>, "approximate": <true|false>}`.
``` ```json
["COUNT", <subscription_id>, {"count": <integer>}] ["COUNT", <subscription_id>, {"count": <integer>}]
``` ```
Examples: ## Examples:
``` ### Followers count
# Followers count
```json
["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}] ["COUNT", <subscription_id>, {"kinds": [3], "#p": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 238}] ["COUNT", <subscription_id>, {"count": 238}]
```
# Count posts and reactions ### Count posts and reactions
```json
["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}] ["COUNT", <subscription_id>, {"kinds": [1, 7], "authors": [<pubkey>]}]
["COUNT", <subscription_id>, {"count": 5}] ["COUNT", <subscription_id>, {"count": 5}]
```
# Count posts approximately ### Count posts approximately
```
["COUNT", <subscription_id>, {"kinds": [1]}] ["COUNT", <subscription_id>, {"kinds": [1]}]
["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}] ["COUNT", <subscription_id>, {"count": 93412452, "approximate": true}]
``` ```

197
51.md
View File

@@ -6,148 +6,107 @@ Lists
`draft` `optional` `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. 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 ## Types of lists
Lets say a user wants to create a 'Mute' list and has keys: ## Standard lists
```
priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
```
The user wants to publicly include these users:
```json 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.
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"],
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
```
and privately include these users (below is the JSON that would be encrypted and placed in the event content):
```json 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.
[
["p", "9ec7a778167afb1d30c4833de9322da0c08ba71a69e1911d5578d3144bb56437"],
["p", "8c0da4862130283ff9e67d889df264177a508974e2feb96de139804ea66d6168"]
]
```
Then the user would create a 'Mute' list event like below: | 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 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)` |
| Emojis | 10030 | user preferred emojis and pointers to emoji sets | `"emoji"` (see [NIP-30](30.md)) and `"a"` (kind:30030 emoji set) |
## 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.
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.
| 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) |
| 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
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 |
| --- | --- | --- |
| 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
### A _mute list_ with some public items and some encrypted items
```json ```json
{ {
"id": "a92a316b75e44cfdc19986c634049158d4206fcc0b7b9c7ccbcdabe28beebcd0",
"pubkey": "854043ae8f1f97430ca8c1f1a090bdde6488bd5115c7a45307a2a212750ae4cb",
"created_at": 1699597889,
"kind": 10000, "kind": 10000,
"tags": [ "tags": [
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], ["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"],
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], ["p", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"]
], ],
"content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", "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==",
...other fields "sig": "1173822c53261f8cffe7efbf43ba4a97a9198b3e402c2a1df130f42a8985a2d0d3430f4de350db184141e45ca844ab4e5364ea80f11d720e36357e1853dba6ca"
} }
``` ```
### A _curation set_ of articles and notes about yaks
## 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, "id": "567b41fc9060c758c4216fe5f8d3df7c57daad7ae757fa4606f0c39d4dd220ef",
"pubkey": "d6dc95542e18b8b7aec2f14610f55c335abebec76f3db9e58c254661d0593a0c",
"created_at": 1695327657,
"kind": 30004,
"tags": [ "tags": [
["d", "nostr"], ["d", "jvdy9i4"],
["p", "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d"], ["name", "Yaks"],
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], ["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"],
["e", "d78ba0d5dce22bfff9db0a9e996c9ef27e2c91051de0c4e1da340e0326b4941e"]
], ],
"content": "VezuSvWak++ASjFMRqBPWS3mK5pZ0vRLL325iuIL4S+r8n9z+DuMau5vMElz1tGC/UqCDmbzE2kwplafaFo/FnIZMdEj4pdxgptyBV1ifZpH3TEF6OMjEtqbYRRqnxgIXsuOSXaerWgpi0pm+raHQPseoELQI/SZ1cvtFqEUCXdXpa5AYaSd+quEuthAEw7V1jP+5TDRCEC8jiLosBVhCtaPpLcrm8HydMYJ2XB6Ixs=?iv=/rtV49RFm0XyFEwG62Eo9A==", "content": "",
...other fields "sig": "a9a4e2192eede77e6c9d24ddfab95ba3ff7c03fbd07ad011fff245abea431fb4d3787c2d04aad001cb039cb8de91d83ce30e9a94f82ac3c5a2372aa1294a96bd"
} }
``` ```
Lets say a user wants to create a 'Categorized Bookmarks' list of `bookmarks` and has keys: ## Encryption process pseudocode
```
priv: fb505c65d4df950f5d28c9e4d285ee12ffaf315deef1fc24e3c7cd1e7e35f2b1
pub: b1a5c93edcc8d586566fde53a20bdb50049a97b15483cb763854e57016e0fa3d
```
The user wants to publicly include these bookmarks:
```json ```scala
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"], val private_items = [
["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd", "wss://nostr.example.com"], ["p", "07caba282f76441955b695551c3c5c742e5b9202a3784780f8086fdcdc1da3a9"],
["r", "https://github.com/nostr-protocol/nostr", "Nostr repository"], ["a", "a55c15f5e41d5aebd236eca5e0142789c5385703f1a7485aa4b38d94fd18dcc4"],
```
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"],
] ]
val base64blob = nip04.encrypt(json.encode_to_string(private_items))
event.content = base64blob
``` ```
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.

30
53.md
View File

@@ -6,17 +6,17 @@ Live Activities
`draft` `optional` `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. 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. 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: For example:
```js ```json
{ {
"kind": 30311, "kind": 30311,
"tags": [ "tags": [
@@ -38,7 +38,7 @@ For example:
["relays", "wss://one.com", "wss://two.com", ...] ["relays", "wss://one.com", "wss://two.com", ...]
], ],
"content": "", "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. 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. 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. 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. 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": "<Unix timestamp in seconds>",
"kind": 1311, "kind": 1311,
"tags": [ "tags": [
["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "root"], ["a", "30311:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>", "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). 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 ```json
{ {
@@ -107,7 +105,7 @@ Live Streaming
} }
``` ```
Live Streaming chat message ### Live Streaming chat message
```json ```json
{ {

1
56.md
View File

@@ -1,4 +1,3 @@
NIP-56 NIP-56
====== ======

48
72.md
View File

@@ -10,16 +10,14 @@ The goal of this NIP is to create moderator-approved public communities around a
# Community Definition # 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 ```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": <Unix timestamp in seconds>, "created_at": <Unix timestamp in seconds>,
"kind": 34550, "kind": 34550,
"tags": [ "tags": [
["d", "<Community name>"], ["d", "<community-d-identifier>"],
["description", "<Community description>"], ["description", "<Community description>"],
["image", "<Community image url>", "<Width>x<Height>"], ["image", "<Community image url>", "<Width>x<Height>"],
@@ -35,24 +33,23 @@ The goal of this NIP is to create moderator-approved public communities around a
["relay", "<relay where to send and receive requests>", "requests"], ["relay", "<relay where to send and receive requests>", "requests"],
["relay", "<relay where to send and receive approvals>", "approvals"], ["relay", "<relay where to send and receive approvals>", "approvals"],
["relay", "<relay where to post requests to and fetch approvals from>"] ["relay", "<relay where to post requests to and fetch approvals from>"]
] ],
...
} }
``` ```
# New Post Request # 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 ```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": <Unix timestamp in seconds>,
"kind": 1, "kind": 1,
"tags": [ "tags": [
["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
], ],
"content": "<My content>" "content": "hello world",
...
} }
``` ```
@@ -64,17 +61,16 @@ The post-approval event MUST include `a` tags of the communities the moderator i
```json ```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>", "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"created_at": <Unix timestamp in seconds>,
"kind": 4550, "kind": 4550,
"tags": [ "tags": [
["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], ["a", "34550:<event-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"],
["e", "<Post Request ID>", "<Optional relay url>"], ["e", "<post-id>", "<optional-relay-url>"],
["p", "<Post Request Author ID>", "<Optional relay url>"], ["p", "<port-author-pubkey>", "<optional-relay-url>"],
["k", "<New Post Request kind>"], ["k", "<post-request-kind>"]
], ],
"content": "<New Post Request JSON>" "content": "<the full approved event, JSON-encoded>",
...
} }
``` ```
@@ -90,12 +86,16 @@ Community clients SHOULD display posts that have been approved by at least 1 mod
The following filter displays the approved posts. The following filter displays the approved posts.
```js ```json
{ [
"authors": ["<Author pubkey>", "<Moderator1 pubkey>", "<Moderator2 pubkey>", "<Moderator3 pubkey>", ...], "REQ",
"kinds": [4550], "_",
"#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"], {
} "authors": ["<owner-pubkey>", "<moderator1-pubkey>", "<moderator2-pubkey>", "<moderator3-pubkey>", ...],
"kinds": [4550],
"#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"],
}
]
``` ```
Clients MAY hide approvals by blocked moderators at the user's request. Clients MAY hide approvals by blocked moderators at the user's request.

17
75.md
View File

@@ -1,6 +1,8 @@
# NIP-75 NIP-75
======
## Zap Goals Zap Goals
---------
`draft` `optional` `draft` `optional`
@@ -27,7 +29,7 @@ Example event:
["amount", "210000"], ["amount", "210000"],
], ],
"content": "Nostrasia travel expenses", "content": "Nostrasia travel expenses",
...other fields ...
``` ```
The following tags are OPTIONAL. The following tags are OPTIONAL.
@@ -43,7 +45,8 @@ The following tags are OPTIONAL.
["closed_at", "<unix timestamp in seconds>"], ["closed_at", "<unix timestamp in seconds>"],
], ],
"content": "Nostrasia travel expenses", "content": "Nostrasia travel expenses",
...other fields ...
}
``` ```
The goal MAY include an `r` or `a` tag linking to a URL or parameterized replaceable event. 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 ```json
{ {
"kind": 3XXXX, ...
"kind": 3xxxx,
"tags": [ "tags": [
... ...
["goal", "<event id>", "<Relay URL (optional)>"], ["goal", "<event id>", "<Relay URL (optional)>"],
], ],
...other fields ...
}
``` ```
## Client behavior ## Client behavior

13
84.md
View File

@@ -27,11 +27,16 @@ useful when highlighting non-nostr content for which the client might be able to
last value of the tag. last value of the tag.
```json ```json
[ "p", "<pubkey-hex>", "<relay-url>", "author" ], {
[ "p", "<pubkey-hex>", "<relay-url>", "author" ], "tags": [
[ "p", "<pubkey-hex>", "<relay-url>", "editor" ], ["p", "<pubkey-hex>", "<relay-url>", "author"],
["p", "<pubkey-hex>", "<relay-url>", "author"],
["p", "<pubkey-hex>", "<relay-url>", "editor"]
],
...
}
``` ```
### Context ### Context
Clients MAY include a `context` tag, useful when the highlight is a subset of a paragraph and displaying the 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.

95
89.md
View File

@@ -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. This NIP describes `kind:31989` and `kind:31990`: a way to discover applications that can handle unknown event-kinds.
## Rationale ## Rationale
Nostr's discoverability and transparent event interaction is one of its most interesting/novel mechanics. 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. 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 ### Parties involved
There are three actors to this workflow: 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) * 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 * 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` * Queries for `kind:31989` and, based on results, queries for `kind:31990`
# Events ## Events
## Recommendation event ### Recommendation event
```json ```json
{ {
"kind": 31989, "kind": 31989,
"pubkey": <recommender-user-pubkey>, "pubkey": <recommender-user-pubkey>,
"tags": [ "tags": [
[ "d", <supported-event-kind> ], ["d", <supported-event-kind>],
[ "a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios" ], ["a", "31990:app1-pubkey:<d-identifier>", "wss://relay1", "ios"],
[ "a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web" ] ["a", "31990:app2-pubkey:<d-identifier>", "wss://relay2", "web"]
] ]
} }
``` ```
@@ -47,70 +49,83 @@ The third value of the tag SHOULD be the platform where this recommendation migh
## Handler information ## Handler information
```json ```json
{ {
"kind": 31990, "kind": 31990,
"pubkey": <pubkey>, "pubkey": "<application-pubkey>",
"content": "<optional-kind:0-style-metadata>", "content": "<optional-kind:0-style-metadata>",
"tags": [ "tags": [
[ "d", <random-id> ], ["d", <random-id>],
[ "k", <supported-event-kind> ], ["k", <supported-event-kind>],
[ "web", "https://..../a/<bech32>", "nevent" ], ["web", "https://..../a/<bech32>", "nevent"],
[ "web", "https://..../p/<bech32>", "nprofile" ], ["web", "https://..../p/<bech32>", "nprofile"],
[ "web", "https://..../e/<bech32>" ], ["web", "https://..../e/<bech32>"],
[ "ios", ".../<bech32>" ] ["ios", ".../<bech32>"]
] ]
} }
``` ```
* `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.) * `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`. * `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: 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. * 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. * 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. * `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. 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. 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.
# User flow ## 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:<d-identifier>", "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. 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). 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. 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. 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 ```json
{ {
"kind": 31989, "kind": 31989,
"tags": [ "tags": [
[ "d", "31337" ], ["d", "31337"],
[ "a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web" ] ["a", "31990:1743058db7078661b94aaf4286429d97ee5257d14a86d6bfa54cb0482b876fb0:abcd", <relay-url>, "web"]
] ],
...
} }
``` ```
## User B interacts with a `kind:31337`-handler ### User B interacts with a `kind:31337`-handler
User B might see in their timeline an event referring to a `kind:31337` event User B might see in their timeline an event referring to a `kind:31337` event (e.g. a `kind:1` tagging a `kind:31337`).
(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 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`:
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", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']` ```json
["REQ", <id>, '[{ "kinds": [31989], "#d": ["31337"], 'authors': [<user>, <users-contact-list>] }]']
```
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, 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. 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` ### 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. 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", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']` ```json
["REQ", <id>, '[{ "kinds": [31990], "#k": [<desired-event-kind>], 'authors': [...] }]']
```

149
90.md
View File

@@ -13,11 +13,11 @@ Money in, data out.
## Kinds ## Kinds
This NIP reserves the range `5000-7000` for data vending machine use. This NIP reserves the range `5000-7000` for data vending machine use.
| Kind | Description | | Kind | Description |
| ---- | ----------- | | ---- | ----------- |
| 5000-5999 | Job request kinds | | 5000-5999 | Job request kinds |
| 6000-6999 | Job result | | 6000-6999 | Job result |
| 7000 | Job feedback | | 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`). 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 * `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 * `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 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 ```json
[ [
[ "i", "what is the capital of France? ", "text" ], ["i", "what is the capital of France? ", "text"],
[ "param", "model", "LLaMA-2" ], ["param", "model", "LLaMA-2"],
[ "param", "max_tokens", "512" ], ["param", "max_tokens", "512"],
[ "param", "temperature", "0.5" ], ["param", "temperature", "0.5"],
[ "param", "top-k", "50" ], ["param", "top-k", "50"],
[ "param", "top-p", "0.7" ], ["param", "top-p", "0.7"],
[ "param", "frequency_penalty", "1" ] ["param", "frequency_penalty", "1"]
] ]
``` ```
This param data will be encrypted and added to the `content` field and `p` tag should be present This param data will be encrypted and added to the `content` field and `p` tag should be present
```
"content": "BE2Y4xvS6HIY7TozIgbEl3sAHkdZoXyLRRkZv4fLPh3R7LtviLKAJM5qpkC7D6VtMbgIt4iNcMpLtpo...",
"tags": [
["p", "04f74530a6ede6b24731b976b8e78fb449ea61f40ff10e3d869a3030c4edc91f"],
["encrypted"]
]
```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 ```json
{ {
"pubkey": "<service-provider pubkey>", "pubkey": "<service-provider pubkey>",
"content": "<payload>", "content": "<payload>",
"kind": 6xxx, "kind": 6xxx,
"tags": [ "tags": [
[ "request", "<job-request>" ], ["request", "<job-request>"],
[ "e", "<job-request-id>", "<relay-hint>" ], ["e", "<job-request-id>", "<relay-hint>"],
[ "i", "<input-data>" ], ["i", "<input-data>"],
[ "p", "<customer's-pubkey>" ], ["p", "<customer's-pubkey>"],
[ "amount", "requested-payment-amount", "<optional-bolt11>" ] ["amount", "requested-payment-amount", "<optional-bolt11>"]
] ],
...
} }
``` ```
@@ -123,38 +124,40 @@ Service providers publish job results, providing the output of the job result. T
## Encrypted Output ## 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` Add a tag encrypted to mark the output content as `encrypted`
```json ```json
{ {
"pubkey": "<service-provider pubkey>", "pubkey": "<service-provider pubkey>",
"content": "<encrypted payload>", "content": "<encrypted payload>",
"kind": 6xxx, "kind": 6xxx,
"tags": [ "tags": [
[ "request", "<job-request>" ], ["request", "<job-request>"],
[ "e", "<job-request-id>", "<relay-hint>" ], ["e", "<job-request-id>", "<relay-hint>"],
[ "p", "<customer's-pubkey>" ], ["p", "<customer's-pubkey>"],
[ "amount", "requested-payment-amount", "<optional-bolt11>" ], ["amount", "requested-payment-amount", "<optional-bolt11>"],
["encrypted"] ["encrypted"]
],
] ...
} }
``` ```
## Job feedback ## Job feedback
Service providers can give feedback about a job back to the customer. Service providers can give feedback about a job back to the customer.
```json ```json
{ {
"kind": 7000, "kind": 7000,
"content": "<empty-or-payload>", "content": "<empty-or-payload>",
"tags": [ "tags": [
[ "status", "<status>", "<extra-info>" ], ["status", "<status>", "<extra-info>"],
[ "amount", "requested-payment-amount", "<bolt11>" ], ["amount", "requested-payment-amount", "<bolt11>"],
[ "e", "<job-request-id>", "<relay-hint>" ], ["e", "<job-request-id>", "<relay-hint>"],
[ "p", "<customer's-pubkey>" ], ["p", "<customer's-pubkey>"],
] ],
...
} }
``` ```
@@ -162,22 +165,23 @@ Service providers can give feedback about a job back to the customer.
* `amount` tag: as defined in the [Job Result](#job-result) section. * `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. * `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 ### Job feedback status
| status | description | | status | description |
|--------|-------------| | -------- | ------------- |
| `payment-required` | Service Provider requires payment before continuing. | | `payment-required` | Service Provider requires payment before continuing. |
| `processing` | Service Provider is processing the job. | | `processing` | Service Provider is processing the job. |
| `error` | Service Provider was unable to process the job. | | `error` | Service Provider was unable to process the job. |
| `success` | Service Provider successfully processed 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. | | `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. 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 # Protocol Flow
* Customer publishes a job request (e.g. `kind:5000` speech-to-text). * 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.). * 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. * 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 # Appendix 2: Service provider discoverability
Service Providers MAY use NIP-89 announcements to advertise their support for job kinds: Service Providers MAY use NIP-89 announcements to advertise their support for job kinds:
```json ```js
{ {
"kind": 31990, "kind": 31990,
"pubkey": "<pubkey>", "pubkey": "<pubkey>",
"content": "{ "content": "{
\"name\": \"Translating DVM\", \"name\": \"Translating DVM\",
\"about\": \"I'm a DVM specialized in translating Bitcoin content.\" \"about\": \"I'm a DVM specialized in translating Bitcoin content.\"
}", }",
"tags": [ "tags": [
[ "k", "5005" ], // e.g. translation ["k", "5005"], // e.g. translation
[ "t", "bitcoin" ] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains" ["t", "bitcoin"] // e.g. optionally advertises it specializes in bitcoin audio transcription that won't confuse "Drivechains" with "Ridechains"
] ],
...
} }
``` ```

57
93.md Normal file
View File

@@ -0,0 +1,57 @@
NIP-93
======
Alternative URLs
----------------
Whenever there is a URL linked to in an event, alternative versions of that same URL can be given as `alturl` tags in that same event. For example:
```json
{
"kind": 1,
"content": "I just painted this: https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
"tags": [
[
"alturl",
"https://www.foundmyself.com/gallery/albums/userpics/55231/qs170gzrh0by7w0ftxaas76tx2r7vb.jpg",
"http://images5.fanpop.com/image/photos/31600000/The-Starry-Night-by-Vincent-van-Gogh-1889-fine-art-31674050-2560-2027.jpg",
"https://www.paintingmania.com/arts/vincent-van-gogh/large/starry-night-6_2843.jpg?version=09.12.13"
]
],
...
}
```
The second element in the tag is the original URL that is in the content, the remaining elements are alternative sources for the same content.
Alternative URLs do not have to contain exactly the same content, byte-for-byte.
## Fixing other people's events
When someone else publishes an event containing URLs, other people can reference it in an event that adds alternative URLs for them, thus preventing the original event from losing its meaning once its referenced URL becomes inaccessible.
For example, in response to an event
```json
{
"id": "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076",
"kind": 1,
"content": "I just painted this: https://wallpapercave.com/wp/wp5960277.jpg",
...
}
```
Other people (or the same person) could publish events of kind `4001` like this:
```json
{
"kind": 4001,
"tags": [
["alt", "alternative image for event ad77..."],
["e", "ad777844308977e54867c64aa0a425e15f29618105080c8c33c5a00e9198a076"],
["alturl", "https://wallpapercave.com/wp/wp5960277.jpg", "https://wallpapercave.com/wp/wp5960312.jpg"]
]
}
```
Then clients, when finding out that the original URL of the event is no longer available, could try to load an alternative from one of the `kind:4001` events that reference the original one. They should prioritize replacements from the original author and then use some kind of heuristics to prevent misleading replacements (only load `kind:4001` events from trustworthy friends or friends of the original author, for example).

7
94.md
View File

@@ -28,9 +28,6 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
```json ```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": <unix timestamp in seconds>,
"kind": 1063, "kind": 1063,
"tags": [ "tags": [
["url",<string with URI of file>], ["url",<string with URI of file>],
@@ -47,8 +44,8 @@ This NIP specifies the use of the `1063` event type, having in `content` a descr
["summary", <excerpt>], ["summary", <excerpt>],
["alt", <description>] ["alt", <description>]
], ],
"content": <caption>, "content": "<caption>",
"sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> ...
} }
``` ```

28
98.md
View File

@@ -2,7 +2,7 @@ NIP-98
====== ======
HTTP Auth HTTP Auth
------------------------- ---------
`draft` `optional` `draft` `optional`
@@ -24,22 +24,16 @@ The following tags MUST be included.
Example event: Example event:
```json ```json
{ {
"id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734", "id": "fe964e758903360f28d8424d092da8494ed207cba823110be3a57dfe4b578734",
"pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed", "pubkey": "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed",
"content": "", "content": "",
"kind": 27235, "kind": 27235,
"created_at": 1682327852, "created_at": 1682327852,
"tags": [ "tags": [
[ ["u", "https://api.snort.social/api/v1/n5sp/list"],
"u", ["method", "GET"]
"https://api.snort.social/api/v1/n5sp/list" ],
], "sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184"
[
"method",
"GET"
]
],
"sig": "5ed9d8ec958bc854f997bdc24ac337d005af372324747efe4a00e24f4c30437ff4dd8308684bed467d9d6be3e5a517bb43b1732cc7d33949a3aaf86705c22184"
} }
``` ```

6
99.md
View File

@@ -1,6 +1,8 @@
# NIP-99 NIP-99
======
## Classified Listings Classified Listings
-------------------
`draft` `optional` `draft` `optional`

166
README.md
View File

@@ -1,6 +1,7 @@
# NIPs # NIPs
NIPs stand for **Nostr Implementation Possibilities**. 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. 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) - [Relay to Client](#relay-to-client)
- [Standardized Tags](#standardized-tags) - [Standardized Tags](#standardized-tags)
- [Criteria for acceptance of NIPs](#criteria-for-acceptance-of-nips) - [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) - [License](#license)
--- ---
@@ -74,66 +76,81 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
- [NIP-99: Classified Listings](99.md) - [NIP-99: Classified Listings](99.md)
## Event Kinds ## Event Kinds
| kind | description | NIP | | kind | description | NIP |
| ------------- | -------------------------- | ----------- | | ------------- | -------------------------- | ----------- |
| `0` | Metadata | [1](01.md) | | `0` | Metadata | [1](01.md) |
| `1` | Short Text Note | [1](01.md) | | `1` | Short Text Note | [1](01.md) |
| `2` | Recommend Relay | | | `2` | Recommend Relay | |
| `3` | Contacts | [2](02.md) | | `3` | Contacts | [2](02.md) |
| `4` | Encrypted Direct Messages | [4](04.md) | | `4` | Encrypted Direct Messages | [4](04.md) |
| `5` | Event Deletion | [9](09.md) | | `5` | Event Deletion | [9](09.md) |
| `6` | Repost | [18](18.md) | | `6` | Repost | [18](18.md) |
| `7` | Reaction | [25](25.md) | | `7` | Reaction | [25](25.md) |
| `8` | Badge Award | [58](58.md) | | `8` | Badge Award | [58](58.md) |
| `16` | Generic Repost | [18](18.md) | | `16` | Generic Repost | [18](18.md) |
| `40` | Channel Creation | [28](28.md) | | `40` | Channel Creation | [28](28.md) |
| `41` | Channel Metadata | [28](28.md) | | `41` | Channel Metadata | [28](28.md) |
| `42` | Channel Message | [28](28.md) | | `42` | Channel Message | [28](28.md) |
| `43` | Channel Hide Message | [28](28.md) | | `43` | Channel Hide Message | [28](28.md) |
| `44` | Channel Mute User | [28](28.md) | | `44` | Channel Mute User | [28](28.md) |
| `1063` | File Metadata | [94](94.md) | | `1063` | File Metadata | [94](94.md) |
| `1311` | Live Chat Message | [53](53.md) | | `1311` | Live Chat Message | [53](53.md) |
| `1040` | OpenTimestamps | [03](03.md) | | `1040` | OpenTimestamps | [03](03.md) |
| `1971` | Problem Tracker | [1971](https://github.com/nostrocket/NIPS/blob/main/Problems.md) | | `1971` | Problem Tracker | [nostrocket-1971][nostrocket-1971] |
| `1984` | Reporting | [56](56.md) | | `1984` | Reporting | [56](56.md) |
| `1985` | Label | [32](32.md) | | `1985` | Label | [32](32.md) |
| `4550` | Community Post Approval | [72](72.md) | | `4001` | URL Alternative | [93](93.md) |
| `5000`-`5999` | Job Request | [90](90.md) | | `4550` | Community Post Approval | [72](72.md) |
| `6000`-`6999` | Job Result | [90](90.md) | | `5000`-`5999` | Job Request | [90](90.md) |
| `7000` | Job Feedback | [90](90.md) | | `6000`-`6999` | Job Result | [90](90.md) |
| `9041` | Zap Goal | [75](75.md) | | `7000` | Job Feedback | [90](90.md) |
| `9734` | Zap Request | [57](57.md) | | `9041` | Zap Goal | [75](75.md) |
| `9735` | Zap | [57](57.md) | | `9734` | Zap Request | [57](57.md) |
| `9802` | Highlights | [84](84.md) | | `9735` | Zap | [57](57.md) |
| `10000` | Mute List | [51](51.md) | | `9802` | Highlights | [84](84.md) |
| `10001` | Pin List | [51](51.md) | | `10000` | Mute list | [51](51.md) |
| `10002` | Relay List Metadata | [65](65.md) | | `10001` | Pin list | [51](51.md) |
| `13194` | Wallet Info | [47](47.md) | | `10002` | Relay List Metadata | [65](65.md) |
| `22242` | Client Authentication | [42](42.md) | | `10003` | Bookmark list | [51](51.md) |
| `23194` | Wallet Request | [47](47.md) | | `10004` | Communities list | [51](51.md) |
| `23195` | Wallet Response | [47](47.md) | | `10005` | Public chats list | [51](51.md) |
| `24133` | Nostr Connect | [46](46.md) | | `10006` | Blocked relays list | [51](51.md) |
| `27235` | HTTP Auth | [98](98.md) | | `10007` | Search relays list | [51](51.md) |
| `30000` | Categorized People List | [51](51.md) | | `10015` | Interests list | [51](51.md) |
| `30001` | Categorized Bookmark List | [51](51.md) | | `10030` | User emoji list | [51](51.md) |
| `30008` | Profile Badges | [58](58.md) | | `13194` | Wallet Info | [47](47.md) |
| `30009` | Badge Definition | [58](58.md) | | `22242` | Client Authentication | [42](42.md) |
| `30017` | Create or update a stall | [15](15.md) | | `23194` | Wallet Request | [47](47.md) |
| `30018` | Create or update a product | [15](15.md) | | `23195` | Wallet Response | [47](47.md) |
| `30023` | Long-form Content | [23](23.md) | | `24133` | Nostr Connect | [46](46.md) |
| `30024` | Draft Long-form Content | [23](23.md) | | `27235` | HTTP Auth | [98](98.md) |
| `30078` | Application-specific Data | [78](78.md) | | `30000` | Follow sets | [51](51.md) |
| `30311` | Live Event | [53](53.md) | | `30001` | Generic lists | [51](51.md) |
| `30315` | User Statuses | [38](38.md) | | `30002` | Relay sets | [51](51.md) |
| `30402` | Classified Listing | [99](99.md) | | `30003` | Bookmark sets | [51](51.md) |
| `30403` | Draft Classified Listing | [99](99.md) | | `30004` | Curation sets | [51](51.md) |
| `31922` | Date-Based Calendar Event | [52](52.md) | | `30008` | Profile Badges | [58](58.md) |
| `31923` | Time-Based Calendar Event | [52](52.md) | | `30009` | Badge Definition | [58](58.md) |
| `31924` | Calendar | [52](52.md) | | `30015` | Interest sets | [51](51.md) |
| `31925` | Calendar Event RSVP | [52](52.md) | | `30030` | Emoji sets | [51](51.md) |
| `31989` | Handler recommendation | [89](89.md) | | `30017` | Create or update a stall | [15](15.md) |
| `31990` | Handler information | [89](89.md) | | `30018` | Create or update a product | [15](15.md) |
| `34550` | Community Definition | [72](72.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 ## Message types
@@ -212,21 +229,26 @@ 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. 4. There should be no more than one way of doing the same thing.
5. Other rules will be made up when necessary. 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 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.
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:
* [w3c nostr community group][w3-nostr] - [public-nostr@w3.org][mailto-w3] - requires signup 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.
* [nostr-protocol google group][nostr-google-group] - [nostr-protocol@googlegroups.com][mailto-google] - no signup required
[w3-nostr]: https://www.w3.org/community/nostr/ 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.
[mailto-w3]: mailto:public-nostr@w3.org
[nostr-google-group]: https://groups.google.com/g/nostr-protocol ## How this repository works
[mailto-google]: mailto:nostr-protocol@googlegroups.com
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 ## License
All NIPs are public domain. All NIPs are public domain.
## Contributors
<a align="center" href="https://github.com/nostr-protocol/nips/graphs/contributors">
<img src="https://contrib.rocks/image?repo=nostr-protocol/nips" />
</a>