1> __Warning__ `unrecommended`: try [NIP-29](29.md) instead23NIP-284======56Public Chat7-----------89`draft` `unrecommended` `optional`1011This NIP defines new event kinds for public chat channels, channel messages, and basic client-side moderation.1213It reserves five event kinds (40-44) for immediate use:1415- `40 - channel create`16- `41 - channel metadata`17- `42 - channel message`18- `43 - hide message`19- `44 - mute user`2021Client-centric moderation gives client developers discretion over what types of content they want included in their apps, while imposing no additional requirements on relays.2223## Kind 40: Create channel2425Create a public chat channel.2627In the channel creation `content` field, Client SHOULD include basic channel metadata (`name`, `about`, `picture` and `relays` as specified in kind 41).2829```yaml30{31 "content": "{\"name\": \"Demo Channel\", \"about\": \"A test channel.\", \"picture\": \"https://placekitten.com/200/200\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}",32 // other fields...33}34```353637## Kind 41: Set channel metadata3839Update a channel's public metadata.4041Kind 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.4243Clients SHOULD ignore kind 41s from pubkeys other than the kind 40 pubkey.4445Clients SHOULD support basic metadata fields:4647- `name` - string - Channel name48- `about` - string - Channel description49- `picture` - string - URL of channel picture50- `relays` - array - List of relays to download and broadcast events to5152Clients MAY add additional metadata fields.5354Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay.5556It is also possible to set the category name using the "t" tag. This category name can be searched and filtered.5758```yaml59{60 "content": "{\"name\": \"Updated Demo Channel\", \"about\": \"Updating a test channel.\", \"picture\": \"https://placekitten.com/201/201\", \"relays\": [\"wss://nos.lol\", \"wss://nostr.mom\"]}",61 "tags": [62 ["e", <channel_create_event_id>, <relay-url>, "root"],63 ["t", <category_name-1>],64 ["t", <category_name-2>],65 ["t", <category_name-3>],66 ],67 // other fields...68}69```707172## Kind 42: Create channel message7374Send a text message to a channel.7576Clients SHOULD use [NIP-10](10.md) marked "e" tags to recommend a relay and specify whether it is a reply or root message.7778Clients SHOULD append [NIP-10](10.md) "p" tags to replies.7980Root message:8182```yaml83{84 "content": <string>,85 "tags": [["e", <kind_40_event_id>, <relay-url>, "root"]],86 // other fields...87}88```8990Reply to another message:9192```yaml93{94 "content": <string>,95 "tags": [96 ["e", <kind_40_event_id>, <relay-url>, "root"],97 ["e", <kind_42_event_id>, <relay-url>, "reply"],98 ["p", <pubkey>, <relay-url>],99 // rest of tags...100 ],101 // other fields...102}103```104105106## Kind 43: Hide message107108User no longer wants to see a certain message.109110The `content` may optionally include metadata such as a `reason`.111112Clients SHOULD hide event 42s shown to a given user, if there is an event 43 from that user matching the event 42 `id`.113114Clients MAY hide event 42s for other users other than the user who sent the event 43.115116(For example, if three users 'hide' an event giving a reason that includes the word 'pornography', a Nostr client that is an iOS app may choose to hide that message for all iOS clients.)117118```yaml119{120 "content": "{\"reason\": \"Dick pic\"}",121 "tags": [["e", <kind_42_event_id>]],122 // other fields...123}124```125126## Kind 44: Mute user127128User no longer wants to see messages from another user.129130The `content` may optionally include metadata such as a `reason`.131132Clients SHOULD hide event 42s shown to a given user, if there is an event 44 from that user matching the event 42 `pubkey`.133134Clients MAY hide event 42s for users other than the user who sent the event 44.135136```yaml137{138 "content": "{\"reason\": \"Posting dick pics\"}",139 "tags": [["p", <pubkey>]],140 // other fields...141}142```143144## Relay recommendations145146Clients SHOULD use the relay URLs of the metadata events. 147148Clients 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.149150Motivation151----------152If we're solving censorship-resistant communication for social media, we may as well solve it also for Telegram-style messaging.153154We can bring the global conversation out from walled gardens into a true public square open to all.155156157Additional info158---------------159160- [Chat demo PR with fiatjaf+jb55 comments](https://github.com/ArcadeCity/arcade/pull/28)161- [Conversation about NIP16](https://t.me/nostr_protocol/29566)