mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-11-09 22:09:06 -05:00
reformat NIP-11.
This commit is contained in:
parent
33e7650bab
commit
b5b46b629f
154
11.md
154
11.md
|
@ -25,42 +25,42 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application
|
||||||
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.
|
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.
|
||||||
|
|
||||||
Field Descriptions
|
Field Descriptions
|
||||||
-----------------
|
------------------
|
||||||
|
|
||||||
### Name ###
|
### Name
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Description ###
|
### Description
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Pubkey ###
|
### Pubkey
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
Relay operators have no obligation to respond to direct messages.
|
Relay operators have no obligation to respond to direct messages.
|
||||||
|
|
||||||
### Contact ###
|
### Contact
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Supported NIPs ###
|
### Supported NIPs
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
### Software ###
|
### Software
|
||||||
|
|
||||||
The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage.
|
The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage.
|
||||||
|
|
||||||
### Version ###
|
### Version
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
Extra Fields
|
Extra Fields
|
||||||
-----------------
|
------------
|
||||||
|
|
||||||
### Server Limitations ###
|
### Server Limitations
|
||||||
|
|
||||||
These are limitations imposed by the relay on clients. Your client
|
These are limitations imposed by the relay on clients. Your client
|
||||||
should expect that requests which exceed these *practical* limitations
|
should expect that requests which exceed these *practical* limitations
|
||||||
|
@ -68,22 +68,21 @@ are rejected or fail immediately.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"limitation": {
|
"limitation": {
|
||||||
"max_message_length": 16384,
|
"max_message_length": 16384,
|
||||||
"max_subscriptions": 20,
|
"max_subscriptions": 20,
|
||||||
"max_filters": 100,
|
"max_filters": 100,
|
||||||
"max_limit": 5000,
|
"max_limit": 5000,
|
||||||
"max_subid_length": 100,
|
"max_subid_length": 100,
|
||||||
"max_event_tags": 100,
|
"max_event_tags": 100,
|
||||||
"max_content_length": 8196,
|
"max_content_length": 8196,
|
||||||
"min_pow_difficulty": 30,
|
"min_pow_difficulty": 30,
|
||||||
"auth_required": true,
|
"auth_required": true,
|
||||||
"payment_required": true,
|
"payment_required": true,
|
||||||
"created_at_lower_limit":31536000,
|
"created_at_lower_limit": 31536000,
|
||||||
"created_at_upper_limit":3,
|
"created_at_upper_limit": 3
|
||||||
}
|
}
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -129,7 +128,7 @@ Even if set to False, authentication may be required for specific actions.
|
||||||
|
|
||||||
- `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md)
|
- `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md)
|
||||||
|
|
||||||
### Event Retention ###
|
### Event Retention
|
||||||
|
|
||||||
There may be a cost associated with storing data forever, so relays
|
There may be a cost associated with storing data forever, so relays
|
||||||
may wish to state retention times. The values stated here are defaults
|
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.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
|
||||||
"retention": [
|
"retention": [
|
||||||
{ "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 },
|
{"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600},
|
||||||
{ "kinds": [[40000, 49999]], "time": 100 },
|
{"kinds": [[40000, 49999]], "time": 100},
|
||||||
{ "kinds": [[30000, 39999]], "count": 1000 },
|
{"kinds": [[30000, 39999]], "count": 1000},
|
||||||
{ "time": 3600, "count": 10000 }
|
{"time": 3600, "count": 10000}
|
||||||
]
|
]
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -165,8 +162,7 @@ support their protocol quickly via a single HTTP fetch.
|
||||||
|
|
||||||
There is no need to specify retention times for _ephemeral events_ since they are not retained.
|
There is no need to specify retention times for _ephemeral events_ since they are not retained.
|
||||||
|
|
||||||
|
### Content Limitations
|
||||||
### Content Limitations ###
|
|
||||||
|
|
||||||
Some relays may be governed by the arbitrary laws of a nation state. This
|
Some relays may be governed by the arbitrary laws of a nation state. This
|
||||||
may limit what content can be stored in cleartext on those relays. All
|
may limit what content can be stored in cleartext on those relays. All
|
||||||
|
@ -185,9 +181,8 @@ flexibility is up to the client software.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"relay_countries": [ "CA", "US" ],
|
"relay_countries": [ "CA", "US" ]
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -199,7 +194,7 @@ country of the legal entities who own the relay, so it's very
|
||||||
likely a number of countries are involved.
|
likely a number of countries are involved.
|
||||||
|
|
||||||
|
|
||||||
### Community Preferences ###
|
### Community Preferences
|
||||||
|
|
||||||
For public text notes at least, a relay may try to foster a
|
For public text notes at least, a relay may try to foster a
|
||||||
local community. This would encourage users to follow the global
|
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.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"language_tags": [ "en", "en-419" ],
|
"language_tags": [ "en", "en-419" ],
|
||||||
"tags": [ "sfw-only", "bitcoin-only", "anime" ],
|
"tags": [ "sfw-only", "bitcoin-only", "anime" ],
|
||||||
"posting_policy": "https://example.com/posting-policy.html",
|
"posting_policy": "https://example.com/posting-policy.html"
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -239,59 +233,75 @@ detail and legal terms. Use the `tags` field to signify limitations
|
||||||
on content, or topics to be discussed, which could be machine
|
on content, or topics to be discussed, which could be machine
|
||||||
processed by appropriate client software.
|
processed by appropriate client software.
|
||||||
|
|
||||||
### Pay-To-Relay ###
|
### Pay-to-Relay
|
||||||
|
|
||||||
Relays that require payments may want to expose their fee schedules.
|
Relays that require payments may want to expose their fee schedules.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"payments_url": "https://my-relay/payments",
|
"payments_url": "https://my-relay/payments",
|
||||||
"fees": {
|
"fees": {
|
||||||
"admission": [{ "amount": 1000000, "unit": "msats" }],
|
"admission": [{ "amount": 1000000, "unit": "msats" }],
|
||||||
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
|
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
|
||||||
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
|
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
|
||||||
},
|
}
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Icon ###
|
### Icon
|
||||||
|
|
||||||
A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape.
|
A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
|
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
|
||||||
...
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples ###
|
### Examples
|
||||||
As of 2 May 2023 the following `curl` command provided these results.
|
|
||||||
|
|
||||||
>curl -H "Accept: application/nostr+json" https://eden.nostr.land
|
As of 2 May 2023 the following command provided these results:
|
||||||
|
|
||||||
{"name":"eden.nostr.land",
|
```
|
||||||
"description":"Eden Nostr Land - Toronto 1-01",
|
~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
|
||||||
"pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700",
|
|
||||||
"contact":"me@ricardocabral.io",
|
{
|
||||||
"supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40],
|
"description": "nostr.land family of relays (us-or-01)",
|
||||||
"supported_nip_extensions":["11a"],
|
"name": "nostr.land",
|
||||||
"software":"git+https://github.com/Cameri/nostream.git",
|
"pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
|
||||||
"version":"1.22.6",
|
"software": "custom",
|
||||||
"limitation":{"max_message_length":1048576,
|
"supported_nips": [
|
||||||
"max_subscriptions":10,
|
1,
|
||||||
"max_filters":2500,
|
2,
|
||||||
"max_limit":5000,
|
4,
|
||||||
"max_subid_length":256,
|
9,
|
||||||
"max_event_tags":2500,
|
11,
|
||||||
"max_content_length":65536,
|
12,
|
||||||
"min_pow_difficulty":0,
|
16,
|
||||||
"auth_required":false,
|
20,
|
||||||
"payment_required":true},
|
22,
|
||||||
"payments_url":"https://eden.nostr.land/invoices",
|
28,
|
||||||
"fees":{"admission":[{"amount":5000000,"unit":"msats"}],
|
33,
|
||||||
"publication":[]}},
|
40
|
||||||
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg"
|
],
|
||||||
|
"version": "1.0.1",
|
||||||
|
"limitation": {
|
||||||
|
"payment_required": true,
|
||||||
|
"max_message_length": 65535,
|
||||||
|
"max_event_tags": 2000,
|
||||||
|
"max_subscriptions": 20,
|
||||||
|
"auth_required": false
|
||||||
|
},
|
||||||
|
"payments_url": "https://eden.nostr.land",
|
||||||
|
"fees": {
|
||||||
|
"subscription": [
|
||||||
|
{
|
||||||
|
"amount": 2500000,
|
||||||
|
"unit": "msats",
|
||||||
|
"period": 2592000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user