Skip to content

Commit 75603fc

Browse files
Merge branch 'nostr-protocol:master' into master
2 parents 6d96045 + 45f6d59 commit 75603fc

File tree

2 files changed

+84
-81
lines changed

2 files changed

+84
-81
lines changed

11.md

Lines changed: 73 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,14 @@ Extra Fields
8080
### Server Limitations
8181

8282
These are limitations imposed by the relay on clients. Your client
83-
should expect that requests which exceed these *practical* limitations
83+
should expect that requests exceed these *practical* limitations
8484
are rejected or fail immediately.
8585

8686
```jsonc
8787
{
8888
"limitation": {
8989
"max_message_length": 16384,
90-
"max_subscriptions": 20,
91-
"max_filters": 100,
90+
"max_subscriptions": 300,
9291
"max_limit": 5000,
9392
"max_subid_length": 100,
9493
"max_event_tags": 100,
@@ -98,33 +97,30 @@ are rejected or fail immediately.
9897
"payment_required": true,
9998
"restricted_writes": true,
10099
"created_at_lower_limit": 31536000,
101-
"created_at_upper_limit": 3
100+
"created_at_upper_limit": 3,
101+
"default_limit": 500
102102
},
103103
// other fields...
104104
}
105105
```
106106

107-
- `max_message_length`: this is the maximum number of bytes for incoming JSON that the relay
107+
- `max_message_length`: the maximum number of bytes for incoming JSON that the relay
108108
will attempt to decode and act upon. When you send large subscriptions, you will be
109109
limited by this value. It also effectively limits the maximum size of any event. Value is
110-
calculated from `[` to `]` and is after UTF-8 serialization (so some unicode characters
110+
calculated from `[` to `]` after UTF-8 serialization (so some unicode characters
111111
will cost 2-3 bytes). It is equal to the maximum size of the WebSocket message frame.
112112

113113
- `max_subscriptions`: total number of subscriptions that may be
114-
active on a single websocket connection to this relay. It's possible
115-
that authenticated clients with a (paid) relationship to the relay
114+
active on a single websocket connection to this relay. Authenticated clients with a (paid) relationship to the relay
116115
may have higher limits.
117116

118-
- `max_filters`: maximum number of filter values in each subscription.
119-
Must be one or higher.
120-
121117
- `max_subid_length`: maximum length of subscription id as a string.
122118

123119
- `max_limit`: the relay server will clamp each filter's `limit` value to this number.
124120
This means the client won't be able to get more than this number
125121
of events from a single subscription filter. This clamping is typically done silently
126122
by the relay, but with this number, you can know that there are additional results
127-
if you narrowed your filter's time range or other parameters.
123+
if you narrow your filter's time range or other parameters.
128124

129125
- `max_event_tags`: in any event, this is the maximum number of elements in the `tags` list.
130126

@@ -142,7 +138,7 @@ Even if set to False, authentication may be required for specific actions.
142138

143139
- `payment_required`: this relay requires payment before a new connection may perform any action.
144140

145-
- `restricted_writes`: this relay requires some kind of condition to be fulfilled in order to
141+
- `restricted_writes`: this relay requires some kind of condition to be fulfilled to
146142
accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`).
147143
This should only be set to `true` when users are expected to know the relay policy before trying
148144
to write to it -- like belonging to a special pubkey-based whitelist or writing only events of
@@ -152,6 +148,8 @@ a specific niche kind or content. Normal anti-spam heuristics, for example, do n
152148

153149
- `created_at_upper_limit`: 'created_at' upper limit
154150

151+
- `default_limit`: The maximum returned events if you send a filter with the limit set to 0.
152+
155153
### Event Retention
156154

157155
There may be a cost associated with storing data forever, so relays
@@ -212,7 +210,7 @@ flexibility is up to the client software.
212210
```
213211

214212
- `relay_countries`: a list of two-level ISO country codes (ISO 3166-1 alpha-2) whose
215-
laws and policies may affect this relay. `EU` may be used for European Union countries.
213+
laws and policies may affect this relay. `EU` may be used for European Union countries. A `*` can be used for global relays.
216214

217215
Remember that a relay may be hosted in a country which is not the
218216
country of the legal entities who own the relay, so it's very
@@ -237,7 +235,7 @@ To support this goal, relays MAY specify some of the following values.
237235

238236
- `language_tags` is an ordered list
239237
of [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) indicating
240-
the major languages spoken on the relay.
238+
the major languages spoken on the relay. A `*` can be used for global relays.
241239

242240
- `tags` is a list of limitations on the topics to be discussed.
243241
For example `sfw-only` indicates that only "Safe For Work" content
@@ -276,49 +274,82 @@ Relays that require payments may want to expose their fee schedules.
276274

277275
### Examples
278276

279-
As of 2 May 2023 the following command provided these results:
277+
As of 25 March 2025 the following command provided these results:
280278

281279
```bash
282-
$ curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
280+
curl -H "Accept: application/nostr+json" https://jellyfish.land | jq
283281
```
284282

285283
```json
286284
{
287-
"description": "nostr.land family of relays (us-or-01)",
288-
"name": "nostr.land",
289-
"pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
290-
"software": "custom",
285+
"name": "JellyFish",
286+
"description": "Stay Immortal!",
287+
"banner": "https://image.nostr.build/7fdefea2dec1f1ec25b8ce69362566c13b2b7f13f1726c2e4584f05f64f62496.jpg",
288+
"pubkey": "bf2bee5281149c7c350f5d12ae32f514c7864ff10805182f4178538c2c421007",
289+
"contact": "[email protected]",
290+
"software": "https://github.com/dezh-tech/immortal",
291291
"supported_nips": [
292292
1,
293-
2,
294-
4,
295293
9,
296294
11,
297-
12,
298-
16,
299-
20,
300-
22,
301-
28,
302-
33,
303-
40
295+
13,
296+
17,
297+
40,
298+
42,
299+
59,
300+
62,
301+
70
304302
],
305-
"version": "1.0.1",
306-
"limitation": {
307-
"payment_required": true,
308-
"max_message_length": 65535,
309-
"max_event_tags": 2000,
310-
"max_subscriptions": 20,
311-
"auth_required": false
312-
},
313-
"payments_url": "https://eden.nostr.land",
303+
"version": "immortal - 0.0.9",
304+
"relay_countries": [
305+
"*"
306+
],
307+
"language_tags": [
308+
"*"
309+
],
310+
"tags": [],
311+
"posting_policy": "https://jellyfish.land/tos.txt",
312+
"payments_url": "https://jellyfish.land/relay",
313+
"icon": "https://image.nostr.build/2547e9ec4b23589e09bc7071e0806c3d4293f76284c58ff331a64bce978aaee8.jpg",
314+
"retention": [],
314315
"fees": {
315316
"subscription": [
316317
{
317-
"amount": 2500000,
318-
"unit": "msats",
319-
"period": 2592000
318+
"amount": 3000,
319+
"period": 2628003,
320+
"unit": "sats"
321+
},
322+
{
323+
"amount": 8000,
324+
"period": 7884009,
325+
"unit": "sats"
326+
},
327+
{
328+
"amount": 15000,
329+
"period": 15768018,
330+
"unit": "sats"
331+
},
332+
{
333+
"amount": 28000,
334+
"period": 31536036,
335+
"unit": "sats"
320336
}
321337
]
322338
},
339+
"limitation": {
340+
"auth_required": false,
341+
"max_message_length": 70000,
342+
"max_subid_length": 256,
343+
"max_subscriptions": 350,
344+
"min_pow_difficulty": 0,
345+
"payment_required": true,
346+
"restricted_writes": true,
347+
"max_event_tags": 2000,
348+
"max_content_length": 70000,
349+
"created_at_lower_limit": 0,
350+
"created_at_upper_limit": 2147483647,
351+
"default_limit": 500,
352+
"max_limit": 5000
353+
}
323354
}
324355
```

65.md

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ Relay List Metadata
66

77
`draft` `optional`
88

9-
Defines a replaceable event using `kind:10002` to advertise preferred relays for discovering a user's content and receiving fresh content from others.
9+
Defines a replaceable event using `kind:10002` to advertise relays where the user generally **writes** to and relays where the user generally **reads** mentions.
1010

11-
The event MUST include a list of `r` tags with relay URIs and a `read` or `write` marker. Relays marked as `read` / `write` are called READ / WRITE relays, respectively. If the marker is omitted, the relay is used for both purposes.
12-
13-
The `.content` is not used.
11+
The event MUST include a list of `r` tags with relay URLs as value and an optional `read` or `write` marker. If the marker is omitted, the relay is both **read** and **write**.
1412

1513
```jsonc
1614
{
@@ -26,45 +24,19 @@ The `.content` is not used.
2624
}
2725
```
2826

29-
This 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.
30-
31-
## When to Use Read and Write Relays
32-
33-
When seeking events **from** a user, Clients SHOULD use the WRITE relays of the user's `kind:10002`.
34-
35-
When seeking events **about** a user, where the user was tagged, Clients SHOULD use the READ relays of the user's `kind:10002`.
36-
37-
When broadcasting an event, Clients SHOULD:
38-
39-
- Broadcast the event to the WRITE relays of the author
40-
- Broadcast the event to all READ relays of each tagged user
41-
42-
## Motivation
43-
44-
The old model of using a fixed relay list per user centralizes in large relay operators:
45-
46-
- Most users submit their posts to the same highly popular relays, aiming to achieve greater visibility among a broader audience
47-
- Many users are pulling events from a large number of relays in order to get more data at the expense of duplication
48-
- Events are being copied between relays, oftentimes to many different relays
49-
50-
This 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.
51-
52-
## Final Considerations
53-
54-
1. Clients SHOULD guide users to keep `kind:10002` lists small (2-4 relays).
27+
When downloading events **from** a user, clients SHOULD use the **write** relays of that user.
5528

56-
2. Clients SHOULD spread an author's `kind:10002` event to as many relays as viable.
29+
When downloading events **about** a user, where the user was tagged (mentioned), clients SHOULD use the user's **read** relays.
5730

58-
3. `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.
31+
When publishing an event, clients SHOULD:
5932

60-
4. DMs SHOULD only be broadcasted to the author's WRITE relays and to the receiver's READ relays to keep maximum privacy.
33+
- Send the event to the **write** relays of the author
34+
- Send the event to all **read** relays of each tagged user
6135

62-
5. 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.
36+
### Size
6337

64-
6. Clients SHOULD deduplicate connections by normalizing relay URIs according to [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-6).
38+
Clients SHOULD guide users to keep `kind:10002` lists small (2-4 relays of each category).
6539

66-
7. When publishing to a relay, clients SHOULD ensure the user's `kind 10002` is also available on that relay. Relays SHOULD accept and serve `kind 10002` notes for any pubkey whose notes they store. Relays MAY scrape the network for missing `kind 10002` events. The goal here is that for any note served from a relay the user can also request the author's relay selections as a way of bootstrapping further context discovery.
40+
### Discoverability
6741

68-
## Related articles
69-
- [Outbox model](https://mikedilger.com/gossip-model/)
70-
- [What is the Outbox Model?](https://habla.news/u/[email protected]/8YjqXm4SKY-TauwjOfLXS)
42+
Clients SHOULD spread an author's `kind:10002` event to as many relays as viable, paying attention to relays that, at any moment, serve naturally as well-known public indexers for these relay lists (where most other clients and users are connecting to in order to publish and fetch those).

0 commit comments

Comments
 (0)