diff --git a/01.md b/01.md index 430a176..cde8453 100644 --- a/01.md +++ b/01.md @@ -19,11 +19,12 @@ Event is the only object type available. It is a hashed and signed payload in th "created_at": , "kind": , "tags": [ - [...], + [, , ...], + [, , ...], ... ], "content": , - "sig": <64-byte lowercase hex of the signature of the "id" field> + "sig": <64-byte lowercase hex of the signature of the id> } ``` @@ -65,7 +66,7 @@ To verify an event: ## Kinds -The `.kind` property specifies the meaning of an event and its tags. +The `.kind` property specifies the meaning of an event, its tags and it is further defined in the various NIPs in this repository Specific ranges define storage behaviors: @@ -80,14 +81,14 @@ In case of replaceable events with the same timestamp, the event with the lowest This NIP defines two kinds: -- `kind:0`: **User Metadata**: the `content` is set to a stringified JSON object `{name: , about: , picture: }` describing the user who created the event. A relay may delete older events once it gets a new one for the same pubkey. -- `kind:1`: **Text Note**: the `content` is set to the **plaintext** content of a note (anything the user wants to say). Content that must be parsed, such as Markdown and HTML, should not be used. Clients should also not parse content as those. +- `kind:0`: **User Metadata**: An event kind to add name and other information to the pubkey. The `content` is set to a stringified JSON object `{name: , about: , picture: }` +- `kind:1`: **Text Note**: An event kind to transfer **plaintext** content in it's `.content` property. Markup language such as markdown and HTML SHOULD not be used. ## Tags -Each tag is an array of strings of arbitrary size. Their meaning is determined by the event `.kind` and defined in NIPs in this repository. Tags with the same name might have entirely different meanings in different kinds. +Each tag is an array of strings of arbitrary size. Their meaning is determined by the event `.kind`. Tags with the same name might have entirely different meanings in different kinds. -The first element of the tag array is referred to as the tag _name_ or _key_ and the second as the tag _value_. All elements after the second do not have a conventional name. +The first element of the tag array is referred to as the tag _name_ and the second as the tag _value_. All elements after the second do not have a conventional name. All single-letter (only English alphabet letters: a-z, A-Z) key tags are indexed by relays for faster queries. @@ -102,9 +103,7 @@ This NIP defines the format of 3 standard tags: `e`, `p`, and `a`. `e`, `p` can # Relay Protocol -Nostr has two main components: Clients & Relays. - -Users run a client to fetch/subscribe to events from one or more Relays via WebSockets. +Nostr has two main components: Clients & Relays. Users run a client to fetch/subscribe to events from one or more Relays via WebSockets. Relays are not expected to communicate with one another. It's the Client's responsibility to discover which relay has the event set their user wants to see. @@ -112,7 +111,7 @@ Both sides SHOULD verify the hash and the signature of each event upon receipt. Clients SHOULD open a single WebSocket connection to each relay and use it for all their subscriptions. Relays MAY limit the number of connections from specific IP/client/etc. -All messages are defined as JSON arrays. +All messages are defined as JSON arrays, where the first item determines the message type. ## Subscriptions @@ -135,10 +134,11 @@ To open, update, and close subscriptions, Clients MUST use the following formats "ids": [, , ...], "authors": [, , ...], "kinds": [, , ...], - "#": [tag value1, tag value2, ...], + "#": [, , ...], + "#": [, , ...], "since": , "until": , - "limit": + "limit": } ``` @@ -182,7 +182,7 @@ If present, the message MUST be a string formed by a machine-readable single-wor ## Notices -Notices are warnings that might help explain or debug the behavior of a given relay. +Notices are warnings that might help explain or debug the behavior of a given relay or filter. * `["NOTICE", ]`, used to send human-readable error messages or other things to clients.