From e1b9ffdd0905f1988fdd89d64fd7fc10d028b96a Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 3 Jan 2024 14:21:16 -0500 Subject: [PATCH] Improving the d-Tag needs and prefixes in messages. --- 01.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/01.md b/01.md index cdcf8d75..d7dbcf41 100644 --- a/01.md +++ b/01.md @@ -79,6 +79,8 @@ Specific ranges define storage behaviors: | Ephemeral | `20000 <= kind < 30000` | Nothing | | Parameterized | `30000 <= kind < 40000` | The newest event for each `pubkey`, `kind` and `d`-tag | +Parameterized Repleaceable events MUST include a `d`-tag with an identifier value to be used as reference. + In case of replaceable events with the same timestamp, the event with the lowest `.id` (first in lexical order) SHOULD be retained. Older versions MAY be kept but SHOULD not be returned on queries. This NIP defines two kinds: @@ -162,7 +164,7 @@ Relays send 3 types of messages during a subscription: * `["EVENT", , ]`, used to send events requested by clients. * `["EOSE", ]`, used to indicate the _end of stored events_ and the beginning of events newly received in real-time. - * `["CLOSED", , ]`, used to indicate that a subscription was ended on the server side. + * `["CLOSED", , :]`, used to indicate that a subscription was ended on the server side. All messages MUST be sent with the `subscription_id` initiated by the client (using the `REQ` message above). @@ -176,7 +178,7 @@ To send an event to the Relay, Clients send a broadcast message in the format: Relays reply with an ACK message in the format of: - * `["OK", , , ]`, used to indicate acceptance (true) or denial (false) of an `EVENT`. + * `["OK", , , :]`, used to indicate acceptance (true) or denial (false) of an `EVENT`. `OK` messages MUST be sent in response to `EVENT` messages received from clients, they must have the 3rd parameter set to `true` when an event has been accepted by the relay, `false` otherwise. The 4th parameter MUST always be present, but MAY be an empty string when the 3rd is `true`. @@ -188,7 +190,7 @@ Notices are warnings that might help explain or debug the behavior of a given re * `["NOTICE", ]`, used to send human-readable error messages or other things to clients. -## Error Codes +## Message Prefixes The standardized machine-readable prefixes for `OK` and `CLOSED` are: `duplicate`, `pow`, `blocked`, `rate-limited`, `invalid`, and `error` for when none of that fits.