diff options
| author | Vitor Pamplona <vitor@vitorpamplona.com> | 2024-12-19 10:15:46 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-19 10:15:46 -0500 |
| commit | f7d97f3f40dc6677e6f996ffff431142ffe05810 (patch) | |
| tree | 2eaa8c8628cc9a4b05811ed3869e21221fd85307 /10.md | |
| parent | d5b77b6d7348061cd0f16adc35e4d02a3a0b7380 (diff) | |
| parent | 561059ff85c171b87a12b8381b724b4afc569a97 (diff) | |
Merge branch 'master' into draft-event
Diffstat (limited to '10.md')
| -rw-r--r-- | 10.md | 63 |
1 files changed, 33 insertions, 30 deletions
| @@ -2,48 +2,21 @@ 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>, <pubkey>]` | 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"`. |
| 48 | * `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event | 21 | * `<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event |
| 49 | 22 | ||
| @@ -62,3 +35,33 @@ When replying to a text event E the reply event's "p" tags should contain all of | |||
| 62 | 35 | ||
| 63 | 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`] |
| 64 | 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 | ||