Skip to content

Commit b5b46b6

Browse files
committed
reformat NIP-11.
1 parent 33e7650 commit b5b46b6

File tree

1 file changed

+84
-74
lines changed

1 file changed

+84
-74
lines changed

11.md

+84-74
Original file line numberDiff line numberDiff line change
@@ -25,65 +25,64 @@ When a relay receives an HTTP(s) request with an `Accept` header of `application
2525
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.
2626

2727
Field Descriptions
28-
-----------------
28+
------------------
2929

30-
### Name ###
30+
### Name
3131

3232
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.
3333

34-
### Description ###
34+
### Description
3535

3636
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.
3737

38-
### Pubkey ###
38+
### Pubkey
3939

4040
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.
4141

4242
Relay operators have no obligation to respond to direct messages.
4343

44-
### Contact ###
44+
### Contact
4545

4646
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.
4747

48-
### Supported NIPs ###
48+
### Supported NIPs
4949

5050
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.
5151

52-
### Software ###
52+
### Software
5353

5454
The relay server implementation MAY be provided in the `software` attribute. If present, this MUST be a URL to the project's homepage.
5555

56-
### Version ###
56+
### Version
5757

5858
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.
5959

6060
Extra Fields
61-
-----------------
61+
------------
6262

63-
### Server Limitations ###
63+
### Server Limitations
6464

6565
These are limitations imposed by the relay on clients. Your client
6666
should expect that requests which exceed these *practical* limitations
6767
are rejected or fail immediately.
6868

6969
```json
7070
{
71-
...
71+
...
7272
"limitation": {
73-
"max_message_length": 16384,
74-
"max_subscriptions": 20,
75-
"max_filters": 100,
76-
"max_limit": 5000,
77-
"max_subid_length": 100,
78-
"max_event_tags": 100,
79-
"max_content_length": 8196,
80-
"min_pow_difficulty": 30,
81-
"auth_required": true,
82-
"payment_required": true,
83-
"created_at_lower_limit":31536000,
84-
"created_at_upper_limit":3,
73+
"max_message_length": 16384,
74+
"max_subscriptions": 20,
75+
"max_filters": 100,
76+
"max_limit": 5000,
77+
"max_subid_length": 100,
78+
"max_event_tags": 100,
79+
"max_content_length": 8196,
80+
"min_pow_difficulty": 30,
81+
"auth_required": true,
82+
"payment_required": true,
83+
"created_at_lower_limit": 31536000,
84+
"created_at_upper_limit": 3
8585
}
86-
...
8786
}
8887
```
8988

@@ -129,7 +128,7 @@ Even if set to False, authentication may be required for specific actions.
129128

130129
- `created_at_upper_limit`: 'created_at' upper limit as defined in [NIP-22](22.md)
131130

132-
### Event Retention ###
131+
### Event Retention
133132

134133
There may be a cost associated with storing data forever, so relays
135134
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.
142141

143142
```json
144143
{
145-
...
146144
"retention": [
147-
{ "kinds": [0, 1, [5, 7], [40, 49]], "time": 3600 },
148-
{ "kinds": [[40000, 49999]], "time": 100 },
149-
{ "kinds": [[30000, 39999]], "count": 1000 },
150-
{ "time": 3600, "count": 10000 }
145+
{"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600},
146+
{"kinds": [[40000, 49999]], "time": 100},
147+
{"kinds": [[30000, 39999]], "count": 1000},
148+
{"time": 3600, "count": 10000}
151149
]
152-
...
153150
}
154151
```
155152

@@ -165,8 +162,7 @@ support their protocol quickly via a single HTTP fetch.
165162

166163
There is no need to specify retention times for _ephemeral events_ since they are not retained.
167164

168-
169-
### Content Limitations ###
165+
### Content Limitations
170166

171167
Some relays may be governed by the arbitrary laws of a nation state. This
172168
may limit what content can be stored in cleartext on those relays. All
@@ -185,9 +181,8 @@ flexibility is up to the client software.
185181

186182
```json
187183
{
188-
...
189-
"relay_countries": [ "CA", "US" ],
190-
...
184+
...
185+
"relay_countries": [ "CA", "US" ]
191186
}
192187
```
193188

@@ -199,7 +194,7 @@ country of the legal entities who own the relay, so it's very
199194
likely a number of countries are involved.
200195

201196

202-
### Community Preferences ###
197+
### Community Preferences
203198

204199
For public text notes at least, a relay may try to foster a
205200
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.
208203

209204
```json
210205
{
211-
...
206+
...
212207
"language_tags": [ "en", "en-419" ],
213208
"tags": [ "sfw-only", "bitcoin-only", "anime" ],
214-
"posting_policy": "https://example.com/posting-policy.html",
215-
...
209+
"posting_policy": "https://example.com/posting-policy.html"
216210
}
217211
```
218212

@@ -239,59 +233,75 @@ detail and legal terms. Use the `tags` field to signify limitations
239233
on content, or topics to be discussed, which could be machine
240234
processed by appropriate client software.
241235

242-
### Pay-To-Relay ###
236+
### Pay-to-Relay
243237

244238
Relays that require payments may want to expose their fee schedules.
245239

246240
```json
247241
{
248-
...
242+
...
249243
"payments_url": "https://my-relay/payments",
250244
"fees": {
251245
"admission": [{ "amount": 1000000, "unit": "msats" }],
252246
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }],
253247
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }],
254-
},
255-
...
248+
}
256249
}
257250
```
258251

259-
### Icon ###
252+
### Icon
260253

261254
A URL pointing to an image to be used as an icon for the relay. Recommended to be squared in shape.
262255

263256
```json
264257
{
265-
...
258+
...
266259
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
267-
...
268260
}
269261
```
270262

271-
### Examples ###
272-
As of 2 May 2023 the following `curl` command provided these results.
273-
274-
>curl -H "Accept: application/nostr+json" https://eden.nostr.land
275-
276-
{"name":"eden.nostr.land",
277-
"description":"Eden Nostr Land - Toronto 1-01",
278-
"pubkey":"00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700",
279-
"contact":"[email protected]",
280-
"supported_nips":[1,2,4,9,11,12,15,16,20,22,26,28,33,40],
281-
"supported_nip_extensions":["11a"],
282-
"software":"git+https://github.com/Cameri/nostream.git",
283-
"version":"1.22.6",
284-
"limitation":{"max_message_length":1048576,
285-
"max_subscriptions":10,
286-
"max_filters":2500,
287-
"max_limit":5000,
288-
"max_subid_length":256,
289-
"max_event_tags":2500,
290-
"max_content_length":65536,
291-
"min_pow_difficulty":0,
292-
"auth_required":false,
293-
"payment_required":true},
294-
"payments_url":"https://eden.nostr.land/invoices",
295-
"fees":{"admission":[{"amount":5000000,"unit":"msats"}],
296-
"publication":[]}},
297-
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg"
263+
### Examples
264+
265+
As of 2 May 2023 the following command provided these results:
266+
267+
```
268+
~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
269+
270+
{
271+
"description": "nostr.land family of relays (us-or-01)",
272+
"name": "nostr.land",
273+
"pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
274+
"software": "custom",
275+
"supported_nips": [
276+
1,
277+
2,
278+
4,
279+
9,
280+
11,
281+
12,
282+
16,
283+
20,
284+
22,
285+
28,
286+
33,
287+
40
288+
],
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+
}

0 commit comments

Comments
 (0)