diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2023-11-18 08:21:15 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2023-11-18 08:21:15 -0300 |
| commit | b5b46b629fb1b4dae4780d8d165bddd68d4cda68 (patch) | |
| tree | fe5efd3ade37694c2b674784212908a942b28057 | |
| parent | 33e7650bab299b980e053e8c44e93fb895dc4df5 (diff) | |
reformat NIP-11.
| -rw-r--r-- | 11.md | 158 |
1 files changed, 84 insertions, 74 deletions
| @@ -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,21 @@ are rejected or fail immediately. | |||
| 68 | 68 | ||
| 69 | ```json | 69 | ```json |
| 70 | { | 70 | { |
| 71 | ... | 71 | ... |
| 72 | "limitation": { | 72 | "limitation": { |
| 73 | "max_message_length": 16384, | 73 | "max_message_length": 16384, |
| 74 | "max_subscriptions": 20, | 74 | "max_subscriptions": 20, |
| 75 | "max_filters": 100, | 75 | "max_filters": 100, |
| 76 | "max_limit": 5000, | 76 | "max_limit": 5000, |
| 77 | "max_subid_length": 100, | 77 | "max_subid_length": 100, |
| 78 | "max_event_tags": 100, | 78 | "max_event_tags": 100, |
| 79 | "max_content_length": 8196, | 79 | "max_content_length": 8196, |
| 80 | "min_pow_difficulty": 30, | 80 | "min_pow_difficulty": 30, |
| 81 | "auth_required": true, | 81 | "auth_required": true, |
| 82 | "payment_required": true, | 82 | "payment_required": true, |
| 83 | "created_at_lower_limit":31536000, | 83 | "created_at_lower_limit": 31536000, |
| 84 | "created_at_upper_limit":3, | 84 | "created_at_upper_limit": 3 |
| 85 | } | 85 | } |
| 86 | ... | ||
| 87 | } | 86 | } |
| 88 | ``` | 87 | ``` |
| 89 | 88 | ||
| @@ -129,7 +128,7 @@ Even if set to False, authentication may be required for specific actions. | |||
| 129 | 128 | ||
| 130 | - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) | 129 | - `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md) |
| 131 | 130 | ||
| 132 | ### Event Retention ### | 131 | ### Event Retention |
| 133 | 132 | ||
| 134 | There may be a cost associated with storing data forever, so relays | 133 | 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 | 134 | may wish to state retention times. The values stated here are defaults |
| @@ -142,14 +141,12 @@ all, and preferably an error will be provided when those are received. | |||
| 142 | 141 | ||
| 143 | ```json | 142 | ```json |
| 144 | { | 143 | { |
| 145 | ... | ||
| 146 | "retention": [ | 144 | "retention": [ |
| 147 | { "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 }, | 145 | {"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600}, |
| 148 | { "kinds": [[40000, 49999]], "time": 100 }, | 146 | {"kinds": [[40000, 49999]], "time": 100}, |
| 149 | { "kinds": [[30000, 39999]], "count": 1000 }, | 147 | {"kinds": [[30000, 39999]], "count": 1000}, |
| 150 | { "time": 3600, "count": 10000 } | 148 | {"time": 3600, "count": 10000} |
| 151 | ] | 149 | ] |
| 152 | ... | ||
| 153 | } | 150 | } |
| 154 | ``` | 151 | ``` |
| 155 | 152 | ||
| @@ -165,8 +162,7 @@ support their protocol quickly via a single HTTP fetch. | |||
| 165 | 162 | ||
| 166 | There is no need to specify retention times for _ephemeral events_ since they are not retained. | 163 | There is no need to specify retention times for _ephemeral events_ since they are not retained. |
| 167 | 164 | ||
| 168 | 165 | ### Content Limitations | |
| 169 | ### Content Limitations ### | ||
| 170 | 166 | ||
| 171 | Some relays may be governed by the arbitrary laws of a nation state. This | 167 | 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 | 168 | may limit what content can be stored in cleartext on those relays. All |
| @@ -185,9 +181,8 @@ flexibility is up to the client software. | |||
| 185 | 181 | ||
| 186 | ```json | 182 | ```json |
| 187 | { | 183 | { |
| 188 | ... | 184 | ... |
| 189 | "relay_countries": [ "CA", "US" ], | 185 | "relay_countries": [ "CA", "US" ] |
| 190 | ... | ||
| 191 | } | 186 | } |
| 192 | ``` | 187 | ``` |
| 193 | 188 | ||
| @@ -199,7 +194,7 @@ country of the legal entities who own the relay, so it's very | |||
| 199 | likely a number of countries are involved. | 194 | likely a number of countries are involved. |
| 200 | 195 | ||
| 201 | 196 | ||
| 202 | ### Community Preferences ### | 197 | ### Community Preferences |
| 203 | 198 | ||
| 204 | For public text notes at least, a relay may try to foster a | 199 | For public text notes at least, a relay may try to foster a |
| 205 | local community. This would encourage users to follow the global | 200 | local community. This would encourage users to follow the global |
| @@ -208,11 +203,10 @@ To support this goal, relays MAY specify some of the following values. | |||
| 208 | 203 | ||
| 209 | ```json | 204 | ```json |
| 210 | { | 205 | { |
| 211 | ... | 206 | ... |
| 212 | "language_tags": [ "en", "en-419" ], | 207 | "language_tags": [ "en", "en-419" ], |
| 213 | "tags": [ "sfw-only", "bitcoin-only", "anime" ], | 208 | "tags": [ "sfw-only", "bitcoin-only", "anime" ], |
| 214 | "posting_policy": "https://example.com/posting-policy.html", | 209 | "posting_policy": "https://example.com/posting-policy.html" |
| 215 | ... | ||
| 216 | } | 210 | } |
| 217 | ``` | 211 | ``` |
| 218 | 212 | ||
| @@ -239,59 +233,75 @@ detail and legal terms. Use the `tags` field to signify limitations | |||
| 239 | on content, or topics to be discussed, which could be machine | 233 | on content, or topics to be discussed, which could be machine |
| 240 | processed by appropriate client software. | 234 | processed by appropriate client software. |
| 241 | 235 | ||
| 242 | ### Pay-To-Relay ### | 236 | ### Pay-to-Relay |
| 243 | 237 | ||
| 244 | Relays that require payments may want to expose their fee schedules. | 238 | Relays that require payments may want to expose their fee schedules. |
| 245 | 239 | ||
| 246 | ```json | 240 | ```json |
| 247 | { | 241 | { |
| 248 | ... | 242 | ... |
| 249 | "payments_url": "https://my-relay/payments", | 243 | "payments_url": "https://my-relay/payments", |
| 250 | "fees": { | 244 | "fees": { |
| 251 | "admission": [{ "amount": 1000000, "unit": "msats" }], | 245 | "admission": [{ "amount": 1000000, "unit": "msats" }], |
| 252 | "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], | 246 | "subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], |
| 253 | "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], | 247 | "publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], |
| 254 | }, | 248 | } |
| 255 | ... | ||
| 256 | } | 249 | } |
| 257 | ``` | 250 | ``` |
| 258 | 251 | ||
| 259 | ### Icon ### | 252 | ### Icon |
| 260 | 253 | ||
| 261 | A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape. | 254 | A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape. |
| 262 | 255 | ||
| 263 | ```json | 256 | ```json |
| 264 | { | 257 | { |
| 265 | ... | 258 | ... |
| 266 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", | 259 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", |
| 267 | ... | ||
| 268 | } | 260 | } |
| 269 | ``` | 261 | ``` |
| 270 | 262 | ||
| 271 | ### Examples ### | 263 | ### Examples |
| 272 | As of 2 May 2023 the following `curl` command provided these results. | 264 | |
| 273 | 265 | As of 2 May 2023 the following command provided these results: | |
| 274 | >curl -H "Accept: application/nostr+json" https://eden.nostr.land | 266 | |
| 275 | 267 | ``` | |
| 276 | {"name":"eden.nostr.land", | 268 | ~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq |
| 277 | "description":"Eden Nostr Land - Toronto 1-01", | 269 | |
| 278 | "pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700", | 270 | { |
| 279 | "contact":"me@ricardocabral.io", | 271 | "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], | 272 | "name": "nostr.land", |
| 281 | "supported_nip_extensions":["11a"], | 273 | "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd", |
| 282 | "software":"git+https://github.com/Cameri/nostream.git", | 274 | "software": "custom", |
| 283 | "version":"1.22.6", | 275 | "supported_nips": [ |
| 284 | "limitation":{"max_message_length":1048576, | 276 | 1, |
| 285 | "max_subscriptions":10, | 277 | 2, |
| 286 | "max_filters":2500, | 278 | 4, |
| 287 | "max_limit":5000, | 279 | 9, |
| 288 | "max_subid_length":256, | 280 | 11, |
| 289 | "max_event_tags":2500, | 281 | 12, |
| 290 | "max_content_length":65536, | 282 | 16, |
| 291 | "min_pow_difficulty":0, | 283 | 20, |
| 292 | "auth_required":false, | 284 | 22, |
| 293 | "payment_required":true}, | 285 | 28, |
| 294 | "payments_url":"https://eden.nostr.land/invoices", | 286 | 33, |
| 295 | "fees":{"admission":[{"amount":5000000,"unit":"msats"}], | 287 | 40 |
| 296 | "publication":[]}}, | 288 | ], |
| 297 | "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg" | 289 | "version": "1.0.1", |
| 290 | "limitation": { | ||
| 291 | "payment_required": true, | ||
| 292 | "max_message_length": 65535, | ||
| 293 | "max_event_tags": 2000, | ||
| 294 | "max_subscriptions": 20, | ||
| 295 | "auth_required": false | ||
| 296 | }, | ||
| 297 | "payments_url": "https://eden.nostr.land", | ||
| 298 | "fees": { | ||
| 299 | "subscription": [ | ||
| 300 | { | ||
| 301 | "amount": 2500000, | ||
| 302 | "unit": "msats", | ||
| 303 | "period": 2592000 | ||
| 304 | } | ||
| 305 | ] | ||
| 306 | }, | ||
| 307 | } | ||