From e5a4a7b069294bde15a64c2cd212eb16c9085008 Mon Sep 17 00:00:00 2001 From: Mike Dilger Date: Wed, 12 Feb 2025 11:25:23 +1300 Subject: [PATCH] Updates, fixes, and sync with NIP-42 --- 01.md | 19 ++++++++++--------- 42.md | 1 + 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/01.md b/01.md index 7d6459a0..eaacb123 100644 --- a/01.md +++ b/01.md @@ -176,13 +176,14 @@ This NIP defines no rules for how `NOTICE` messages should be sent or treated. * `["CLOSED", "sub1", "error: shutting down idle subscription"]` * `["CLOSED", "sub1", "redacted: some matching events were not served because you are not authorized or authenticated"]` - The standardized machine-readable prefixes are: - * `blocked` - for EVENT, when the relay rejects the event for any reason not better described by another prefix - * `deleted` - for EVENT, when the relay rejects the event because it has been deleted - * `duplicate` - for EVENT, when the relay already has the event - * `error` - for EVENT or CLOSED, used for relay errors and also when no other prefix suits - * `invalid` - for EVENT or CLOSED, when the request is somehow invalid - * `pow` - for EVENT, when the event does not reach the minimum proof-of-work threshold. See [NIP-13](13.md) - * `rate-limited` - for EVENT, when the relay rejects the event due to rate limiting, or too many subscriptions being open + * `blocked` - for OK, when the relay rejects the event for any reason not better described by another prefix + * `deleted` - for OK, when the relay rejects the event because it has been deleted + * `duplicate` - for OK, when the relay already has the event + * `error` - for OK or CLOSED, used for relay errors and also when no other prefix suits + * `invalid` - for OK or CLOSED, when the request is somehow invalid + * `pow` - for OK, when the event does not reach the minimum proof-of-work threshold. See [NIP-13](13.md) + * `rate-limited` - for OK, when the relay rejects the event due to rate limiting, or too many subscriptions being open +- The [NIP-42](42.md) extensions are: + * `auth-required` - for OK or CLOSED, when a client has not performed `AUTH` and the relay requires that to fulfill the query or write the event. * `redacted` - for CLOSED, when some matching events were not served due to the requester not being authenticated or authorized. - * `restricted` - for EVENT, when the relay rejects the event due to the author or submitter not being authenticated or authorized. - + * `restricted` - for OK or CLOSED, when a client has already performed `AUTH` but the key used to perform it is still not allowed by the relay or is exceeding its authorization. diff --git a/42.md b/42.md index fdc5d104..fe55d61a 100644 --- a/42.md +++ b/42.md @@ -55,6 +55,7 @@ This NIP defines two new prefixes that can be used in `OK` (in response to event - `"auth-required: "` - for when a client has not performed `AUTH` and the relay requires that to fulfill the query or write the event. - `"restricted: "` - for when a client has already performed `AUTH` but the key used to perform it is still not allowed by the relay or is exceeding its authorization. +- `"redacted: "` - on `CLOSED` for when some matching events were not served due to the requester not being authenticated or authorized. ## Protocol flow