diff options
Diffstat (limited to '10.md')
| -rw-r--r-- | 10.md | 67 |
1 files changed, 36 insertions, 31 deletions
| @@ -2,49 +2,23 @@ NIP-10 | |||
| 2 | ====== | 2 | ====== |
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | On "e" and "p" tags in Text Events (kind 1). | 5 | On "e" and "p" tags in Text Events (kind 1) |
| 6 | -------------------------------------------- | 6 | ------------------------------------------- |
| 7 | 7 | ||
| 8 | `draft` `optional` | 8 | `draft` `optional` |
| 9 | 9 | ||
| 10 | ## Abstract | 10 | ## Abstract |
| 11 | This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event. | 11 | This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event. |
| 12 | 12 | ||
| 13 | ## Positional "e" tags (DEPRECATED) | ||
| 14 | >This scheme is in common use; but should be considered deprecated. | ||
| 15 | |||
| 16 | `["e", <event-id>, <relay-url>]` as per NIP-01. | ||
| 17 | |||
| 18 | Where: | ||
| 19 | |||
| 20 | * `<event-id>` is the id of the event being referenced. | ||
| 21 | * `<relay-url>` is the URL of a recommended relay associated with the reference. Many clients treat this field as optional. | ||
| 22 | |||
| 23 | **The positions of the "e" tags within the event denote specific meanings as follows**: | ||
| 24 | |||
| 25 | * No "e" tag: <br> | ||
| 26 | This event is not a reply to, nor does it refer to, any other event. | ||
| 27 | |||
| 28 | * One "e" tag: <br> | ||
| 29 | `["e", <id>]`: The id of the event to which this event is a reply. | ||
| 30 | |||
| 31 | * Two "e" tags: `["e", <root-id>]`, `["e", <reply-id>]` <br> | ||
| 32 | `<root-id>` is the id of the event at the root of the reply chain. `<reply-id>` is the id of the article to which this event is a reply. | ||
| 33 | |||
| 34 | * Many "e" tags: `["e", <root-id>]` `["e", <mention-id>]`, ..., `["e", <reply-id>]`<br> | ||
| 35 | There may be any number of `<mention-ids>`. These are the ids of events which may, or may not be in the reply chain. | ||
| 36 | They are citing from this event. `root-id` and `reply-id` are as above. | ||
| 37 | |||
| 38 | >This scheme is deprecated because it creates ambiguities that are difficult, or impossible to resolve when an event references another but is not a reply. | ||
| 39 | |||
| 40 | ## Marked "e" tags (PREFERRED) | 13 | ## Marked "e" tags (PREFERRED) |
| 41 | `["e", <event-id>, <relay-url>, <marker>]` | 14 | `["e", <event-id>, <relay-url>, <marker>, <pubkey>]` |
| 42 | 15 | ||
| 43 | Where: | 16 | Where: |
| 44 | 17 | ||
| 45 | * `<event-id>` is the id of the event being referenced. | 18 | * `<event-id>` is the id of the event being referenced. |
| 46 | * `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-URL>` field, but may instead leave it as `""`. | 19 | * `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-url>` field, but may instead leave it as `""`. |
| 47 | * `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`. | 20 | * `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`. |
| 21 | * `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event | ||
| 48 | 22 | ||
| 49 | Those marked with `"reply"` denote the id of the reply event being responded to. Those marked with `"root"` denote the root id of the reply thread being responded to. For top level replies (those replying directly to the root event), only the `"root"` marker should be used. Those marked with `"mention"` denote a quoted or reposted event id. | 23 | Those marked with `"reply"` denote the id of the reply event being responded to. Those marked with `"root"` denote the root id of the reply thread being responded to. For top level replies (those replying directly to the root event), only the `"root"` marker should be used. Those marked with `"mention"` denote a quoted or reposted event id. |
| 50 | 24 | ||
| @@ -52,6 +26,7 @@ A direct reply to the root of a thread should have a single marked "e" tag of ty | |||
| 52 | 26 | ||
| 53 | >This scheme is preferred because it allows events to mention others without confusing them with `<reply-id>` or `<root-id>`. | 27 | >This scheme is preferred because it allows events to mention others without confusing them with `<reply-id>` or `<root-id>`. |
| 54 | 28 | ||
| 29 | `<pubkey>` SHOULD be the pubkey of the author of the `e` tagged event, this is used in the outbox model to search for that event from the authors write relays where relay hints did not resolve the event. | ||
| 55 | 30 | ||
| 56 | ## The "p" tag | 31 | ## The "p" tag |
| 57 | Used in a text event contains a list of pubkeys used to record who is involved in a reply thread. | 32 | Used in a text event contains a list of pubkeys used to record who is involved in a reply thread. |
| @@ -60,3 +35,33 @@ When replying to a text event E the reply event's "p" tags should contain all of | |||
| 60 | 35 | ||
| 61 | Example: Given a text event authored by `a1` with "p" tags [`p1`, `p2`, `p3`] then the "p" tags of the reply should be [`a1`, `p1`, `p2`, `p3`] | 36 | Example: Given a text event authored by `a1` with "p" tags [`p1`, `p2`, `p3`] then the "p" tags of the reply should be [`a1`, `p1`, `p2`, `p3`] |
| 62 | in no particular order. | 37 | in no particular order. |
| 38 | |||
| 39 | ## Deprecated Positional "e" tags | ||
| 40 | |||
| 41 | This scheme is not in common use anymore and is here just to keep backward compatibility with older events on the network. | ||
| 42 | |||
| 43 | Positional `e` tags are deprecated because they create ambiguities that are difficult, or impossible to resolve when an event references another but is not a reply. | ||
| 44 | |||
| 45 | They use simple `e` tags without any marker. | ||
| 46 | |||
| 47 | `["e", <event-id>, <relay-url>]` as per NIP-01. | ||
| 48 | |||
| 49 | Where: | ||
| 50 | |||
| 51 | * `<event-id>` is the id of the event being referenced. | ||
| 52 | * `<relay-url>` is the URL of a recommended relay associated with the reference. Many clients treat this field as optional. | ||
| 53 | |||
| 54 | **The positions of the "e" tags within the event denote specific meanings as follows**: | ||
| 55 | |||
| 56 | * No "e" tag: <br> | ||
| 57 | This event is not a reply to, nor does it refer to, any other event. | ||
| 58 | |||
| 59 | * One "e" tag: <br> | ||
| 60 | `["e", <id>]`: The id of the event to which this event is a reply. | ||
| 61 | |||
| 62 | * Two "e" tags: `["e", <root-id>]`, `["e", <reply-id>]` <br> | ||
| 63 | `<root-id>` is the id of the event at the root of the reply chain. `<reply-id>` is the id of the article to which this event is a reply. | ||
| 64 | |||
| 65 | * Many "e" tags: `["e", <root-id>]` `["e", <mention-id>]`, ..., `["e", <reply-id>]`<br> | ||
| 66 | There may be any number of `<mention-ids>`. These are the ids of events which may, or may not be in the reply chain. | ||
| 67 | They are citing from this event. `root-id` and `reply-id` are as above. \ No newline at end of file | ||