From 95173c44d3def4f52f60e518bba2ea8048c2a3d7 Mon Sep 17 00:00:00 2001 From: earonesty Date: Mon, 5 Jun 2023 03:43:41 -0700 Subject: [PATCH] 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. --- 112.md | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/112.md b/112.md index 17b6db3..a619cf4 100644 --- a/112.md +++ b/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", ], ["privkey": []] + "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", ]], - ... + "tags": [["e", "", "wss://relay-url"]], } ``` @@ -122,8 +127,7 @@ Inner-root message: ```json { "content": , - "tags": [["e", , , "root"], ] - ... + "tags": [["e", "", "", "root"], ""] } ``` @@ -133,12 +137,10 @@ Inner-reply to another message: { "content": , "tags": [ - ["e", , , "root"], - ["e", , , "reply"], - ["p", , ], - ... - ], - ... + ["e", "", "", "root"], + ["e", "", "", "reply"], + ["p", "", ""] + ] } ``` @@ -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", , ], ["e", , ], ["privkey", []] + "tags": [ + ["e", "", ""], + ["e", "", ""], + ["privkey", ""] + ] } ``` 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>, ], ["p", ]] + "tags": [["e", "<400-event-id-of-group>", ""], ["p", ""]] } ``` 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", , ]] + "tags": [["e", "", "]"] } ``` Clients SHOULD ignore wrapped-kind 406 messages unless they are signed by the delegate in the associated 405 message