upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authork. <kehiiiiya@gmail.com>2025-04-13 20:45:24 +0330
committerGitHub <noreply@github.com>2025-04-13 14:15:24 -0300
commit611b6351863e128f470576586f0e2b9a75f19039 (patch)
treed5bcfcc98182e89622f1f24ab501ec58e7ee7640
parent55f96bbeefdf0a9734a4edb24a69f034288e7a31 (diff)
nip-11: remove max filters, add max/default query limit, update example. (#1821)
-rw-r--r--11.md115
1 files changed, 73 insertions, 42 deletions
diff --git a/11.md b/11.md
index 8af4f31..8a15a26 100644
--- a/11.md
+++ b/11.md
@@ -80,15 +80,14 @@ Extra Fields
80### Server Limitations 80### Server Limitations
81 81
82These are limitations imposed by the relay on clients. Your client 82These are limitations imposed by the relay on clients. Your client
83should expect that requests which exceed these *practical* limitations 83should expect that requests exceed these *practical* limitations
84are rejected or fail immediately. 84are rejected or fail immediately.
85 85
86```jsonc 86```jsonc
87{ 87{
88 "limitation": { 88 "limitation": {
89 "max_message_length": 16384, 89 "max_message_length": 16384,
90 "max_subscriptions": 20, 90 "max_subscriptions": 300,
91 "max_filters": 100,
92 "max_limit": 5000, 91 "max_limit": 5000,
93 "max_subid_length": 100, 92 "max_subid_length": 100,
94 "max_event_tags": 100, 93 "max_event_tags": 100,
@@ -98,33 +97,30 @@ are rejected or fail immediately.
98 "payment_required": true, 97 "payment_required": true,
99 "restricted_writes": true, 98 "restricted_writes": true,
100 "created_at_lower_limit": 31536000, 99 "created_at_lower_limit": 31536000,
101 "created_at_upper_limit": 3 100 "created_at_upper_limit": 3,
101 "default_limit": 500
102 }, 102 },
103 // other fields... 103 // other fields...
104} 104}
105``` 105```
106 106
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
108will attempt to decode and act upon. When you send large subscriptions, you will be 108will attempt to decode and act upon. When you send large subscriptions, you will be
109limited by this value. It also effectively limits the maximum size of any event. Value is 109limited by this value. It also effectively limits the maximum size of any event. Value is
110calculated from `[` to `]` and is after UTF-8 serialization (so some unicode characters 110calculated from `[` to `]` after UTF-8 serialization (so some unicode characters
111will cost 2-3 bytes). It is equal to the maximum size of the WebSocket message frame. 111will cost 2-3 bytes). It is equal to the maximum size of the WebSocket message frame.
112 112
113- `max_subscriptions`: total number of subscriptions that may be 113- `max_subscriptions`: total number of subscriptions that may be
114active on a single websocket connection to this relay. It's possible 114active on a single websocket connection to this relay. Authenticated clients with a (paid) relationship to the relay
115that authenticated clients with a (paid) relationship to the relay
116may have higher limits. 115may have higher limits.
117 116
118- `max_filters`: maximum number of filter values in each subscription.
119Must be one or higher.
120
121- `max_subid_length`: maximum length of subscription id as a string. 117- `max_subid_length`: maximum length of subscription id as a string.
122 118
123- `max_limit`: the relay server will clamp each filter's `limit` value to this number. 119- `max_limit`: the relay server will clamp each filter's `limit` value to this number.
124This means the client won't be able to get more than this number 120This means the client won't be able to get more than this number
125of events from a single subscription filter. This clamping is typically done silently 121of events from a single subscription filter. This clamping is typically done silently
126by the relay, but with this number, you can know that there are additional results 122by the relay, but with this number, you can know that there are additional results
127if you narrowed your filter's time range or other parameters. 123if you narrow your filter's time range or other parameters.
128 124
129- `max_event_tags`: in any event, this is the maximum number of elements in the `tags` list. 125- `max_event_tags`: in any event, this is the maximum number of elements in the `tags` list.
130 126
@@ -142,7 +138,7 @@ Even if set to False, authentication may be required for specific actions.
142 138
143- `payment_required`: this relay requires payment before a new connection may perform any action. 139- `payment_required`: this relay requires payment before a new connection may perform any action.
144 140
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
146accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`). 142accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`).
147This should only be set to `true` when users are expected to know the relay policy before trying 143This should only be set to `true` when users are expected to know the relay policy before trying
148to write to it -- like belonging to a special pubkey-based whitelist or writing only events of 144to 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
152 148
153- `created_at_upper_limit`: 'created_at' upper limit 149- `created_at_upper_limit`: 'created_at' upper limit
154 150
151- `default_limit`: The maximum returned events if you send a filter with the limit set to 0.
152
155### Event Retention 153### Event Retention
156 154
157There may be a cost associated with storing data forever, so relays 155There may be a cost associated with storing data forever, so relays
@@ -212,7 +210,7 @@ flexibility is up to the client software.
212``` 210```
213 211
214- `relay_countries`: a list of two-level ISO country codes (ISO 3166-1 alpha-2) whose 212- `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.
216 214
217Remember that a relay may be hosted in a country which is not the 215Remember that a relay may be hosted in a country which is not the
218country of the legal entities who own the relay, so it's very 216country 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.
237 235
238- `language_tags` is an ordered list 236- `language_tags` is an ordered list
239 of [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) indicating 237 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.
241 239
242- `tags` is a list of limitations on the topics to be discussed. 240- `tags` is a list of limitations on the topics to be discussed.
243 For example `sfw-only` indicates that only "Safe For Work" content 241 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.
276 274
277### Examples 275### Examples
278 276
279As of 2 May 2023 the following command provided these results: 277As of 25 March 2025 the following command provided these results:
280 278
281```bash 279```bash
282$ curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq 280curl -H "Accept: application/nostr+json" https://jellyfish.land | jq
283``` 281```
284 282
285```json 283```json
286{ 284{
287 "description": "nostr.land family of relays (us-or-01)", 285 "name": "JellyFish",
288 "name": "nostr.land", 286 "description": "Stay Immortal!",
289 "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd", 287 "banner": "https://image.nostr.build/7fdefea2dec1f1ec25b8ce69362566c13b2b7f13f1726c2e4584f05f64f62496.jpg",
290 "software": "custom", 288 "pubkey": "bf2bee5281149c7c350f5d12ae32f514c7864ff10805182f4178538c2c421007",
289 "contact": "hi@dezh.tech",
290 "software": "https://github.com/dezh-tech/immortal",
291 "supported_nips": [ 291 "supported_nips": [
292 1, 292 1,
293 2,
294 4,
295 9, 293 9,
296 11, 294 11,
297 12, 295 13,
298 16, 296 17,
299 20, 297 40,
300 22, 298 42,
301 28, 299 59,
302 33, 300 62,
303 40 301 70
304 ], 302 ],
305 "version": "1.0.1", 303 "version": "immortal - 0.0.9",
306 "limitation": { 304 "relay_countries": [
307 "payment_required": true, 305 "*"
308 "max_message_length": 65535, 306 ],
309 "max_event_tags": 2000, 307 "language_tags": [
310 "max_subscriptions": 20, 308 "*"
311 "auth_required": false 309 ],
312 }, 310 "tags": [],
313 "payments_url": "https://eden.nostr.land", 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": [],
314 "fees": { 315 "fees": {
315 "subscription": [ 316 "subscription": [
316 { 317 {
317 "amount": 2500000, 318 "amount": 3000,
318 "unit": "msats", 319 "period": 2628003,
319 "period": 2592000 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"
320 } 336 }
321 ] 337 ]
322 }, 338 },
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 }
323} 354}
324``` 355```