diff --git a/29.md b/29.md index a11643327..a2c8ef26b 100644 --- a/29.md +++ b/29.md @@ -64,39 +64,7 @@ These are the events expected to be found in NIP-29 groups. ### Normal user-created events -These events generally can be sent by all members of a group and they require the `h` tag to be present so they're attached to a specific group. - -- _chat message_ (`kind:9`) - -This is the basic unit of a _chat message_ sent to a group. - -```jsonc - "kind": 9, - "content": "hello my friends lovers of pizza", - "tags": [ - ["h", ""], - ["previous", "", "", /*...*/] - ] - // other fields... -``` - -- _thread root post_ (`kind:11`) - -This is the basic unit of a forum-like root thread post sent to a group. - -```jsonc - "kind": 11, - "content": "hello my friends lovers of pizza", - "tags": [ - ["h", ""], - ["previous", "", "", /*...*/] - ] - // other fields... -``` - -- _other events_: - -Groups may also accept other events, like [NIP-22](22.md) comments as threaded replies to both chats messages and threads, long-form articles, calendar, livestreams, market announcements and so on. These should be as defined in their respective NIPs, with the addition of the `h` tag. +Groups may accept any event kind, including chats, threads, long-form articles, calendar, livestreams, market announcements and so on. These should be as defined in their respective NIPs, with the addition of the `h` tag. ### User-related group management events diff --git a/chat.md b/chat.md new file mode 100644 index 000000000..0e49eb08e --- /dev/null +++ b/chat.md @@ -0,0 +1,23 @@ +NIP-XX +====== + +Chats +----- + +`draft` `optional` + +A chat message is a `kind 9` event. Chat messages are intended to be used as a +high-frequency, informal, context-aware communication medium. In other words, +chat messages should be displayed sequentially alongside other messages. + +```json +{ + "kind": 9, + "content": "GM", + "tags": [] +} +``` + +Replies to `kind 9` MUST use [NIP-73](https://github.com/nostr-protocol/nips/pull/1233) +`kind 1111`. Clients SHOULD encourage flat reply hierarchies. If an `h` or `~` tag is used +on the `kind 9`, a reply MUST copy it from its parent. diff --git a/threads.md b/threads.md new file mode 100644 index 000000000..89a19e446 --- /dev/null +++ b/threads.md @@ -0,0 +1,25 @@ +NIP-XX +====== + +Threads +------- + +`draft` `optional` + +A thread is a `kind 11` event. Threads and their replies are intended to be used +as a low-frequency, more formal, context-aware communication medium. Threads +SHOULD include a `title` with a summary of the `content`. + +```json +{ + "kind": 11, + "content": "Good morning", + "tags": [ + ["title", "GM"] + ] +} +``` + +Replies to `kind 11` MUST use [NIP-73](https://github.com/nostr-protocol/nips/pull/1233) +`kind 1111` comments. Clients SHOULD encourage flat reply hierarchies. If an `h` or `~` +tag is used on the `kind 11`, a reply MUST copy it from its parent. diff --git a/xx.md b/xx.md deleted file mode 100644 index 437abd607..000000000 --- a/xx.md +++ /dev/null @@ -1,102 +0,0 @@ -NIP-XX -====== - -Rooms ------ - -`draft` `optional` - -# Rooms - -A `room` is identified by an arbitrary, human-readable string no longer than -30 characters and referred to using a `~` tag indicating the room id and a -relay url. Rooms on different relays with the same name ARE NOT the same room. - -Any event MAY be posted to a `room` using a `~` tag. Events posted to a room -MUST NOT be considered valid unless their `~` tag matches the current relay, or -a relay specified in a `kind 30209` federation event. - -# Chat - -A chat message is a kind `209` event with a `~` tag. Chat messages are intended -to be used as a high-frequency, informal, context-aware communication medium. - -```json -{ - "kind": 209, - "content": "GM", - "tags": [ - ["~", "Good Morning", "wss://relay.example.com/"], - ] -} -``` - -Replies to kind `209` MUST use [NIP-73](https://github.com/nostr-protocol/nips/pull/1233) -kind `1111` comments with a matching `~` tag. Clients SHOULD encourage flat reply -hierarchies. - -# Threads - -A thread is a kind `309` event with a `~` tag. Threads and their replies are -intended to be used as a low-frequency, more formal, context-aware communication -medium. Threads MUST include a `title` with a summary of the `content`. - -```json -{ - "kind": 309, - "content": "GM", - "tags": [ - ["~", "Good Morning", "wss://relay.example.com/"], - ["title", "GM"] - ] -} -``` - -Replies to kind `309` MUST use [NIP-73](https://github.com/nostr-protocol/nips/pull/1233) -kind `1111` comments with a matching `~` tag. Clients SHOULD encourage flat reply -hierarchies. - -# Membership - -Users MAY track and optionally advertise their own group memberships using a [NIP 51](51.md) kind `10209` event. Tags MAY be either public or encrypted with [NIP 44](44.md), depending on user/client preference. - -Room membership SHOULD be indicated using both an `r` tag for each relay the user is a member of, and a `~` tag for each room the user is a member of. `~` tags MUST include a relay url as the second argument. - -```json -{ - "kind": "10209", - "tags": [ - ["r", "wss://relay.other.com/"], - ["~", "Good Morning", "wss://relay.other.com/"] - ], -} -``` - -Room membership events SHOULD be sent to: - -- The user's [NIP-65](./65.md) WRITE relays -- Each relay listed in the membership event -- Each relay being removed from the member list - -# Federation - -Relays hosting rooms MAY indicate federation with other relays for rooms -by publishing a `kind 30209` event using the key indicated by the relay's -NIP 11 document. - -A relay may indicate partial federation using one or more `~` tags, or complete -federation using a `r` tag. - -```json -{ - "kind": "30209", - "tags": [ - ["r", "wss://other1.com"], - ["~", "Good Morning", "wss://other2.com/"], - ["~", "Good Morning", "wss://other3.com/"] - ], -} -``` - -This can be useful if a conversation needs to be moved from one relay to another, -or if multiple people want to host a conversation simultaneously.