-
Notifications
You must be signed in to change notification settings - Fork 586
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to reconcile kind 9/209 and 11/309
- Loading branch information
Jon Staab
committed
Nov 20, 2024
1 parent
5e99b6f
commit 94b8c61
Showing
6 changed files
with
129 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
NIP-XX | ||
====== | ||
|
||
Relay-specific content | ||
---------------------- | ||
|
||
`draft` `optional` | ||
|
||
Any event may be specified as belonging to a relay using a `@` tag containing the | ||
relay's normalized URL. These events MUST NOT be considered valid unless their `@` | ||
tag matches the relay they are fetched from, or a relay specified in a `kind 30209` | ||
federation event. | ||
|
||
# Federation | ||
|
||
Relays MAY indicate federation with other relays by publishing a `kind 30209` event | ||
signed using the key associated with the relay's NIP 11 document. | ||
|
||
```json | ||
{ | ||
"kind": "30209", | ||
"tags": [ | ||
["@", "wss://other1.com"] | ||
], | ||
} | ||
``` | ||
|
||
Federation is pull-based, and does not need to be mutual. Relays that wish to avoid | ||
sharing proprietary content should use other access control measures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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. Rooms | ||
on different relays with the same name ARE NOT the same room. | ||
|
||
Any event MAY be posted to a `room` using a `~` tag. A `@` tag MUST also be | ||
used to specify which relay the room is on. | ||
|
||
```json | ||
{ | ||
"kind": 1, | ||
"content": "Trigger alert: pineapple", | ||
"tags": [ | ||
["~", "pizza"], | ||
["@", "wss://example.com/"] | ||
] | ||
} | ||
``` | ||
|
||
# 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 a `~` tag for each room the user is a member of, | ||
specifying room name and host relay. Matching `r` tags SHOULD also be included so that the | ||
relay url can be queried. | ||
|
||
```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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 9`, a reply MUST copy it from its parent. |