diff --git a/nips/01.md b/nips/01.md index 022a10e..55a62a9 100644 --- a/nips/01.md +++ b/nips/01.md @@ -52,17 +52,17 @@ Relays expose a websocket endpoint to which clients can connect. Clients can send 3 types of messages, which must be JSON arrays, according to the following patterns: * `["EVENT", `], used to publish events. - * `["REQ", , ...`], used to request events and subscribe to new updates. + * `["REQ", , ...`], used to request events and subscribe to new updates. * `["CLOSE", ]`, used to stop previous subscriptions. -`` is a random string that should be used to represent a subscription. The same +`` is a random string that should be used to represent a subscription. `` is a JSON object that determines what events will be sent in that subscription, it can have the following attributes: ``` { "ids": , - "kinds": , + "kinds": , "#e": , "#p": , "since": , @@ -71,7 +71,7 @@ Clients can send 3 types of messages, which must be JSON arrays, according to th } ``` -Upon receiving a `REQ` message, the relay MUST query its internal database and return events that match the filter, then store that filter and send again all future events it receives to that same websocket until the websocket is closed, the `CLOSE` event is received with the same `` or a new `REQ` is sent using the same id, in which case it should overwrite the previous subscription. +Upon receiving a `REQ` message, the relay MUST query its internal database and return events that match the filter, then store that filter and send again all future events it receives to that same websocket until the websocket is closed. The `CLOSE` event is received with the same `` or a new `REQ` is sent using the same ``, in which case it should overwrite the previous subscription. Filter attributes containing lists (such as `ids`, `kinds`, or `#e`) are JSON arrays with one or more values. At least one of the array's values must match the relevant field in an event for the condition itself to be considered a match. For scalar event attributes such as `kind`, the attribute from the event must be contained in the filter list. For tag attributes such as `#e`, where an event may have multiple values, the event and filter condition values must have at least one item in common. @@ -83,7 +83,7 @@ A `REQ` message may contain multiple filters. In this case events that match any Relays can send 2 types of messages, which must also be JSON arrays, according to the following patterns: - * `["EVENT", , ]`, used to send events requested by clients. + * `["EVENT", , ]`, used to send events requested by clients. * `["NOTICE", ]`, used to send human-readable error messages or other things to clients. This NIP defines no rules for how `NOTICE` messages should be sent or treated.