Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break out chat and threads from nip 29 #1591

Merged
merged 9 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions 29.md
Original file line number Diff line number Diff line change
Expand Up @@ -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", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
// 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", "<group-id>"],
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
]
// 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

Expand Down
34 changes: 34 additions & 0 deletions 7D.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
NIP-7D
======

Threads
-------

`draft` `optional`

A thread is a `kind 11` event. Threads SHOULD include a `subject` with a summary
of the thread's topic.

```json
{
"kind": 11,
"content": "Good morning",
"tags": [
["subject", "GM"]
]
}
```

Replies to `kind 11` MUST use [NIP-22](./22.md) `kind 1111` comments. Replies should
always be to the root `kind 11` to avoid arbitrarily nested reply hierarchies.

```json
{
"kind": 1111,
"content": "Cool beans",
"tags": [
["K", "11"],
["E", <event-id>, <relay-url>, <pubkey>]
]
}
```
29 changes: 29 additions & 0 deletions C7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
NIP-C7
======

Chats
-----

`draft` `optional`

A chat message is a `kind 9` event.

```json
{
"kind": 9,
"content": "GM",
"tags": []
}
```

A reply to a `kind 9` is an additional `kind 9` which quotes the parent using a `q` tag.

```json
{
"kind": 9,
"content": "nostr:nevent1...\nyes",
"tags": [
["q", <event-id>, <relay-url>, <pubkey>]
]
}
```