You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The `e` tag, used to refer to an event: `["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>, <32-bytes lowercase hex of the author's pubkey, optional>]`
86
+
- The `p` tag, used to refer to another user: `["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>]`
87
+
- The `a` tag, used to refer to an addressable or replaceable event
88
+
- for an addressable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>", <recommended relay URL, optional>]`
89
+
- for a normal replaceable event: `["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:", <recommended relay URL, optional>]` (note: include the trailing colon)
Kinds specify how clients should interpret the meaning of each event and the other fields of each event (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002). Each NIP may define the meaning of a set of kinds that weren't defined elsewhere. [NIP-10](10.md), for instance, specifies the `kind:1` text note for social media applications.
103
+
104
+
This NIP defines one basic kind:
105
+
106
+
-`0`: **user metadata**: the `content` is set to a stringified JSON object `{name: <nickname or full name>, about: <short bio>, picture: <url of the image>}` describing the user who created the event. [Extra metadata fields](24.md#kind-0) may be set. A relay may delete older events once it gets a new one for the same pubkey.
The `limit` property of a filter is only valid for the initial query and MUST be ignored afterwards. When `limit: n` is present it is assumed that the events returned in the initial query will be the last `n` events ordered by the `created_at`. Newer events should appear first, and in the case of ties the event with the lowest id (first in lexical order) should be first. Relays SHOULD use the `limit` value to guide how many events are returned in the initial response. Returning fewer events is acceptable, but returning (much) more should be avoided to prevent overwhelming clients.
*`["OK", "b1a649ebe8...", true, "duplicate: already have this event"]`
200
+
*`["OK", "b1a649ebe8...", false, "blocked: you are banned from posting here"]`
201
+
*`["OK", "b1a649ebe8...", false, "blocked: please register your pubkey at https://my-expensive-relay.example.com"]`
202
+
*`["OK", "b1a649ebe8...", false, "rate-limited: slow down there chief"]`
203
+
*`["OK", "b1a649ebe8...", false, "invalid: event creation date is too far off from the current time"]`
204
+
*`["OK", "b1a649ebe8...", false, "pow: difficulty 26 is less than 30"]`
205
+
*`["OK", "b1a649ebe8...", false, "restricted: not allowed to write."]`
206
+
*`["OK", "b1a649ebe8...", false, "error: could not connect to the database"]`
207
+
*`["OK", "b1a649ebe8...", false, "mute: no one was listening to your ephemeral event and it wasn't handled in any way, it was ignored"]`
208
+
-`CLOSED` messages MUST be sent in response to a `REQ` when the relay refuses to fulfill it. It can also be sent when a relay decides to kill a subscription on its side before a client has disconnected or sent a `CLOSE`. This message uses the same pattern of `OK` messages with the machine-readable prefix and human-readable message. Some examples:
*`["CLOSED", "sub1", "error: could not connect to the database"]`
211
+
*`["CLOSED", "sub1", "error: shutting down idle subscription"]`
212
+
- The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, `restricted`, `mute` and `error` for when none of that fits.
Copy file name to clipboardExpand all lines: 10.md
+23-6Lines changed: 23 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,43 @@
1
1
NIP-10
2
2
======
3
3
4
-
5
-
On "e" and "p" tags in Text Events (kind 1)
6
-
-------------------------------------------
4
+
Text Notes and Threads
5
+
----------------------
7
6
8
7
`draft``optional`
9
8
9
+
This NIP defines `kind:1` as a simple plaintext note.
10
+
10
11
## 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.
12
+
13
+
The `.content` property contains some human-readable text.
14
+
15
+
`e` tags can be used to define note thread roots and replies. They SHOULD be sorted by the reply stack from root to the direct parent.
16
+
17
+
`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).
18
+
19
+
```json
20
+
["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]
21
+
```
22
+
23
+
Authors of the `e` and `q` tags SHOULD be added as `p` tags to notify of a new reply or quote.
24
+
25
+
Markup languages such as markdown and HTML SHOULD NOT be used.
12
26
13
27
## Marked "e" tags (PREFERRED)
28
+
29
+
Kind 1 events with `e` tags are replies to other kind 1 events. Kind 1 replies MUST NOT be used to reply to other kinds, use [NIP-22](22.md) instead.
*`<event-id>` is the id of the event being referenced.
19
36
*`<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 `""`.
20
-
*`<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`.
37
+
*`<marker>` is optional and if present is one of `"reply"`, `"root"`.
21
38
*`<pubkey>` is optional, SHOULD be the pubkey of the author of the referenced event
22
39
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.
40
+
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.
24
41
25
42
A direct reply to the root of a thread should have a single marked "e" tag of type "root".
0 commit comments