nips/72.md

97 lines
4.9 KiB
Markdown
Raw Permalink Normal View History

2023-08-08 12:31:54 -04:00
NIP-72
======
2023-06-12 18:35:23 -04:00
Moderated Communities (Reddit Style)
------------------------------------
2023-11-15 19:42:51 -05:00
`draft` `optional`
2023-06-12 18:35:23 -04:00
2024-02-05 12:26:14 -05:00
The goal of this NIP is to enable public communities. It defines the replaceable event `kind:34550` to define the community and the current list of moderators/administrators. Users that want to post into the community, simply tag any Nostr event with the community's `a` tag. Moderators may issue an approval event `kind:4550`.
2023-06-12 18:35:23 -04:00
# Community Definition
2023-06-12 18:35:23 -04:00
`Kind:34550` SHOULD include any field that helps define the community and the set of moderators. `relay` tags MAY be used to describe the preferred relay to download requests and approvals. A community definition event's `d` tag MAY double as its name, but if a `name` tag is provided, it SHOULD be displayed instead of the `d` tag.
2023-06-12 18:35:23 -04:00
2024-01-21 14:08:45 -05:00
```jsonc
2023-06-12 18:35:23 -04:00
{
2023-08-08 12:31:54 -04:00
"created_at": <Unix timestamp in seconds>,
"kind": 34550,
2023-06-12 18:35:23 -04:00
"tags": [
["d", "<community-d-identifier>"],
["name", "<Community name>"],
["description", "<Community description>"],
["image", "<Community image url>", "<Width>x<Height>"],
2023-08-08 12:31:54 -04:00
//.. other tags relevant to defining the community
2023-06-12 18:35:23 -04:00
// moderators
["p", "<32-bytes hex of a pubkey1>", "<optional recommended relay URL>", "moderator"],
["p", "<32-bytes hex of a pubkey2>", "<optional recommended relay URL>", "moderator"],
["p", "<32-bytes hex of a pubkey3>", "<optional recommended relay URL>", "moderator"],
2023-08-08 12:31:54 -04:00
2023-06-19 15:07:40 -04:00
// relays used by the community (w/optional marker)
["relay", "<relay hosting author kind 0>", "author"],
2023-08-08 12:31:54 -04:00
["relay", "<relay where to send and receive requests>", "requests"],
2023-06-19 15:07:40 -04:00
["relay", "<relay where to send and receive approvals>", "approvals"],
["relay", "<relay where to post requests to and fetch approvals from>"]
],
2024-09-03 13:11:31 -04:00
// other fields...
2023-06-12 18:35:23 -04:00
}
```
2024-02-05 12:26:14 -05:00
# Posting to a community
2023-06-12 18:35:23 -04:00
Any Nostr event can be posted to a community. Clients MUST add one or more community `a` tags, each with a recommended relay.
2023-06-12 18:35:23 -04:00
2024-01-21 14:08:45 -05:00
```jsonc
2023-06-12 18:35:23 -04:00
{
"kind": 1,
2023-06-12 18:35:23 -04:00
"tags": [
["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
2023-08-08 12:31:54 -04:00
],
"content": "hello world",
2024-09-03 13:11:31 -04:00
// other fields...
2023-06-12 18:35:23 -04:00
}
```
# Moderation
2023-06-12 18:35:23 -04:00
2024-02-05 12:26:14 -05:00
Anyone may issue an approval event to express their opinion that a post is appropriate for a community. Clients MAY choose which approval events to honor, but SHOULD at least use ones published by the group's defined moderators.
An approval event MUST include one or more community `a` tags, an `e` or `a` tag pointing to the post, and the `p` tag of the author of the post (for approval notifications). `a` tag prefixes can be used to disambiguate between community and replaceable event pointers (community `a` tags always begin with `34550`).
2023-06-12 18:35:23 -04:00
The event SHOULD also include the JSON-stringified `post request` event inside the `.content`, and a `k` tag with the original post's event kind to allow filtering of approved posts by kind.
Moderators MAY request deletion of their approval of a post at any time using [NIP-09 event deletion requests](09.md).
2023-06-12 18:35:23 -04:00
2024-01-21 14:08:45 -05:00
```jsonc
2023-06-12 18:35:23 -04:00
{
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
2023-08-08 12:31:54 -04:00
"kind": 4550,
2023-06-12 18:35:23 -04:00
"tags": [
["a", "34550:<event-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"],
["e", "<post-id>", "<optional-relay-url>"],
["p", "<port-author-pubkey>", "<optional-relay-url>"],
["k", "<post-request-kind>"]
2023-08-08 12:31:54 -04:00
],
"content": "<the full approved event, JSON-encoded>",
2024-09-03 13:11:31 -04:00
// other fields...
2023-06-12 18:35:23 -04:00
}
```
2023-08-09 12:34:49 -04:00
It's recommended that multiple moderators approve posts to avoid deleting them from the community when a moderator is removed from the owner's list. In case the full list of moderators must be rotated, the new moderator set must sign new approvals for posts in the past or the community will restart. The owner can also periodically copy and re-sign of each moderator's approval events to make sure posts don't disappear with moderators.
2023-06-12 18:35:23 -04:00
Approvals of replaceable events can be created in three ways:
1. By tagging the replaceable event as an `e` tag if moderators want to approve each individual change to the replaceable event
2. By tagging the replaceable event as an `a` tag if the moderator authorizes the replaceable event author to make changes without additional approvals and
3. By tagging the replaceable event with both its `e` and `a` tag which empowers clients to display the original and updated versions of the event, with appropriate remarks in the UI.
Since relays are instructed to delete old versions of a replaceable event, the `content` of an approval using an `e` tag MUST have the specific version of the event or clients might not be able to find that version of the content anywhere.
2024-05-30 15:24:58 -04:00
Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be approved for all `34550:*` `a` tags.
# Cross-posting
Clients MAY support cross-posting between communities by posting a NIP 18 `kind 6` or `kind 16` repost to one or more communities using `a` tags as described above. The `content` of the repost MUST be the original event, not the approval event.