1NIP-222======34Comment5-------67`draft` `optional`89A comment is a threading note always scoped to a root event or an [`I`-tag](73.md).1011It uses `kind:1111` with plaintext `.content` (no HTML, Markdown, or other formatting).1213Comments MUST point to the root scope using uppercase tag names (e.g. `K`, `E`, `A` or `I`)14and MUST point to the parent item with lowercase ones (e.g. `k`, `e`, `a` or `i`).1516Comments MUST point to the authors when one is available (i.e. tagging a nostr event). `P` for the root scope17and `p` for the author of the parent item.1819```yaml20{21 "kind": 1111,22 "content": "<comment>",23 "tags": [24 // root scope: event addresses, event ids, or I-tags.25 ["<A, E, I>", "<address, id or I-value>", "<relay or web page hint>", "<root event's pubkey, if an E tag>"],26 // the root item kind27 ["K", "<root kind>"],2829 // pubkey of the author of the root scope event30 ["P", "<root-pubkey>", "relay-url-hint"],3132 // parent item: event addresses, event ids, or i-tags.33 ["<a, e, i>", "<address, id or i-value>", "<relay or web page hint>", "<parent event's pubkey, if an e tag>"],34 // parent item kind35 ["k", "<parent comment kind>"],3637 // parent item pubkey38 ["p", "<parent-pubkey>", "relay-url-hint"]39 ]40 // other fields41}42```4344Tags `K` and `k` MUST be present to define the event kind of the root and the parent items.4546`I` and `i` tags create scopes for hashtags, geohashes, URLs, and other external identifiers.4748The possible values for `i` tags – and `k` tags, when related to an external identity – are listed on [NIP-73](73.md).49Their uppercase versions use the same type of values but relate to the root item instead of the parent one.5051`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).5253```json54["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]55```5657`p` tags SHOULD be used when mentioning pubkeys in the `.content` with [NIP-21](21.md).5859## Examples6061A comment on a blog post looks like this:6263```yaml64{65 "kind": 1111,66 "content": "Great blog post!",67 "tags": [68 // top-level comments scope to event addresses or ids69 ["A", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"],70 // the root kind71 ["K", "30023"],72 // author of root event73 ["P", "3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289", "wss://example.relay"]7475 // the parent event address (same as root for top-level comments)76 ["a", "30023:3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289:f9347ca7", "wss://example.relay"],77 // when the parent event is replaceable or addressable, also include an `e` tag referencing its id78 ["e", "5b4fc7fed15672fefe65d2426f67197b71ccc82aa0cc8a9e94f683eb78e07651", "wss://example.relay"],79 // the parent event kind80 ["k", "30023"],81 // author of the parent event82 ["p", "3c9849383bdea883b0bd16fece1ed36d37e37cdde3ce43b17ea4e9192ec11289", "wss://example.relay"]83 ]84 // other fields85}86```8788A comment on a [NIP-94](94.md) file looks like this:8990```yaml91{92 "kind": 1111,93 "content": "Great file!",94 "tags": [95 // top-level comments have the same scope and reply to addresses or ids96 ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"],97 // the root kind98 ["K", "1063"],99 // author of the root event100 ["P", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"],101102 // the parent event id (same as root for top-level comments)103 ["e", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"],104 // the parent kind105 ["k", "1063"],106 ["p", "3721e07b079525289877c366ccab47112bdff3d1b44758ca333feb2dbbbbe5bb"]107 ]108 // other fields109}110```111112A reply to a comment looks like this:113114```yaml115{116 "kind": 1111,117 "content": "This is a reply to \"Great file!\"",118 "tags": [119 // nip-94 file event id120 ["E", "768ac8720cdeb59227cf95e98b66560ef03d8bc9a90d721779e76e68fb42f5e6", "wss://example.relay", "fd913cd6fa9edb8405750cd02a8bbe16e158b8676c0e69fdc27436cc4a54cc9a"],121 // the root kind122 ["K", "1063"],123 ["P", "fd913cd6fa9edb8405750cd02a8bbe16e158b8676c0e69fdc27436cc4a54cc9a"],124125 // the parent event126 ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://example.relay", "93ef2ebaaf9554661f33e79949007900bbc535d239a4c801c33a4d67d3e7f546"],127 // the parent kind128 ["k", "1111"],129 ["p", "93ef2ebaaf9554661f33e79949007900bbc535d239a4c801c33a4d67d3e7f546"]130 ]131 // other fields132}133```134135A comment on a website's url looks like this:136137```yaml138{139 "kind": 1111,140 "content": "Nice article!",141 "tags": [142 // referencing the root url143 ["I", "https://abc.com/articles/1"],144 // the root "kind": for an url145 ["K", "web"],146147 // the parent reference (same as root for top-level comments)148 ["i", "https://abc.com/articles/1"],149 // the parent "kind": for an url150 ["k", "web"]151 ]152 // other fields153}154```155156A podcast comment example:157158```yaml159{160 "id": "80c48d992a38f9c445b943a9c9f1010b396676013443765750431a9004bdac05",161 "pubkey": "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111",162 "kind": 1111,163 "content": "This was a great episode!",164 "tags": [165 // podcast episode reference166 ["I", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f", "https://fountain.fm/episode/z1y9TMQRuqXl2awyrQxg"],167 // podcast episode type168 ["K", "podcast:item:guid"],169170 // same value as "I" tag above, because it is a top-level comment (not a reply to a comment)171 ["i", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f", "https://fountain.fm/episode/z1y9TMQRuqXl2awyrQxg"],172 ["k", "podcast:item:guid"]173 ]174 // other fields175}176```177178A reply to a podcast comment:179180```yaml181{182 "kind": 1111,183 "content": "I'm replying to the above comment.",184 "tags": [185 // podcast episode reference186 ["I", "podcast:item:guid:d98d189b-dc7b-45b1-8720-d4b98690f31f", "https://fountain.fm/episode/z1y9TMQRuqXl2awyrQxg"],187 // podcast episode type188 ["K", "podcast:item:guid"],189190 // this is a reference to the above comment191 ["e", "80c48d992a38f9c445b943a9c9f1010b396676013443765750431a9004bdac05", "wss://example.relay", "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111"],192 // the parent comment kind193 ["k", "1111"],194 ["p", "252f10c83610ebca1a059c0bae8255eba2f95be4d1d7bcfa89d7248a82d9f111"]195 ]196 // other fields197}198```