upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Wandersleb <leo@leowandersleb.de>2022-08-04 00:06:25 -0400
committerfiatjaf <fiatjaf@gmail.com>2022-08-04 06:01:23 -0300
commit01931bd643e549a2327cc13c1cad24af2321d939 (patch)
tree99a81688ea586912c8596500a44451fa32224383
parentdb5b671f3e2d6fca7388fcc387a6f8fb3d06885c (diff)
improve wording
-rw-r--r--21.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/21.md b/21.md
index abfedcf..426c630 100644
--- a/21.md
+++ b/21.md
@@ -6,15 +6,15 @@ Non-public encrypted messages
6 6
7`draft` `optional` `author:fiatjaf` 7`draft` `optional` `author:fiatjaf`
8 8
9This NIP defines a method for relays to verify the identity of the client that is requesting ["encrypted directed messages"](04.md) messages and only allow these clients to see messages authored by them or targeted to them. 9This NIP defines a method for relays to verify the identity of the client that is requesting ["encrypted directed messages"](04.md) and only allow these clients to see messages authored by them or intended for them.
10 10
11When connecting to relays that support this NIP, clients SHOULD send a an event of kind `20001`, meaning "client identification", with the content set to `"client identification for <relay hostname>"`. 11When connecting to relays that support this NIP, clients SHOULD send an event of kind `20001`, meaning "client identification", with the content set to `"client identification for <relay hostname>"`.
12 12
13The relay MUST then use the event to verify the identity of the client and discard it afterwards. In the verification process the relay MUST check: 13The relay MUST then use the event to verify the identity of the client and discard it afterwards. In the verification process the relay MUST check:
14 14
15 1. if event signature is valid; 15 1. if event signature is valid;
16 2. if the content phrase matches the canonical phrase with the actual relay hostname in it; 16 2. if the content phrase matches the canonical phrase with the actual relay hostname in it;
17 3. if the event timestamp is not too far from the relay current timestamp. 17 3. if the event timestamp is not too far from the relay's current timestamp.
18 18
19If all is well, then the relay can use the identified pubkey to validate further requests for kind-4 events and only return kind-4 events that were either authored by the identified pubkey (`"pubkey": ...`) or are addressed to the identified pubkey (`"tags": ["p", ...]`). 19If all is well, then the relay can use the identified pubkey to validate further requests for kind-4 events and only return kind-4 events that were either authored by the identified pubkey (`"pubkey": ...`) or are addressed to the identified pubkey (`"tags": ["p", ...]`).
20 20
@@ -23,7 +23,7 @@ If all is well, then the relay can use the identified pubkey to validate further
231. Client connects to `wss://chat.relay.nostr.com/` 231. Client connects to `wss://chat.relay.nostr.com/`
242. Client sends `["EVENT", {"id": "...", "pubkey": "aeae...", "sig": "...", "kind": 20001, "tags": [], "created_at": 1609470000, "content": "client identification for chat.relay.nostr.com"}]` 242. Client sends `["EVENT", {"id": "...", "pubkey": "aeae...", "sig": "...", "kind": 20001, "tags": [], "created_at": 1609470000, "content": "client identification for chat.relay.nostr.com"}]`
253. Client sends `["REQ", "my-dms", {"kinds": [4], "#p": ["aeae..."]}, {"kinds": [4],"authors": ["aeae"]}]` 253. Client sends `["REQ", "my-dms", {"kinds": [4], "#p": ["aeae..."]}, {"kinds": [4],"authors": ["aeae"]}]`
265. Relay sends `["EVENT", "my-dms", {"id": "...", "pubkey": "aeae", "kind": 4, "content": "<encrypted>", "sig": "...", "tags": ["p", "786b..."]}]` 265. Relay sends `["EVENT", "my-dms", {"id": "...", "pubkey": "aeae...", "kind": 4, "content": "<encrypted>", "sig": "...", "tags": ["p", "786b..."]}]`
275. Relay sends `["EVENT", "my-dms", {"id": "...", "pubkey": "786b...", "kind": 4, "content": "<encrypted>", "sig": "...", "tags": ["p", "aeae..."]}]` 275. Relay sends `["EVENT", "my-dms", {"id": "...", "pubkey": "786b...", "kind": 4, "content": "<encrypted>", "sig": "...", "tags": ["p", "aeae..."]}]`
28 28
29Ids and signatures omitted and pubkeys shortened for readability. 29Ids and signatures omitted and pubkeys shortened for readability.