diff options
| -rw-r--r-- | 01.md | 8 | ||||
| -rw-r--r-- | 03.md | 6 | ||||
| -rw-r--r-- | 11.md | 14 | ||||
| -rw-r--r-- | 21.md | 20 | ||||
| -rw-r--r-- | 28.md | 8 | ||||
| -rw-r--r-- | 33.md | 9 | ||||
| -rw-r--r-- | README.md | 17 |
7 files changed, 62 insertions, 20 deletions
| @@ -16,8 +16,8 @@ The only object type that exists is the `event`, which has the following format | |||
| 16 | 16 | ||
| 17 | ```json | 17 | ```json |
| 18 | { | 18 | { |
| 19 | "id": <32-bytes sha256 of the the serialized event data> | 19 | "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data> |
| 20 | "pubkey": <32-bytes hex-encoded public key of the event creator>, | 20 | "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, |
| 21 | "created_at": <unix timestamp in seconds>, | 21 | "created_at": <unix timestamp in seconds>, |
| 22 | "kind": <integer>, | 22 | "kind": <integer>, |
| 23 | "tags": [ | 23 | "tags": [ |
| @@ -66,8 +66,8 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th | |||
| 66 | "kinds": <a list of a kind numbers>, | 66 | "kinds": <a list of a kind numbers>, |
| 67 | "#e": <a list of event ids that are referenced in an "e" tag>, | 67 | "#e": <a list of event ids that are referenced in an "e" tag>, |
| 68 | "#p": <a list of pubkeys that are referenced in a "p" tag>, | 68 | "#p": <a list of pubkeys that are referenced in a "p" tag>, |
| 69 | "since": <a timestamp, events must be newer than this to pass>, | 69 | "since": <an integer unix timestamp, events must be newer than this to pass>, |
| 70 | "until": <a timestamp, events must be older than this to pass>, | 70 | "until": <an integer unix timestamp, events must be older than this to pass>, |
| 71 | "limit": <maximum number of events to be returned in the initial query> | 71 | "limit": <maximum number of events to be returned in the initial query> |
| 72 | } | 72 | } |
| 73 | ``` | 73 | ``` |
| @@ -10,11 +10,11 @@ When there is an OTS available it MAY be included in the existing event body und | |||
| 10 | 10 | ||
| 11 | ``` | 11 | ``` |
| 12 | { | 12 | { |
| 13 | id: ..., | 13 | "id": ..., |
| 14 | kind: ..., | 14 | "kind": ..., |
| 15 | ..., | 15 | ..., |
| 16 | ..., | 16 | ..., |
| 17 | ots: <base64-encoded OTS file data> | 17 | "ots": <base64-encoded OTS file data> |
| 18 | } | 18 | } |
| 19 | ``` | 19 | ``` |
| 20 | 20 | ||
| @@ -12,13 +12,13 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application | |||
| 12 | 12 | ||
| 13 | ```json | 13 | ```json |
| 14 | { | 14 | { |
| 15 | name: <string identifying relay>, | 15 | "name": <string identifying relay>, |
| 16 | description: <string with detailed information>, | 16 | "description": <string with detailed information>, |
| 17 | pubkey: <administrative contact pubkey>, | 17 | "pubkey": <administrative contact pubkey>, |
| 18 | contact: <administrative alternate contact>, | 18 | "contact": <administrative alternate contact>, |
| 19 | supported_nips: <a list of NIP numbers supported by the relay>, | 19 | "supported_nips": <a list of NIP numbers supported by the relay>, |
| 20 | software: <string identifying relay software URL>, | 20 | "software": <string identifying relay software URL>, |
| 21 | version: <string version identifier> | 21 | "version": <string version identifier> |
| 22 | } | 22 | } |
| 23 | ``` | 23 | ``` |
| 24 | 24 | ||
| @@ -0,0 +1,20 @@ | |||
| 1 | NIP-21 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | `nostr:` URL scheme | ||
| 5 | ------------------- | ||
| 6 | |||
| 7 | `draft` `optional` `author:fiatjaf` | ||
| 8 | |||
| 9 | This NIP standardizes the usage of a common URL scheme for maximum interoperability and openness in the network. | ||
| 10 | |||
| 11 | The scheme is `nostr:`. | ||
| 12 | |||
| 13 | The identifiers that come after are expected to be the same as those defined in NIP-19 (except `nsec`). | ||
| 14 | |||
| 15 | ## Examples | ||
| 16 | |||
| 17 | - `nostr:npub1sn0wdenkukak0d9dfczzeacvhkrgz92ak56egt7vdgzn8pv2wfqqhrjdv9` | ||
| 18 | - `nostr:nprofile1qqsrhuxx8l9ex335q7he0f09aej04zpazpl0ne2cgukyawd24mayt8gpp4mhxue69uhhytnc9e3k7mgpz4mhxue69uhkg6nzv9ejuumpv34kytnrdaksjlyr9p` | ||
| 19 | - `nostr:note1fntxtkcy9pjwucqwa9mddn7v03wwwsu9j330jj350nvhpky2tuaspk6nqc` | ||
| 20 | - `nostr:nevent1qqstna2yrezu5wghjvswqqculvvwxsrcvu7uc0f78gan4xqhvz49d9spr3mhxue69uhkummnw3ez6un9d3shjtn4de6x2argwghx6egpr4mhxue69uhkummnw3ez6ur4vgh8wetvd3hhyer9wghxuet5nxnepm` | ||
| @@ -54,7 +54,7 @@ Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay. | |||
| 54 | ```json | 54 | ```json |
| 55 | { | 55 | { |
| 56 | "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", | 56 | "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", |
| 57 | "tags": [["e", <channel_create_event_id> <relay-url>]], | 57 | "tags": [["e", <channel_create_event_id>, <relay-url>]], |
| 58 | ... | 58 | ... |
| 59 | } | 59 | } |
| 60 | ``` | 60 | ``` |
| @@ -73,7 +73,7 @@ Root message: | |||
| 73 | ```json | 73 | ```json |
| 74 | { | 74 | { |
| 75 | "content": <string>, | 75 | "content": <string>, |
| 76 | "tags": [["e", <kind_40_event_id> <relay-url> "root"]], | 76 | "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]], |
| 77 | ... | 77 | ... |
| 78 | } | 78 | } |
| 79 | ``` | 79 | ``` |
| @@ -84,8 +84,8 @@ Reply to another message: | |||
| 84 | { | 84 | { |
| 85 | "content": <string>, | 85 | "content": <string>, |
| 86 | "tags": [ | 86 | "tags": [ |
| 87 | ["e", <kind_42_event_id> <relay-url> "reply"], | 87 | ["e", <kind_42_event_id>, <relay-url>, "reply"], |
| 88 | ["p", <pubkey> <relay-url>], | 88 | ["p", <pubkey>, <relay-url>], |
| 89 | ... | 89 | ... |
| 90 | ], | 90 | ], |
| 91 | ... | 91 | ... |
| @@ -10,10 +10,12 @@ This NIP adds a new event range that allows for replacement of events that have | |||
| 10 | 10 | ||
| 11 | Implementation | 11 | Implementation |
| 12 | -------------- | 12 | -------------- |
| 13 | A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. | 13 | The value of a tag is defined as the first parameter of a tag after the tag name. |
| 14 | |||
| 15 | A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. | ||
| 14 | Upon a parameterized replaceable event with a newer timestamp than the currently known latest | 16 | Upon a parameterized replaceable event with a newer timestamp than the currently known latest |
| 15 | replaceable event with the same kind and first `d` tag value being received, the old event | 17 | replaceable event with the same kind and first `d` tag value being received, the old event |
| 16 | SHOULD be discarded and replaced with the newer event. | 18 | SHOULD be discarded and replaced with the newer event. |
| 17 | A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the | 19 | A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the |
| 18 | value as an empty string. Events from the same author with any of the following `tags` | 20 | value as an empty string. Events from the same author with any of the following `tags` |
| 19 | replace each other: | 21 | replace each other: |
| @@ -24,6 +26,9 @@ replace each other: | |||
| 24 | * `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered | 26 | * `"tags":[["d",""],["d","not empty"]]`: only first `d` tag is considered |
| 25 | * `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered | 27 | * `"tags":[["d"],["d","some value"]]`: only first `d` tag is considered |
| 26 | * `"tags":[["e"]]`: same as no tags | 28 | * `"tags":[["e"]]`: same as no tags |
| 29 | * `"tags":[["d","test","1"]]`: only the value is considered (`test`) | ||
| 30 | |||
| 31 | Clients SHOULD NOT use `d` tags with multiple values and SHOULD include the `d` tag even if it has no value to allow querying using the `#d` filter. | ||
| 27 | 32 | ||
| 28 | Client Behavior | 33 | Client Behavior |
| 29 | --------------- | 34 | --------------- |
| @@ -20,6 +20,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh | |||
| 20 | - [NIP-16: Event Treatment](16.md) | 20 | - [NIP-16: Event Treatment](16.md) |
| 21 | - [NIP-19: bech32-encoded entities](19.md) | 21 | - [NIP-19: bech32-encoded entities](19.md) |
| 22 | - [NIP-20: Command Results](20.md) | 22 | - [NIP-20: Command Results](20.md) |
| 23 | - [NIP-21: `nostr:` URL scheme](21.md) | ||
| 23 | - [NIP-22: Event created_at Limits](22.md) | 24 | - [NIP-22: Event created_at Limits](22.md) |
| 24 | - [NIP-25: Reactions](25.md) | 25 | - [NIP-25: Reactions](25.md) |
| 25 | - [NIP-26: Delegated Event Signing](26.md) | 26 | - [NIP-26: Delegated Event Signing](26.md) |
| @@ -49,6 +50,8 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh | |||
| 49 | | 22242 | Client Authentication | [42](42.md) | | 50 | | 22242 | Client Authentication | [42](42.md) | |
| 50 | | 10000-19999 | Replaceable Events Reserved | [16](16.md) | | 51 | | 10000-19999 | Replaceable Events Reserved | [16](16.md) | |
| 51 | | 20000-29999 | Ephemeral Events Reserved | [16](16.md) | | 52 | | 20000-29999 | Ephemeral Events Reserved | [16](16.md) | |
| 53 | | 30000-39999 | Param. Repl. Events Reserved| [33](33.md) | | ||
| 54 | |||
| 52 | 55 | ||
| 53 | 56 | ||
| 54 | ## Message types | 57 | ## Message types |
| @@ -74,6 +77,20 @@ Please update these lists when proposing NIPs introducing new event kinds. | |||
| 74 | 77 | ||
| 75 | When experimenting with kinds, keep in mind the classification introduced by [NIP-16](16.md). | 78 | When experimenting with kinds, keep in mind the classification introduced by [NIP-16](16.md). |
| 76 | 79 | ||
| 80 | ## Standardized Tags | ||
| 81 | |||
| 82 | | name | value | other parameters | NIP | | ||
| 83 | | ---------- | ----------------------- | ----------------- | ------------------------ | | ||
| 84 | | e | event id (hex) | relay URL, marker | [1](01.md), [10](10.md) | | ||
| 85 | | p | pubkey (hex) | relay URL | [1](01.md) | | ||
| 86 | | r | a reference (URL, etc) | | [12](12.md) | | ||
| 87 | | t | hashtag | | [12](12.md) | | ||
| 88 | | g | geohash | | [12](12.md) | | ||
| 89 | | nonce | random | | [13](13.md) | | ||
| 90 | | subject | subject | | [14](14.md) | | ||
| 91 | | d | identifier | | [33](33.md) | | ||
| 92 | | expiration | unix timestamp (string) | | [40](40.md) | | ||
| 93 | |||
| 77 | ## Criteria for acceptance of NIPs | 94 | ## Criteria for acceptance of NIPs |
| 78 | 95 | ||
| 79 | 1. They should be implemented in at least two clients and one relay -- when applicable. | 96 | 1. They should be implemented in at least two clients and one relay -- when applicable. |