NIP-29: group IDs

This commit is contained in:
kehiy 2024-09-07 18:23:20 +03:30
parent c02b161d9e
commit ee48fdf814

25
29.md
View File

@ -20,7 +20,12 @@ Relays are supposed to generate the events that describe group metadata and grou
## Group identifier ## Group identifier
A group may be identified by a string in the format `<host>'<group-id>`. For example, a group with _id_ `abcdef` hosted at the relay `wss://groups.nostr.com` would be identified by the string `groups.nostr.com'abcdef`. To identify a group, we can use NIP-05 like address. for example a group with _id_ of `<id>`, hosted on `<host>` can be
fined with address of `<id>@<host>`. For clients to don't get confuse with NIP-05 address, they can trait these address
based on where they are receiving or seeing it.
This makes an easy way to share groups everywhere.
_id_: should be restricted to the characters `a-z0-9-_.`, case-insensitive.
## The `h` tag ## The `h` tag
@ -43,6 +48,7 @@ Relays should prevent late publication (messages published now with a timestamp
This is the basic unit of a "microblog" root text note sent to a group. This is the basic unit of a "microblog" root text note sent to a group.
```jsonc ```jsonc
{
"kind": 11, "kind": 11,
"content": "hello my friends lovers of pizza", "content": "hello my friends lovers of pizza",
"tags": [ "tags": [
@ -50,6 +56,7 @@ This is the basic unit of a "microblog" root text note sent to a group.
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/] ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
] ]
// other fields... // other fields...
}
``` ```
- *threaded text reply* (`kind:12`) - *threaded text reply* (`kind:12`)
@ -64,6 +71,7 @@ This is the basic unit of a "microblog" reply note sent to a group. It's the sam
This is the basic unit of a _chat message_ sent to a group. This is the basic unit of a _chat message_ sent to a group.
```jsonc ```jsonc
{
"kind": 9, "kind": 9,
"content": "hello my friends lovers of pizza", "content": "hello my friends lovers of pizza",
"tags": [ "tags": [
@ -71,6 +79,7 @@ This is the basic unit of a _chat message_ sent to a group.
["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/] ["previous", "<event-id-first-chars>", "<event-id-first-chars>", /*...*/]
] ]
// other fields... // other fields...
}
``` ```
- *chat message threaded reply* (`kind:10`) - *chat message threaded reply* (`kind:10`)
@ -83,13 +92,14 @@ Similar to `kind:12`, this is the basic unit of a chat message sent to a group.
Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them. Any user can send one of these events to the relay in order to be automatically or manually added to the group. If the group is `open` the relay will automatically issue a `kind:9000` in response adding this user. Otherwise group admins may choose to query for these requests and act upon them.
```json ```jsonc
{ {
"kind": 9021, "kind": 9021,
"content": "optional reason", "content": "optional reason",
"tags": [ "tags": [
["h", "<group-id>"] ["h", "<group-id>"]
] ]
// other fields...
} }
``` ```
@ -97,13 +107,14 @@ Any user can send one of these events to the relay in order to be automatically
Any user can send one of these events to the relay in order to be automatically removed from the group. The relay will automatically issue a `kind:9001` in response removing this user. Any user can send one of these events to the relay in order to be automatically removed from the group. The relay will automatically issue a `kind:9001` in response removing this user.
```json ```jsonc
{ {
"kind": 9022, "kind": 9022,
"content": "optional reason", "content": "optional reason",
"tags": [ "tags": [
["h", "<group-id>"] ["h", "<group-id>"]
] ]
// other fields...
} }
``` ```
@ -111,7 +122,7 @@ Any user can send one of these events to the relay in order to be automatically
Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log. Clients can send these events to a relay in order to accomplish a moderation action. Relays must check if the pubkey sending the event is capable of performing the given action. The relay may discard the event after taking action or keep it as a moderation log.
```json ```jsonc
{ {
"kind": 90xx, "kind": 90xx,
"content": "optional reason", "content": "optional reason",
@ -119,6 +130,7 @@ Clients can send these events to a relay in order to accomplish a moderation act
["h", "<group-id>"], ["h", "<group-id>"],
["previous", /*...*/] ["previous", /*...*/]
] ]
// other fields...
} }
``` ```
@ -177,7 +189,7 @@ The list of capabilities, as defined by this NIP, for now, is the following:
- `edit-group-status` - `edit-group-status`
- `delete-group` - `delete-group`
```json ```jsonc
{ {
"kind": 39001, "kind": 39001,
"content": "list of admins for the pizza lovers group", "content": "list of admins for the pizza lovers group",
@ -196,7 +208,7 @@ Similar to *group admins*, this event is supposed to be generated by relays that
It's a NIP-51-like list of pubkeys that are members of the group. Relays might choose to not to publish this information or to restrict what pubkeys can fetch it. It's a NIP-51-like list of pubkeys that are members of the group. Relays might choose to not to publish this information or to restrict what pubkeys can fetch it.
```json ```jsonc
{ {
"kind": 39002, "kind": 39002,
"content": "list of members for the pizza lovers group", "content": "list of members for the pizza lovers group",
@ -206,6 +218,7 @@ It's a NIP-51-like list of pubkeys that are members of the group. Relays might c
["p", "<member-pubkey1>"], ["p", "<member-pubkey1>"],
["p", "<member-pubkey2>"], ["p", "<member-pubkey2>"],
] ]
// other fields...
} }
``` ```