NIP-11: pay to relay update and enhancment

This commit is contained in:
kehiy 2024-09-03 14:47:39 +03:30
parent b4a2561df7
commit 4a52533674

145
11.md
View File

@ -37,7 +37,7 @@ Detailed plain-text information about the relay may be contained in the `descrip
### 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-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. An administrative contact may be listed with a `pubkey`, in the same format as the 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.
Relay operators have no obligation to respond to direct messages. Relay operators have no obligation to respond to direct messages.
@ -66,7 +66,7 @@ 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
are rejected or fail immediately. are rejected or fail immediately.
```json ```jsonc
{ {
"limitation": { "limitation": {
"max_message_length": 16384, "max_message_length": 16384,
@ -83,7 +83,7 @@ are rejected or fail immediately.
"created_at_lower_limit": 31536000, "created_at_lower_limit": 31536000,
"created_at_upper_limit": 3 "created_at_upper_limit": 3
}, },
... // ...
} }
``` ```
@ -146,18 +146,52 @@ Retention times are given in seconds, with `null` indicating infinity.
If zero is provided, this means the event will not be stored at If zero is provided, this means the event will not be stored at
all, and preferably an error will be provided when those are received. all, and preferably an error will be provided when those are received.
```json ```jsonc
{ {
"retention": [ "retention":[
{"kinds": [0, 1, [5, 7], [40, 49]], "time": 3600}, {
{"kinds": [[40000, 49999]], "time": 100}, "kinds":[
{"kinds": [[30000, 39999]], "count": 1000}, 0,
{"time": 3600, "count": 10000} 1,
[
5,
7
],
[
40,
49
] ]
],
"time":3600
},
{
"kinds":[
[
40000,
49999
]
],
"time":100
},
{
"kinds":[
[
30000,
39999
]
],
"count":1000
},
{
"time":3600,
"count":10000
}
],
// ...
} }
``` ```
`retention` is a list of specifications: each will apply to either all kinds, or - `retention` is a list of specifications: each will apply to either all kinds, or
a subset of kinds. Ranges may be specified for the kind field as a tuple of inclusive a subset of kinds. Ranges may be specified for the kind field as a tuple of inclusive
start and end values. Events of indicated kind (or all) are then limited to a `count` start and end values. Events of indicated kind (or all) are then limited to a `count`
and/or time period. and/or time period.
@ -186,10 +220,10 @@ Users should be able to avoid relays in countries they don't like,
and/or select relays in more favorable zones. Exposing this and/or select relays in more favorable zones. Exposing this
flexibility is up to the client software. flexibility is up to the client software.
```json ```jsonc
{ {
"relay_countries": [ "CA", "US" ], "relay_countries": [ "CA", "US" ],
... // ...
} }
``` ```
@ -208,26 +242,26 @@ local community. This would encourage users to follow the global
feed on that relay, in addition to their usual individual follows. feed on that relay, in addition to their usual individual follows.
To support this goal, relays MAY specify some of the following values. To support this goal, relays MAY specify some of the following values.
```json ```jsonc
{ {
"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",
... // ...
} }
``` ```
- `language_tags` is an ordered list - `language_tags` is an ordered list
of [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) indicating of [IETF language tags](https://en.wikipedia.org/wiki/IETF_language_tag) indicating
the major languages spoken on the relay. the major languages spoken on the relay. `"*"` wildcard can be used for global relays.
- `tags` is a list of limitations on the topics to be discussed. - `tags` is a list of limitations on the topics to be discussed.
For example `sfw-only` indicates that only "Safe For Work" content For example `sfw-only` indicates that only *"Safe For Work"* content
is encouraged on this relay. This relies on assumptions of what the is encouraged on this relay. This relies on assumptions of what the
"work" "community" feels "safe" talking about. In time, a common "work" "community" feels "safe" talking about. In time, a common
set of tags may emerge that allow users to find relays that suit set of tags may emerge that allow users to find relays that suit
their needs, and client software will be able to parse these tags easily. their needs, and client software will be able to parse these tags easily.
The `bitcoin-only` tag indicates that any *altcoin*, *"crypto"* or *blockchain* The `bitcoin-only` tag indicates that any *"altcoin"*, *"crypto"* or *"blockchain"*
comments will be ridiculed without mercy. comments will be ridiculed without mercy.
- `posting_policy` is a link to a human-readable page which specifies the - `posting_policy` is a link to a human-readable page which specifies the
@ -244,38 +278,85 @@ processed by appropriate client software.
Relays that require payments may want to expose their fee schedules. Relays that require payments may want to expose their fee schedules.
```json ```jsonc
{ {
"payments_url": "https://my-relay/payments", "payments_url":"https://example.com/payments",
"fees": { "fees":{
"admission": [{ "amount": 1000000, "unit": "msats" }], "admission":{
"subscription": [{ "amount": 5000000, "unit": "msats", "period": 2592000 }], "amount":1000000,
"publication": [{ "kinds": [4], "amount": 100, "unit": "msats" }], "unit":"msats"
}, },
... "subscription":[
{
"amount":5000000,
"unit":"msats",
"period":2592000 // 1 Month
},
{
"amount":50000000,
"unit":"msats",
"period":31536000 // 1 Year
}
],
"publication":[
{
"kinds":[
4
],
"amount":100,
"unit":"msats"
},
{
"kinds":[
30023 // Long-from content
],
"amount":300,
"unit":"msats"
}
]
},
// ...
} }
``` ```
The `subscription` and `publication` are fee models, their object value and `admission` are fee rules.
- `payments_url` is a link to a human-readable page which user can use to see and/or pay for fees on this relay.
- `fees` includes the list of different fees required for each mode on this relay:
- `admission` is the fee that user need to pay to access to relay, if only `admission` is presented that means only admission fee is required to get access to relay.
- `subscription` is the fee that user have to pay to access the relay for a fixed amount of time. The `period` field is the access time in seconds. If subscription and admission present at the same time, admission fee MUST get paid as well before subscribing. Otherwise only subscription need to get paid.
- `publication` is the fee that user needs to pay per event they publish on this relay. The `kinds` is an array of kinds that need a fee equal to `amount` to get published. A limited/not supported kind SHOULD NOT be presented and each kind or range of kinds can be presented in one or more publication fee rules. If publication and subscription models are present at the same time, subscription fee needs to get paid first.
- `unit` in each fee rule can be set to `BTC`, `sats` and `msats` and can be a float number for `BTC`.
Access means user can post anything on relay based on its limitation/policies document. The models/rules can be omitted as well.
### 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 ```jsonc
{ {
"icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg", "icon": "https://nostr.build/i/53866b44135a27d624e99c6165cabd76ac8f72797209700acb189fce75021f47.jpg",
... // ...
} }
``` ```
### Examples ### Examples
As of 2 May 2023 the following command provided these results: As of 3 September 2024 the following command provided these results:
```bash
$ curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
``` ```
~> curl -H "Accept: application/nostr+json" https://eden.nostr.land | jq
```json
{ {
"description": "nostr.land family of relays (us-or-01)", "description": "nostr.land family of relays (fi-01 [tiger])",
"name": "nostr.land", "name": "nostr.land",
"pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd", "pubkey": "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
"software": "custom", "software": "custom",
@ -301,14 +382,16 @@ As of 2 May 2023 the following command provided these results:
"max_subscriptions": 20, "max_subscriptions": 20,
"auth_required": false "auth_required": false
}, },
"payments_url": "https://eden.nostr.land", "payments_url": "https://nostr.land",
"fees": { "fees": {
"subscription": [ "subscription": [
{ {
"amount": 2500000, "amount": 4000000,
"unit": "msats", "unit": "msats",
"period": 2592000 "period": 2592000
} }
] ]
}, },
"canonical_url": "wss://eden.nostr.land"
} }
```