upleb.uk

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

summaryrefslogtreecommitdiff
path: root/11.md
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2026-04-10 13:31:37 -0500
committerAlex Gleason <alex@alexgleason.me>2026-04-10 13:31:37 -0500
commit5e1e24766910fc07cb61a049aed2623987458ec2 (patch)
treeb7588f61fddf9374268d5cd6f4e3f2655d7c840a /11.md
parentb8782df594b4e7e8f088869134908eed58be6078 (diff)
parent3465f540e3eaedccb5309711b502f0febf56b52f (diff)
Merge nip44-big-payloads into bigger-nip44bigger-nip44
Diffstat (limited to '11.md')
-rw-r--r--11.md262
1 files changed, 69 insertions, 193 deletions
diff --git a/11.md b/11.md
index 8229bd4..d1acab7 100644
--- a/11.md
+++ b/11.md
@@ -4,9 +4,9 @@ NIP-11
4Relay Information Document 4Relay Information Document
5-------------------------- 5--------------------------
6 6
7`draft` `optional` 7`draft` `optional` `relay`
8 8
9Relays may provide server metadata to clients to inform them of capabilities, administrative contacts, and various server attributes. This is made available as a JSON document over HTTP, on the same URI as the relay's websocket. 9Relays may provide server metadata to clients to inform them of capabilities, administrative contacts, and various server attributes. This is made available as a JSON document over HTTP, on the same URI as the relay's websocket.
10 10
11When a relay receives an HTTP(s) request with an `Accept` header of `application/nostr+json` to a URI supporting WebSocket upgrades, they SHOULD return a document with the following structure. 11When a relay receives an HTTP(s) request with an `Accept` header of `application/nostr+json` to a URI supporting WebSocket upgrades, they SHOULD return a document with the following structure.
12 12
@@ -17,14 +17,12 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application
17 "banner": <a link to an image (e.g. in .jpg, or .png format)>, 17 "banner": <a link to an image (e.g. in .jpg, or .png format)>,
18 "icon": <a link to an icon (e.g. in .jpg, or .png format>, 18 "icon": <a link to an icon (e.g. in .jpg, or .png format>,
19 "pubkey": <administrative contact pubkey>, 19 "pubkey": <administrative contact pubkey>,
20 "self": <relay's own pubkey>,
20 "contact": <administrative alternate contact>, 21 "contact": <administrative alternate contact>,
21 "supported_nips": <a list of NIP numbers supported by the relay>, 22 "supported_nips": <a list of NIP numbers supported by the relay>,
22 "software": <string identifying relay software URL>, 23 "software": <string identifying relay software URL>,
23 "version": <string version identifier> 24 "version": <string version identifier>,
24 "privacy_policy": <a link to a text file describing the relay's privacy policy>, 25 "terms_of_service": <a link to a text file describing the relay's term of service>
25 "terms_of_service": <a link to a text file describing the relay's term of service>,
26
27
28} 26}
29``` 27```
30 28
@@ -35,11 +33,11 @@ Field Descriptions
35 33
36### Name 34### Name
37 35
38A relay may select a `name` for use in client software. This is a string, and SHOULD be less than 30 characters to avoid client truncation. 36A relay may select a `name` for use in client software. This is a string, and SHOULD be less than 30 characters to avoid client truncation.
39 37
40### Description 38### Description
41 39
42Detailed plain-text information about the relay may be contained in the `description` string. It is recommended that this contain no markup, formatting or line breaks for word wrapping, and simply use double newline characters to separate paragraphs. There are no limitations on length. 40Detailed plain-text information about the relay may be contained in the `description` string. It is recommended that this contain no markup, formatting or line breaks for word wrapping, and simply use double newline characters to separate paragraphs. There are no limitations on length.
43 41
44### Banner 42### Banner
45 43
@@ -58,36 +56,34 @@ Icon is a compact visual representation of the relay for use in UI with limited
58 56
59### Pubkey 57### Pubkey
60 58
61An administrative contact may be listed with a `pubkey`, in the same format as Nostr events (32-byte hex for a `secp256k1` public key). If a contact is listed, this provides clients with a recommended address to send encrypted direct messages (See [NIP-17](17.md)) to a system administrator. Expected uses of this address are to report abuse or illegal content, file bug reports, or request other technical assistance. 59An administrative contact may be listed with a `pubkey`, in the same format as Nostr events (32-byte hex for a `secp256k1` public key). If a contact is listed, this provides clients with a recommended address to send encrypted direct messages (See [NIP-17](17.md)) to a system administrator. Expected uses of this address are to report abuse or illegal content, file bug reports, or request other technical assistance.
62 60
63Relay operators have no obligation to respond to direct messages. 61Relay operators have no obligation to respond to direct messages.
64 62
63### Self
64
65A relay MAY maintain an identity independent from its administrator using the `self` field, which MUST be a 32-byte hex public key. This allows relays to respond to requests with events published either in advance or on demand by their own key.
66
65### Contact 67### Contact
66 68
67An alternative contact may be listed under the `contact` field as well, with the same purpose as `pubkey`. Use of a Nostr public key and direct message SHOULD be preferred over this. Contents of this field SHOULD be a URI, using schemes such as `mailto` or `https` to provide users with a means of contact. 69An alternative contact may be listed under the `contact` field as well, with the same purpose as `pubkey`. Use of a Nostr public key and direct message SHOULD be preferred over this. Contents of this field SHOULD be a URI, using schemes such as `mailto` or `https` to provide users with a means of contact.
68 70
69### Supported NIPs 71### Supported NIPs
70 72
71As the Nostr protocol evolves, some functionality may only be available by relays that implement a specific `NIP`. This field is an array of the integer identifiers of `NIP`s that are implemented in the relay. Examples would include `1`, for `"NIP-01"` and `9`, for `"NIP-09"`. Client-side `NIPs` SHOULD NOT be advertised, and can be ignored by clients. 73As the Nostr protocol evolves, some functionality may only be available by relays that implement a specific `NIP`. This field is an array of the integer identifiers of `NIP`s that are implemented in the relay. Examples would include `1`, for `"NIP-01"` and `9`, for `"NIP-09"`. Client-side `NIPs` SHOULD NOT be advertised, and can be ignored by clients.
72 74
73### Software 75### Software
74 76
75The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage. 77The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage.
76 78
77### Version 79### Version
78 80
79The relay MAY choose to publish its software version as a string attribute. The string format is defined by the relay implementation. It is recommended this be a version number or commit identifier. 81The relay MAY choose to publish its software version as a string attribute. The string format is defined by the relay implementation. It is recommended this be a version number or commit identifier.
80
81### Privacy Policy
82
83The relay owner/admin MAY choose to link to a privacy policy document, which describes how the relay utilizes user data. Data collection, data usage, data retention, monetization of data, and third party data sharing SHOULD be included.
84 82
85### Terms of Service 83### Terms of Service
86 84
87The relay owner/admin MAY choose to link to a terms of service document. 85The relay owner/admin MAY choose to link to a terms of service document.
88 86
89
90
91Extra Fields 87Extra Fields
92------------ 88------------
93 89
@@ -162,113 +158,7 @@ a specific niche kind or content. Normal anti-spam heuristics, for example, do n
162 158
163- `created_at_upper_limit`: 'created_at' upper limit 159- `created_at_upper_limit`: 'created_at' upper limit
164 160
165- `default_limit`: The maximum returned events if you send a filter with the limit set to 0. 161- `default_limit`: The maximum returned events if you send a filter without a `limit`.
166
167### Event Retention
168
169There may be a cost associated with storing data forever, so relays
170may wish to state retention times. The values stated here are defaults
171for unauthenticated users and visitors. Paid users would likely have
172other policies.
173
174Retention times are given in seconds, with `null` indicating infinity.
175If zero is provided, this means the event will not be stored at
176all, and preferably an error will be provided when those are received.
177
178```jsonc
179{
180 "retention": [
181 {"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600},
182 {"kinds": [[40000, 49999]], "time": 100},
183 {"kinds": [[30000, 39999]], "count": 1000},
184 {"time": 3600, "count": 10000}
185 ],
186 // other fields...
187}
188```
189
190`retention` is a list of specifications: each will apply to either all kinds, or
191a subset of kinds. Ranges may be specified for the kind field as a tuple of inclusive
192start and end values. Events of indicated kind (or all) are then limited to a `count`
193and/or time period.
194
195It is possible to effectively blacklist Nostr-based protocols that rely on
196a specific `kind` number, by giving a retention time of zero for those `kind` values.
197While that is unfortunate, it does allow clients to discover servers that will
198support their protocol quickly via a single HTTP fetch.
199
200There is no need to specify retention times for _ephemeral events_ since they are not retained.
201
202### Content Limitations
203
204Some relays may be governed by the arbitrary laws of a nation state. This
205may limit what content can be stored in clear-text on those relays. All
206clients are encouraged to use encryption to work around this limitation.
207
208It is not possible to describe the limitations of each country's laws
209and policies which themselves are typically vague and constantly shifting.
210
211Therefore, this field allows the relay operator to indicate which
212countries' laws might end up being enforced on them, and then
213indirectly on their users' content.
214
215Users should be able to avoid relays in countries they don't like,
216and/or select relays in more favorable zones. Exposing this
217flexibility is up to the client software.
218
219```jsonc
220{
221 "relay_countries": [ "CA", "US" ],
222 // other fields...
223}
224```
225
226- `relay_countries`: a list of two-level ISO country codes (ISO 3166-1 alpha-2) whose
227 laws and policies may affect this relay. `EU` may be used for European Union countries. A `*` can be used for global relays.
228
229Remember that a relay may be hosted in a country which is not the
230country of the legal entities who own the relay, so it's very
231likely a number of countries are involved.
232
233
234### Community Preferences
235
236For public text notes at least, a relay may try to foster a
237local community. This would encourage users to follow the global
238feed on that relay, in addition to their usual individual follows.
239To support this goal, relays MAY specify some of the following values.
240
241```jsonc
242{
243 "language_tags": ["en", "en-419"],
244 "tags": ["sfw-only", "bitcoin-only", "anime"],
245 "posting_policy": "https://example.com/posting-policy.html",
246 // other fields...
247}
248```
249
250- `language_tags` is an ordered list
251 of [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) indicating
252 the major languages spoken on the relay. A `*` can be used for global relays.
253
254- `tags` is a list of limitations on the topics to be discussed.
255 For example `sfw-only` indicates that only "Safe For Work" content
256 is encouraged on this relay. This relies on assumptions of what the
257 "work" "community" feels "safe" talking about. In time, a common
258 set of tags may emerge that allow users to find relays that suit
259 their needs, and client software will be able to parse these tags easily.
260 The `bitcoin-only` tag indicates that any *altcoin*, *"crypto"* or *blockchain*
261 comments will be ridiculed without mercy.
262
263- `posting_policy` is a link to a human-readable page which specifies the
264 community policies for the relay. In cases where `sfw-only` is True, it's
265 important to link to a page which gets into the specifics of your posting policy.
266
267The `description` field should be used to describe your community
268goals and values, in brief. The `posting_policy` is for additional
269detail and legal terms. Use the `tags` field to signify limitations
270on content, or topics to be discussed, which could be machine
271processed by appropriate client software.
272 162
273### Pay-to-Relay 163### Pay-to-Relay
274 164
@@ -288,82 +178,68 @@ Relays that require payments may want to expose their fee schedules.
288 178
289### Examples 179### Examples
290 180
291As of 25 March 2025 the following command provided these results: 181```yaml
292 182~> curl -H "Accept: application/nostr+json" https://nostr.wine | jq
293```bash
294curl -H "Accept: application/nostr+json" https://jellyfish.land | jq
295```
296
297```json
298{ 183{
299 "name": "JellyFish", 184 "contact": "wino@nostr.wine",
300 "description": "Stay Immortal!", 185 "description": "A paid nostr relay for wine enthusiasts and everyone else.",
301 "banner": "https://image.nostr.build/7fdefea2dec1f1ec25b8ce69362566c13b2b7f13f1726c2e4584f05f64f62496.jpg",
302 "pubkey": "bf2bee5281149c7c350f5d12ae32f514c7864ff10805182f4178538c2c421007",
303 "contact": "hi@dezh.tech",
304 "software": "https://github.com/dezh-tech/immortal",
305 "supported_nips": [
306 1,
307 9,
308 11,
309 13,
310 17,
311 40,
312 42,
313 59,
314 62,
315 70
316 ],
317 "version": "immortal - 0.0.9",
318 "relay_countries": [
319 "*"
320 ],
321 "language_tags": [
322 "*"
323 ],
324 "tags": [],
325 "posting_policy": "https://jellyfish.land/tos.txt",
326 "payments_url": "https://jellyfish.land/relay",
327 "icon": "https://image.nostr.build/2547e9ec4b23589e09bc7071e0806c3d4293f76284c58ff331a64bce978aaee8.jpg",
328 "retention": [],
329 "fees": { 186 "fees": {
330 "subscription": [ 187 "admission": [
331 {
332 "amount": 3000,
333 "period": 2628003,
334 "unit": "sats"
335 },
336 { 188 {
337 "amount": 8000, 189 "amount": 18888000,
338 "period": 7884009, 190 "unit": "msats"
339 "unit": "sats"
340 },
341 {
342 "amount": 15000,
343 "period": 15768018,
344 "unit": "sats"
345 },
346 {
347 "amount": 28000,
348 "period": 31536036,
349 "unit": "sats"
350 } 191 }
351 ] 192 ]
352 }, 193 },
194 "icon": "https://image.nostr.build/30acdce4a81926f386622a07343228ae99fa68d012d54c538c0b2129dffe400c.png",
353 "limitation": { 195 "limitation": {
354 "auth_required": false, 196 "auth_required": false,
355 "max_message_length": 70000, 197 "created_at_lower_limit": 94608000,
356 "max_subid_length": 256, 198 "created_at_upper_limit": 300,
357 "max_subscriptions": 350, 199 "max_event_tags": 4000,
200 "max_limit": 1000,
201 "max_message_length": 524288,
202 "max_subid_length": 71,
203 "max_subscriptions": 50,
358 "min_pow_difficulty": 0, 204 "min_pow_difficulty": 0,
359 "payment_required": true, 205 "payment_required": true,
360 "restricted_writes": true, 206 "restricted_writes": true
207 },
208 "name": "nostr.wine",
209 "payments_url": "https://nostr.wine/invoices",
210 "pubkey": "4918eb332a41b71ba9a74b1dc64276cfff592e55107b93baae38af3520e55975",
211 "software": "https://nostr.wine",
212 "supported_nips": [ 1, 2, 4, 9, 11, 40, 42, 50, 70, 77 ],
213 "terms_of_service": "https://nostr.wine/terms",
214 "version": "0.3.3"
215}
216
217~> curl -H "Accept: application/nostr+json" https://nostr.land | jq
218{
219 "description": "[✨ NFDB] nostr.land family of relays (fi-01 [tiger])",
220 "name": "[✨ NFDB] nostr.land",
221 "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
222 "software": "NFDB",
223 "icon": "https://i.nostr.build/b3thno790aodH8lE.jpg",
224 "supported_nips": [ 1, 2, 4, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 42, 44, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 65, 68, 69, 71, 72, 73, 75, 78, 84, 88, 89, 90, 92, 99 ],
225 "version": "1.0.0",
226 "limitation": {
227 "payment_required": true,
228 "max_message_length": 65535,
361 "max_event_tags": 2000, 229 "max_event_tags": 2000,
362 "max_content_length": 70000, 230 "max_subscriptions": 200,
363 "created_at_lower_limit": 0, 231 "auth_required": false
364 "created_at_upper_limit": 2147483647, 232 },
365 "default_limit": 500, 233 "payments_url": "https://nostr.land",
366 "max_limit": 5000 234 "fees": {
367 } 235 "subscription": [
236 {
237 "amount": 4000000,
238 "unit": "msats",
239 "period": 2592000
240 }
241 ]
242 },
243 "terms_of_service": "https://nostr.land/terms"
368} 244}
369``` 245```