diff options
Diffstat (limited to '28.md')
| -rw-r--r-- | 28.md | 58 |
1 files changed, 29 insertions, 29 deletions
| @@ -5,7 +5,7 @@ NIP-28 | |||
| 5 | Public Chat | 5 | Public Chat |
| 6 | ----------- | 6 | ----------- |
| 7 | 7 | ||
| 8 | `draft` `optional` `author:ChristopherDavid` `author:fiatjaf` `author:jb55` `author:Cameri` | 8 | `draft` `optional` |
| 9 | 9 | ||
| 10 | This NIP defines new event kinds for public chat channels, channel messages, and basic client-side moderation. | 10 | This NIP defines new event kinds for public chat channels, channel messages, and basic client-side moderation. |
| 11 | 11 | ||
| @@ -23,12 +23,12 @@ Client-centric moderation gives client developers discretion over what types of | |||
| 23 | 23 | ||
| 24 | Create a public chat channel. | 24 | Create a public chat channel. |
| 25 | 25 | ||
| 26 | In the channel creation `content` field, Client SHOULD include basic channel metadata (`name`, `about`, `picture` as specified in kind 41). | 26 | In the channel creation `content` field, Client SHOULD include basic channel metadata (`name`, `about`, `picture` and `relays` as specified in kind 41). |
| 27 | 27 | ||
| 28 | ```json | 28 | ```json |
| 29 | { | 29 | { |
| 30 | "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\"}", | 30 | "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}", |
| 31 | ... | 31 | ... |
| 32 | } | 32 | } |
| 33 | ``` | 33 | ``` |
| 34 | 34 | ||
| @@ -37,7 +37,7 @@ In the channel creation `content` field, Client SHOULD include basic channel met | |||
| 37 | 37 | ||
| 38 | Update a channel's public metadata. | 38 | Update a channel's public metadata. |
| 39 | 39 | ||
| 40 | Clients and relays SHOULD handle kind 41 events similar to kind 0 `metadata` events. | 40 | Kind 41 is used to update the metadata without modifying the event id for the channel. Only the most recent kind 41 per `e` tag value MAY be available. |
| 41 | 41 | ||
| 42 | Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey. | 42 | Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey. |
| 43 | 43 | ||
| @@ -46,6 +46,7 @@ Clients SHOULD support basic metadata fields: | |||
| 46 | - `name` - string - Channel name | 46 | - `name` - string - Channel name |
| 47 | - `about` - string - Channel description | 47 | - `about` - string - Channel description |
| 48 | - `picture` - string - URL of channel picture | 48 | - `picture` - string - URL of channel picture |
| 49 | - `relays` - array - List of relays to download and broadcast events to | ||
| 49 | 50 | ||
| 50 | Clients MAY add additional metadata fields. | 51 | Clients MAY add additional metadata fields. |
| 51 | 52 | ||
| @@ -53,9 +54,9 @@ Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay. | |||
| 53 | 54 | ||
| 54 | ```json | 55 | ```json |
| 55 | { | 56 | { |
| 56 | "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\"}", | 57 | "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}", |
| 57 | "tags": [["e", <channel_create_event_id>, <relay-url>]], | 58 | "tags": [["e", <channel_create_event_id>, <relay-url>]], |
| 58 | ... | 59 | ... |
| 59 | } | 60 | } |
| 60 | ``` | 61 | ``` |
| 61 | 62 | ||
| @@ -72,9 +73,9 @@ Root message: | |||
| 72 | 73 | ||
| 73 | ```json | 74 | ```json |
| 74 | { | 75 | { |
| 75 | "content": <string>, | 76 | "content": <string>, |
| 76 | "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]], | 77 | "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]], |
| 77 | ... | 78 | ... |
| 78 | } | 79 | } |
| 79 | ``` | 80 | ``` |
| 80 | 81 | ||
| @@ -82,14 +83,14 @@ Reply to another message: | |||
| 82 | 83 | ||
| 83 | ```json | 84 | ```json |
| 84 | { | 85 | { |
| 85 | "content": <string>, | 86 | "content": <string>, |
| 86 | "tags": [ | 87 | "tags": [ |
| 87 | ["e", <kind_40_event_id>, <relay-url>, "root"], | 88 | ["e", <kind_40_event_id>, <relay-url>, "root"], |
| 88 | ["e", <kind_42_event_id>, <relay-url>, "reply"], | 89 | ["e", <kind_42_event_id>, <relay-url>, "reply"], |
| 89 | ["p", <pubkey>, <relay-url>], | 90 | ["p", <pubkey>, <relay-url>], |
| 90 | ... | 91 | ... |
| 91 | ], | 92 | ], |
| 92 | ... | 93 | ... |
| 93 | } | 94 | } |
| 94 | ``` | 95 | ``` |
| 95 | 96 | ||
| @@ -108,9 +109,9 @@ Clients MAY hide event 42s for other users other than the user who sent the even | |||
| 108 | 109 | ||
| 109 | ```json | 110 | ```json |
| 110 | { | 111 | { |
| 111 | "content": "{\"reason\": \"Dick pic\"}", | 112 | "content": "{\"reason\": \"Dick pic\"}", |
| 112 | "tags": [["e", <kind_42_event_id>]], | 113 | "tags": [["e", <kind_42_event_id>]], |
| 113 | ... | 114 | ... |
| 114 | } | 115 | } |
| 115 | ``` | 116 | ``` |
| 116 | 117 | ||
| @@ -126,18 +127,17 @@ Clients MAY hide event 42s for users other than the user who sent the event 44. | |||
| 126 | 127 | ||
| 127 | ```json | 128 | ```json |
| 128 | { | 129 | { |
| 129 | "content": "{\"reason\": \"Posting dick pics\"}", | 130 | "content": "{\"reason\": \"Posting dick pics\"}", |
| 130 | "tags": [["p", <pubkey>]], | 131 | "tags": [["p", <pubkey>]], |
| 131 | ... | 132 | ... |
| 132 | } | 133 | } |
| 133 | ``` | 134 | ``` |
| 134 | 135 | ||
| 135 | ## NIP-10 relay recommendations | 136 | ## Relay recommendations |
| 136 | 137 | ||
| 137 | For [NIP-10](10.md) relay recommendations, clients generally SHOULD use the relay URL of the original (oldest) kind 40 event. | 138 | Clients SHOULD use the relay URLs of the metadata events. |
| 138 | |||
| 139 | Clients MAY recommend any relay URL. For example, if a relay hosting the original kind 40 event for a channel goes offline, clients could instead fetch channel data from a backup relay, or a relay that clients trust more than the original relay. | ||
| 140 | 139 | ||
| 140 | Clients MAY use any relay URL. For example, if a relay hosting the original kind 40 event for a channel goes offline, clients could instead fetch channel data from a backup relay, or a relay that clients trust more than the original relay. | ||
| 141 | 141 | ||
| 142 | Motivation | 142 | Motivation |
| 143 | ---------- | 143 | ---------- |