upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2023-08-11 06:12:50 -0400
committerGitHub <noreply@github.com>2023-08-11 07:12:50 -0300
commita5047326d4d7c28e66c5d1262c252b86a1c8fe67 (patch)
tree2faee6c3b7c332b2c3b3634053557f4e69a834ed
parentd87f86178b2178c2cb171af8a4e042bdffe4b1fe (diff)
Simplifies NIP-65 (#700)
Co-authored-by: fiatjaf_ <fiatjaf@gmail.com> Co-authored-by: Jon Staab <jstaab@protonmail.com>
-rw-r--r--65.md85
1 files changed, 35 insertions, 50 deletions
diff --git a/65.md b/65.md
index 55f9ff0..3c06438 100644
--- a/65.md
+++ b/65.md
@@ -4,73 +4,58 @@ NIP-65
4Relay List Metadata 4Relay List Metadata
5------------------- 5-------------------
6 6
7`draft` `optional` `author:mikedilger` 7`draft` `optional` `author:mikedilger` `author:vitorpamplona`
8 8
9A special replaceable event meaning "Relay List Metadata" is defined as an event with kind `10002` having a list of `r` tags, one for each relay the author uses to either read or write to. 9Defines a replaceable event using `kind:10002` to advertise preferred relays for discovering a user's content and receiving fresh content from others.
10 10
11The primary purpose of this relay list is to advertise to others, not for configuring one's client. 11The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. If the marker is omitted, the relay is used for both purposes.
12 12
13The `content` is not used and SHOULD be an empty string. 13The `.content` is not used.
14 14
15The `r` tags can have a second parameter as either `read` or `write`. If it is omitted, it means the author uses the relay for both purposes. 15```json
16 16{
17Clients SHOULD, as with all replaceable events, use only the most recent kind-10002 event they can find. 17 "kind": 10002,
18 18 "tags": [
19### The meaning of read and write 19 ["r", "wss://alicerelay.example.com"],
20 20 ["r", "wss://brando-relay.com"],
21Write relays are for events that are intended for anybody (e.g. your followers). Read relays are for events that address a particular person. 21 ["r", "wss://expensive-relay.example2.com", "write"],
22 ["r", "wss://nostr-relay.example.com", "read"],
23 ],
24 "content": "",
25 ...other fields
26```
22 27
23Clients SHOULD write feed-related events created by their user to their user's write relays. 28This NIP doesn't fully replace relay lists that are designed to configure a client's usage of relays (such as `kind:3` style relay lists). Clients MAY use other relay lists in situations where a `kind:10002` relay list cannot be found.
24 29
25Clients SHOULD read feed-related events created by another from at least some of that other person's write relays. Explicitly, they SHOULD NOT expect them to be available at their user's read relays. It SHOULD NOT be presumed that the user's read relays coincide with the write relays of the people the user follows. 30## When to Use Read and Write
26 31
27Clients SHOULD read events that tag their user from their user's read relays. 32When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002`
28 33
29Clients SHOULD write events that tag a person to at least some of that person's read relays. Explicitly, they SHOULD NOT expect that person will pick them up from their user's write relays. It SHOULD NOT be presumed that the user's write relays coincide with the read relays of the person being tagged. 34When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002`
30 35
31Clients SHOULD presume that if their user has a pubkey in their ContactList (kind 3) that it is because they wish to see that author's feed-related events. But clients MAY presume otherwise. 36When broadcasting an event, Clients SHOULD:
32 37
33### Motivation 38- Broadcast the event to the WRITE relays of the author
39- Broadcast the event all READ relays of each tagged user.
34 40
35There is a common nostr use case where users wish to follow the content produced by other users. This is evidenced by the implicit meaning of the Contact List in [NIP-02](02.md) 41## Motivation
36 42
37Because users don't often share the same sets of relays, ad-hoc solutions have arisen to get that content, but these solutions negatively impact scalability and decentralization: 43The old model of using a fixed relay list per user centralizes in large relay operators:
38 44
39 - Most people are sending their posts to the same most popular relays in order to be more widely seen 45 - Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience.
40 - Many people are pulling from a large number of relays (including many duplicate events) in order to get more data 46 - Many users are pulling events from a large number of relays in order to get more data at the expense of duplication
41 - Events are being copied between relays, oftentimes to many different relays 47 - Events are being copied between relays, oftentimes to many different relays
48
49This NIP allows Clients to connect directly with the most up-to-date relay set from each individual user, eliminating the need of broadcasting events to popular relays.
42 50
43### Purposes 51## Final Considerations
44
45The purpose of this NIP is to help clients find the events of the people they follow, to help tagged events get to the people tagged, and to help nostr scale better.
46 52
47### Suggestions 531. Clients SHOULD guide users to keep `kind:10002` lists small (2-4 relays).
48 54
49It is suggested that people spread their kind `10002` events to many relays, but write their normal feed-related events to a much smaller number of relays (between 2 to 6 relays). It is suggested that clients offer a way for users to spread their kind `10002` events to many more relays than they normally post to. 552. Clients SHOULD spread an author's `kind:10002` events to as many relays as viable.
50 56
51Authors may post events outside of the feed that they wish their followers to follow by posting them to relays outside of those listed in their "Relay List Metadata". For example, an author may want to reply to someone without all of their followers watching. 573. `kind:10002` events should primarily be used to advertise the user's preferred relays to others. A user's own client may use other heuristics for selecting relays for fetching data.
52 58
53It is suggested that relays allow any user to write their own kind `10002` event (optionally with AUTH to verify it is their own) even if they are not otherwise subscribed to the relay because 594. DMs SHOULD only be broadcasted to the author's WRITE relays and to the receiver's READ relays to keep maximum privacy.
54 60
55 - finding where someone posts is rather important 615. If a relay signals support for this NIP in their [NIP-11](11.md) document that means they're willing to accept kind 10002 events from a broad range of users, not only their paying customers or whitelisted group.
56 - these events do not have `content` that needs management
57 - relays only need to store one replaceable event per pubkey to offer this service
58
59### Why not in kind `0` Metadata
60
61Even though this is user related metadata, it is a separate event from kind `0` in order to keep it small (as it should be widely spread) and to not have `content` that may require moderation by relay operators so that it is more acceptable to relays.
62
63### Example
64
65```json
66{
67 "kind": 10002,
68 "tags": [
69 ["r", "wss://alicerelay.example.com"],
70 ["r", "wss://brando-relay.com"],
71 ["r", "wss://expensive-relay.example2.com", "write"],
72 ["r", "wss://nostr-relay.example.com", "read"],
73 ],
74 "content": "",
75 ...other fields
76```