diff options
| author | Pablo Fernandez <p@f7z.io> | 2023-11-23 17:52:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-23 17:52:48 +0200 |
| commit | 60256a62675a165c4d4fd9811a19a9cbf6a9e7fd (patch) | |
| tree | 5c450154d373caafc37f324dd01e20338308c9d6 /11.md | |
| parent | 43d50ee42409252a1313928cd437d55fd7bf7bf4 (diff) | |
| parent | 7822a8b12670312aff104ddc03066425882f739d (diff) | |
Merge branch 'master' into nip88
Diffstat (limited to '11.md')
| -rw-r--r-- | 11.md | 167 |
1 files changed, 92 insertions, 75 deletions
| @@ -4,7 +4,7 @@ NIP-11 | |||
| 4 | Relay Information Document | 4 | Relay Information Document |
| 5 | --------------------------- | 5 | --------------------------- |
| 6 | 6 | ||
| 7 | `draft` `optional` `author:scsibug` `author:doc-hex` `author:cameri` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | Relays 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. | 9 | Relays 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 | ||
| @@ -25,42 +25,42 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application | |||
| 25 | Any field may be omitted, and clients MUST ignore any additional fields they do not understand. Relays MUST accept CORS requests by sending `Access-Control-Allow-Origin`, `Access-Control-Allow-Headers`, and `Access-Control-Allow-Methods` headers. | 25 | Any field may be omitted, and clients MUST ignore any additional fields they do not understand. Relays MUST accept CORS requests by sending `Access-Control-Allow-Origin`, `Access-Control-Allow-Headers`, and `Access-Control-Allow-Methods` headers. |
| 26 | 26 | ||
| 27 | Field Descriptions | 27 | Field Descriptions |
| 28 | ----------------- | 28 | ------------------ |
| 29 | 29 | ||
| 30 | ### Name ### | 30 | ### Name |
| 31 | 31 | ||
| 32 | A 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. | 32 | A 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. |
| 33 | 33 | ||
| 34 | ### Description ### | 34 | ### Description |
| 35 | 35 | ||
| 36 | Detailed 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. | 36 | Detailed 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. |
| 37 | 37 | ||
| 38 | ### Pubkey ### | 38 | ### Pubkey |
| 39 | 39 | ||
| 40 | An 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-04`) to a system administrator. Expected uses of this address are to report abuse or illegal content, file bug reports, or request other technical assistance. | 40 | An 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-04`) to a system administrator. Expected uses of this address are to report abuse or illegal content, file bug reports, or request other technical assistance. |
| 41 | 41 | ||
| 42 | Relay operators have no obligation to respond to direct messages. | 42 | Relay operators have no obligation to respond to direct messages. |
| 43 | 43 | ||
| 44 | ### Contact ### | 44 | ### Contact |
| 45 | 45 | ||
| 46 | An 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. | 46 | An 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. |
| 47 | 47 | ||
| 48 | ### Supported NIPs ### | 48 | ### Supported NIPs |
| 49 | 49 | ||
| 50 | As 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. | 50 | As 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. |
| 51 | 51 | ||
| 52 | ### Software ### | 52 | ### Software |
| 53 | 53 | ||
| 54 | The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage. | 54 | The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage. |
| 55 | 55 | ||
| 56 | ### Version ### | 56 | ### Version |
| 57 | 57 | ||
| 58 | The 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. | 58 | The 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. |
| 59 | 59 | ||
| 60 | Extra Fields | 60 | Extra Fields |
| 61 | ----------------- | 61 | ------------ |
| 62 | 62 | ||
| 63 | ### Server Limitations ### | 63 | ### Server Limitations |
| 64 | 64 | ||
| 65 | These are limitations imposed by the relay on clients. Your client | 65 | These are limitations imposed by the relay on clients. Your client |
| 66 | should expect that requests which exceed these *practical* limitations | 66 | should expect that requests which exceed these *practical* limitations |
| @@ -68,22 +68,22 @@ are rejected or fail immediately. | |||
| 68 | 68 | ||
| 69 | ```json | 69 | ```json |
| 70 | { | 70 | { |
| 71 | ... | ||
| 72 | "limitation": { | 71 | "limitation": { |
| 73 | "max_message_length": 16384, | 72 | "max_message_length": 16384, |
| 74 | "max_subscriptions": 20, | 73 | "max_subscriptions": 20, |
| 75 | "max_filters": 100, | 74 | "max_filters": 100, |
| 76 | "max_limit": 5000, | 75 | "max_limit": 5000, |
| 77 | "max_subid_length": 100, | 76 | "max_subid_length": 100, |
| 78 | "max_event_tags": 100, | 77 | "max_event_tags": 100, |
| 79 | "max_content_length": 8196, | 78 | "max_content_length": 8196, |
| 80 | "min_pow_difficulty": 30, | 79 | "min_pow_difficulty": 30, |
| 81 | "auth_required": true, | 80 | "auth_required": true, |
| 82 | "payment_required": true, | 81 | "payment_required": true, |
| 83 | "created_at_lower_limit":31536000, | 82 | "restricted_writes": true, |
| 84 | "created_at_upper_limit":3, | 83 | "created_at_lower_limit": 31536000, |
| 85 | } | 84 | "created_at_upper_limit": 3 |
| 86 | ... | 85 | }, |
| 86 | ... | ||
| 87 | } | 87 | } |
| 88 | ``` | 88 | ``` |
| 89 | 89 | ||
| @@ -125,11 +125,17 @@ Even if set to False, authentication may be required for specific actions. | |||
| 125 | 125 | ||
| 126 | - `payment_required`: this relay requires payment before a new connection may perform any action. | 126 | - `payment_required`: this relay requires payment before a new connection may perform any action. |
| 127 | 127 | ||
| 128 | - `restricted_writes`: this relay requires some kind of condition to be fulfilled in order to | ||
| 129 | accept events (not necessarily, but including `payment_required` and `min_pow_difficulty`). | ||
| 130 | This should only be set to `true` when users are expected to know the relay policy before trying | ||
| 131 | to write to it -- like belonging to a special pubkey-based whitelist or writing only events of | ||
| 132 | a specific niche kind or content. Normal anti-spam heuristics, for example, do not qualify. | ||
| 133 | |||
| 128 | - `created_at_lower_limit`: 'created_at' lower limit as defined in [NIP-22](22.md) | 134 | - `created_at_lower_limit`: 'created_at' lower limit as defined in [NIP-22](22.md) |
| 129 | 135 | ||
| 130 | - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) | 136 | - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) |
| 131 | 137 | ||
| 132 | ### Event Retention ### | 138 | ### Event Retention |
| 133 | 139 | ||
| 134 | There may be a cost associated with storing data forever, so relays | 140 | There may be a cost associated with storing data forever, so relays |
| 135 | may wish to state retention times. The values stated here are defaults | 141 | may wish to state retention times. The values stated here are defaults |
| @@ -142,14 +148,12 @@ all, and preferably an error will be provided when those are received. | |||
| 142 | 148 | ||
| 143 | ```json | 149 | ```json |
| 144 | { | 150 | { |
| 145 | ... | ||
| 146 | "retention": [ | 151 | "retention": [ |
| 147 | { "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 }, | 152 | {"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600}, |
| 148 | { "kinds": [[40000, 49999]], "time": 100 }, | 153 | {"kinds": [[40000, 49999]], "time": 100}, |
| 149 | { "kinds": [[30000, 39999]], "count": 1000 }, | 154 | {"kinds": [[30000, 39999]], "count": 1000}, |
| 150 | { "time": 3600, "count": 10000 } | 155 | {"time": 3600, "count": 10000} |
| 151 | ] | 156 | ] |
| 152 | ... | ||
| 153 | } | 157 | } |
| 154 | ``` | 158 | ``` |
| 155 | 159 | ||
| @@ -165,8 +169,7 @@ support their protocol quickly via a single HTTP fetch. | |||
| 165 | 169 | ||
| 166 | There is no need to specify retention times for _ephemeral events_ since they are not retained. | 170 | There is no need to specify retention times for _ephemeral events_ since they are not retained. |
| 167 | 171 | ||
| 168 | 172 | ### Content Limitations | |
| 169 | ### Content Limitations ### | ||
| 170 | 173 | ||
| 171 | Some relays may be governed by the arbitrary laws of a nation state. This | 174 | Some relays may be governed by the arbitrary laws of a nation state. This |
| 172 | may limit what content can be stored in cleartext on those relays. All | 175 | may limit what content can be stored in cleartext on those relays. All |
| @@ -185,9 +188,8 @@ flexibility is up to the client software. | |||
| 185 | 188 | ||
| 186 | ```json | 189 | ```json |
| 187 | { | 190 | { |
| 188 | ... | ||
| 189 | "relay_countries": [ "CA", "US" ], | 191 | "relay_countries": [ "CA", "US" ], |
| 190 | ... | 192 | ... |
| 191 | } | 193 | } |
| 192 | ``` | 194 | ``` |
| 193 | 195 | ||
| @@ -199,7 +201,7 @@ country of the legal entities who own the relay, so it's very | |||
| 199 | likely a number of countries are involved. | 201 | likely a number of countries are involved. |
| 200 | 202 | ||
| 201 | 203 | ||
| 202 | ### Community Preferences ### | 204 | ### Community Preferences |
| 203 | 205 | ||
| 204 | For public text notes at least, a relay may try to foster a | 206 | For public text notes at least, a relay may try to foster a |
| 205 | local community. This would encourage users to follow the global | 207 | local community. This would encourage users to follow the global |
| @@ -208,11 +210,10 @@ To support this goal, relays MAY specify some of the following values. | |||
| 208 | 210 | ||
| 209 | ```json | 211 | ```json |
| 210 | { | 212 | { |
| 211 | ... | 213 | "language_tags": ["en", "en-419"], |
| 212 | "language_tags": [ "en", "en-419" ], | 214 | "tags": ["sfw-only", "bitcoin-only", "anime"], |
| 213 | "tags": [ "sfw-only", "bitcoin-only", "anime" ], | ||
| 214 | "posting_policy": "https://example.com/posting-policy.html", | 215 | "posting_policy": "https://example.com/posting-policy.html", |
| 215 | ... | 216 | ... |
| 216 | } | 217 | } |
| 217 | ``` | 218 | ``` |
| 218 | 219 | ||
| @@ -239,59 +240,75 @@ detail and legal terms. Use the `tags` field to signify limitations | |||
| 239 | on content, or topics to be discussed, which could be machine | 240 | on content, or topics to be discussed, which could be machine |
| 240 | processed by appropriate client software. | 241 | processed by appropriate client software. |
| 241 | 242 | ||
| 242 | ### Pay-To-Relay ### | 243 | ### Pay-to-Relay |
| 243 | 244 | ||
| 244 | Relays that require payments may want to expose their fee schedules. | 245 | Relays that require payments may want to expose their fee schedules. |
| 245 | 246 | ||
| 246 | ```json | 247 | ```json |
| 247 | { | 248 | { |
| 248 | ... | ||
| 249 | "payments_url": "https://my-relay/payments", | 249 | "payments_url": "https://my-relay/payments", |
| 250 | "fees": { | 250 | "fees": { |
| 251 | "admission": [{ "amount": 1000000, "unit": "msats" }], | 251 | "admission": [{ "amount": 1000000, "unit": "msats" }], |
| 252 | "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], | 252 | "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], |
| 253 | "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], | 253 | "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], |
| 254 | }, | 254 | }, |
| 255 | ... | 255 | ... |
| 256 | } | 256 | } |
| 257 | ``` | 257 | ``` |
| 258 | 258 | ||
| 259 | ### Icon ### | 259 | ### Icon |
| 260 | 260 | ||
| 261 | A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape. | 261 | A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape. |
| 262 | 262 | ||
| 263 | ```json | 263 | ```json |
| 264 | { | 264 | { |
| 265 | ... | ||
| 266 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", | 265 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", |
| 267 | ... | 266 | ... |
| 268 | } | 267 | } |
| 269 | ``` | 268 | ``` |
| 270 | 269 | ||
| 271 | ### Examples ### | 270 | ### Examples |
| 272 | As of 2 May 2023 the following `curl` command provided these results. | 271 | |
| 273 | 272 | As of 2 May 2023 the following command provided these results: | |
| 274 | >curl -H "Accept: application/nostr+json" https://eden.nostr.land | 273 | |
| 275 | 274 | ``` | |
| 276 | {"name":"eden.nostr.land", | 275 | ~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq |
| 277 | "description":"Eden Nostr Land - Toronto 1-01", | 276 | |
| 278 | "pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700", | 277 | { |
| 279 | "contact":"me@ricardocabral.io", | 278 | "description": "nostr.land family of relays (us-or-01)", |
| 280 | "supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40], | 279 | "name": "nostr.land", |
| 281 | "supported_nip_extensions":["11a"], | 280 | "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd", |
| 282 | "software":"git+https://github.com/Cameri/nostream.git", | 281 | "software": "custom", |
| 283 | "version":"1.22.6", | 282 | "supported_nips": [ |
| 284 | "limitation":{"max_message_length":1048576, | 283 | 1, |
| 285 | "max_subscriptions":10, | 284 | 2, |
| 286 | "max_filters":2500, | 285 | 4, |
| 287 | "max_limit":5000, | 286 | 9, |
| 288 | "max_subid_length":256, | 287 | 11, |
| 289 | "max_event_tags":2500, | 288 | 12, |
| 290 | "max_content_length":65536, | 289 | 16, |
| 291 | "min_pow_difficulty":0, | 290 | 20, |
| 292 | "auth_required":false, | 291 | 22, |
| 293 | "payment_required":true}, | 292 | 28, |
| 294 | "payments_url":"https://eden.nostr.land/invoices", | 293 | 33, |
| 295 | "fees":{"admission":[{"amount":5000000,"unit":"msats"}], | 294 | 40 |
| 296 | "publication":[]}}, | 295 | ], |
| 297 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" | 296 | "version": "1.0.1", |
| 297 | "limitation": { | ||
| 298 | "payment_required": true, | ||
| 299 | "max_message_length": 65535, | ||
| 300 | "max_event_tags": 2000, | ||
| 301 | "max_subscriptions": 20, | ||
| 302 | "auth_required": false | ||
| 303 | }, | ||
| 304 | "payments_url": "https://eden.nostr.land", | ||
| 305 | "fees": { | ||
| 306 | "subscription": [ | ||
| 307 | { | ||
| 308 | "amount": 2500000, | ||
| 309 | "unit": "msats", | ||
| 310 | "period": 2592000 | ||
| 311 | } | ||
| 312 | ] | ||
| 313 | }, | ||
| 314 | } | ||