diff options
Diffstat (limited to '22.md')
| -rw-r--r-- | 22.md | 33 |
1 files changed, 24 insertions, 9 deletions
| @@ -13,6 +13,9 @@ It uses `kind:1111` with plaintext `.content` (no HTML, Markdown, or other forma | |||
| 13 | Comments MUST point to the root scope using uppercase tag names (e.g. `K`, `E`, `A` or `I`) | 13 | Comments MUST point to the root scope using uppercase tag names (e.g. `K`, `E`, `A` or `I`) |
| 14 | and MUST point to the parent item with lowercase ones (e.g. `k`, `e`, `a` or `i`). | 14 | and MUST point to the parent item with lowercase ones (e.g. `k`, `e`, `a` or `i`). |
| 15 | 15 | ||
| 16 | Comments MUST point to the authors when one is available (i.e. tagging a nostr event). `P` for the root scope | ||
| 17 | and `p` for the author of the parent item. | ||
| 18 | |||
| 16 | ```jsonc | 19 | ```jsonc |
| 17 | { | 20 | { |
| 18 | kind: 1111, | 21 | kind: 1111, |
| @@ -23,10 +26,16 @@ and MUST point to the parent item with lowercase ones (e.g. `k`, `e`, `a` or `i` | |||
| 23 | // the root item kind | 26 | // the root item kind |
| 24 | ["K", "<root kind>"], | 27 | ["K", "<root kind>"], |
| 25 | 28 | ||
| 29 | // pubkey of the author of the root scope event | ||
| 30 | ["P", "<root-pubkey>", "relay-url-hint"], | ||
| 31 | |||
| 26 | // parent item: event addresses, event ids, or i-tags. | 32 | // parent item: event addresses, event ids, or i-tags. |
| 27 | ["<a, e, i>", "<address, id or i-value>", "<relay or web page hint>", "<parent event's pubkey, if an e tag>"], | 33 | ["<a, e, i>", "<address, id or i-value>", "<relay or web page hint>", "<parent event's pubkey, if an e tag>"], |
| 28 | // parent item kind | 34 | // parent item kind |
| 29 | ["k", "<parent comment kind>"] | 35 | ["k", "<parent comment kind>"], |
| 36 | |||
| 37 | // parent item pubkey | ||
| 38 | ["p", "<parent-pubkey>", "relay-url-hint"] | ||
| 30 | ] | 39 | ] |
| 31 | // other fields | 40 | // other fields |
| 32 | } | 41 | } |
| @@ -46,11 +55,6 @@ Their uppercase versions use the same type of values but relate to the root item | |||
| 46 | ``` | 55 | ``` |
| 47 | 56 | ||
| 48 | `p` tags SHOULD be used when mentioning pubkeys in the `.content` with [NIP-21](21.md). | 57 | `p` tags SHOULD be used when mentioning pubkeys in the `.content` with [NIP-21](21.md). |
| 49 | If the parent item is an event, a `p` tag set to the parent event's author SHOULD be added. | ||
| 50 | |||
| 51 | ```json | ||
| 52 | ["p", "<pubkey>", "<relay-url>"] | ||
| 53 | ``` | ||
| 54 | 58 | ||
| 55 | ## Examples | 59 | ## Examples |
| 56 | 60 | ||
| @@ -65,13 +69,17 @@ A comment on a blog post looks like this: | |||
| 65 | ["A", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"], | 69 | ["A", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"], |
| 66 | // the root kind | 70 | // the root kind |
| 67 | ["K", "30023"], | 71 | ["K", "30023"], |
| 72 | // author of root event | ||
| 73 | ["P", "3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289", "wss://example.relay"] | ||
| 68 | 74 | ||
| 69 | // the parent event address (same as root for top-level comments) | 75 | // the parent event address (same as root for top-level comments) |
| 70 | ["a", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"], | 76 | ["a", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"], |
| 71 | // when the parent event is replaceable or addressable, also include an `e` tag referencing its id | 77 | // when the parent event is replaceable or addressable, also include an `e` tag referencing its id |
| 72 | ["e", "5b4fc7fed15672fefe65d2426f67197b71ccc82aa0cc8a9e94f683eb78e07651", "wss://example.relay"], | 78 | ["e", "5b4fc7fed15672fefe65d2426f67197b71ccc82aa0cc8a9e94f683eb78e07651", "wss://example.relay"], |
| 73 | // the parent event kind | 79 | // the parent event kind |
| 74 | ["k", "30023"] | 80 | ["k", "30023"], |
| 81 | // author of the parent event | ||
| 82 | ["p", "3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289", "wss://example.relay"] | ||
| 75 | ] | 83 | ] |
| 76 | // other fields | 84 | // other fields |
| 77 | } | 85 | } |
| @@ -88,11 +96,14 @@ A comment on a [NIP-94](94.md) file looks like this: | |||
| 88 | ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"], | 96 | ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"], |
| 89 | // the root kind | 97 | // the root kind |
| 90 | ["K", "1063"], | 98 | ["K", "1063"], |
| 99 | // author of the root event | ||
| 100 | ["P", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"], | ||
| 91 | 101 | ||
| 92 | // the parent event id (same as root for top-level comments) | 102 | // the parent event id (same as root for top-level comments) |
| 93 | ["e", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"], | 103 | ["e", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"], |
| 94 | // the parent kind | 104 | // the parent kind |
| 95 | ["k", "1063"] | 105 | ["k", "1063"], |
| 106 | ["p", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"] | ||
| 96 | ] | 107 | ] |
| 97 | // other fields | 108 | // other fields |
| 98 | } | 109 | } |
| @@ -109,11 +120,13 @@ A reply to a comment looks like this: | |||
| 109 | ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "fd913cd6fa9edb8405750cd02a8bbe16e158b8676c0e69fdc27436cc4a54cc9a"], | 120 | ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "fd913cd6fa9edb8405750cd02a8bbe16e158b8676c0e69fdc27436cc4a54cc9a"], |
| 110 | // the root kind | 121 | // the root kind |
| 111 | ["K", "1063"], | 122 | ["K", "1063"], |
| 123 | ["P", "fd913cd6fa9edb8405750cd02a8bbe16e158b8676c0e69fdc27436cc4a54cc9a"], | ||
| 112 | 124 | ||
| 113 | // the parent event | 125 | // the parent event |
| 114 | ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://example.relay", "93ef2ebaaf9554661f33e79949007900bbc535d239a4c801c33a4d67d3e7f546"], | 126 | ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://example.relay", "93ef2ebaaf9554661f33e79949007900bbc535d239a4c801c33a4d67d3e7f546"], |
| 115 | // the parent kind | 127 | // the parent kind |
| 116 | ["k", "1111"] | 128 | ["k", "1111"], |
| 129 | ["p", "93ef2ebaaf9554661f33e79949007900bbc535d239a4c801c33a4d67d3e7f546"] | ||
| 117 | ] | 130 | ] |
| 118 | // other fields | 131 | // other fields |
| 119 | } | 132 | } |
| @@ -178,7 +191,9 @@ A reply to a podcast comment: | |||
| 178 | ["e", "80c48d992a38f9c445b943a9c9f1010b396676013443765750431a9004bdac05", "wss://example.relay", "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111"], | 191 | ["e", "80c48d992a38f9c445b943a9c9f1010b396676013443765750431a9004bdac05", "wss://example.relay", "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111"], |
| 179 | // the parent comment kind | 192 | // the parent comment kind |
| 180 | ["k", "1111"] | 193 | ["k", "1111"] |
| 194 | ["p", "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111"] | ||
| 181 | ] | 195 | ] |
| 182 | // other fields | 196 | // other fields |
| 183 | } | 197 | } |
| 184 | ``` | 198 | ``` |
| 199 | |||