mirror of
https://github.com/nostr-protocol/nips.git
synced 2024-12-23 00:45:53 -05:00
Add "relays" tag
No need to be a 1-char (indexed) tag. Relays is just a list of recommended relays for the whole channel. Owner can change this in the META changes or when doing 404 key rotations.
This commit is contained in:
parent
74a4105281
commit
95173c44d3
38
112.md
38
112.md
|
@ -44,11 +44,14 @@ This is akin to NIP-28, kind 40 but using gift-wrap encryption.
|
|||
|
||||
On creating a channel, the creator MUST also generate a unique/new private-public key pair which will serve as the `shared-secret` for a given channel.
|
||||
|
||||
This is the "destination pubkey" for the channel creation.
|
||||
This is the "destination pubkey" for the channel creation.
|
||||
|
||||
A list of recommended relays SHOULD be added to the channel-create message
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}",
|
||||
"tags": [["relays", "wss://relay-01", "wss://relay-02", ...]]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -67,7 +70,7 @@ Invitations are sent directly to the participants of the channel.
|
|||
```json
|
||||
{
|
||||
"content": "optional personalized invitation message",
|
||||
"tags": [["e", <channel-create-event-id> <relay-urls>], ["privkey": [<channel-private-key>]]
|
||||
"tags": [["e", "channel-create-event-id", "relay-url"], ["privkey", "channel-private-key"]]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -96,13 +99,15 @@ Clients SHOULD support basic metadata fields:
|
|||
Clients MAY add additional metadata fields.
|
||||
|
||||
Clients MUST specify an "e" tag to identify the channel id.
|
||||
Clients SHOULD mark the "e" tag to recommend a relay.
|
||||
Clients SHOULD mark the "e" tag to recommend a relay where the original event can be found.
|
||||
Clients MAY replace the "relays" tag with a full list of new relays.
|
||||
|
||||
There need be no overlap between the "e" relay and the "relays" list. For example, if a chat channel is moving its relay set to a new set.
|
||||
|
||||
```json
|
||||
{
|
||||
"content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}",
|
||||
"tags": [["e", <channel-wrapped-400-event-id> <relay-url>]],
|
||||
...
|
||||
"tags": [["e", "<channel-wrapped-400-event-id>", "wss://relay-url"]],
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -122,8 +127,7 @@ Inner-root message:
|
|||
```json
|
||||
{
|
||||
"content": <string>,
|
||||
"tags": [["e", <kind_400_event_id>, <relay-url-where-it-was-seen>, "root"], <optional expiration tag>]
|
||||
...
|
||||
"tags": [["e", "<kind_400_event_id>", "<relay-url-where-it-was-seen>", "root"], "<optional expiration tag>"]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -133,12 +137,10 @@ Inner-reply to another message:
|
|||
{
|
||||
"content": <string>,
|
||||
"tags": [
|
||||
["e", <kind_400_event_id>, <relay-url>, "root"],
|
||||
["e", <kind_403_reply_to_event_id>, <relay-url>, "reply"],
|
||||
["p", <pubkey>, <relay-url>],
|
||||
...
|
||||
],
|
||||
...
|
||||
["e", "<kind_400_event_id>", "<relay-url>", "root"],
|
||||
["e", "<kind_403_reply_to_event_id>", "<relay-url>", "reply"],
|
||||
["p", "<pubkey>", "<relay-url>"]
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -155,7 +157,11 @@ Then the creator sends out a kind 404 individually to every member of the new gr
|
|||
```json
|
||||
{
|
||||
"content": "optional friendly invite message",
|
||||
"tags": [["e", <previous-kind-400>, <relay-url>], ["e", <new-kind-400>, <relay-url>], ["privkey", [<channel-private-key>]]
|
||||
"tags": [
|
||||
["e", "<previous-kind-400>", "<relay-url>"],
|
||||
["e", "<new-kind-400>", "<relay-url>"],
|
||||
["privkey", "<channel-private-key>"]
|
||||
]
|
||||
}
|
||||
```
|
||||
Clients SHOULD ignore wrapped-kind 404 messages from anyone but the current owner of a group.
|
||||
|
@ -175,7 +181,7 @@ To do, this the creator of the group sends out a wrapped-kind 405 to the main gr
|
|||
```json
|
||||
{
|
||||
"content": "optional friendly invitation to own the group",
|
||||
"tags": [["e", <400-event-id-of-group>, <relay-url>], ["p", <public-key-of-delegate>]]
|
||||
"tags": [["e", "<400-event-id-of-group>", "<relay-url>"], ["p", "<public-key-of-delegate>"]]
|
||||
}
|
||||
```
|
||||
Clients SHOULD ignore wrapped-kind 405 messages from anyone but the current "owner" of a group.
|
||||
|
@ -188,7 +194,7 @@ To do, this the creator of the group sends out a wrapped-kind 405 to the main gr
|
|||
```json
|
||||
{
|
||||
"content": "optional friendly hey, i'm in charge",
|
||||
"tags": [["e", <event-id-of-405>, <relay-url>]]
|
||||
"tags": [["e", "<event-id-of-405>", "<relay-url>]"]
|
||||
}
|
||||
```
|
||||
Clients SHOULD ignore wrapped-kind 406 messages unless they are signed by the delegate in the associated 405 message
|
||||
|
|
Loading…
Reference in New Issue
Block a user