diff options
Diffstat (limited to '72.md')
| -rw-r--r-- | 72.md | 58 |
1 files changed, 29 insertions, 29 deletions
| @@ -4,22 +4,20 @@ NIP-72 | |||
| 4 | Moderated Communities (Reddit Style) | 4 | Moderated Communities (Reddit Style) |
| 5 | ------------------------------------ | 5 | ------------------------------------ |
| 6 | 6 | ||
| 7 | `draft` `optional` `author:vitorpamplona` `author:arthurfranca` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | The goal of this NIP is to create moderator-approved public communities around a topic. 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 issue an approval event `kind:4550` that links the community with the new post. | 9 | The goal of this NIP is to create moderator-approved public communities around a topic. 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 issue an approval event `kind:4550` that links the community with the new post. |
| 10 | 10 | ||
| 11 | # Community Definition | 11 | # Community Definition |
| 12 | 12 | ||
| 13 | `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. | 13 | `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. |
| 14 | 14 | ||
| 15 | ```json | 15 | ```jsonc |
| 16 | { | 16 | { |
| 17 | "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", | ||
| 18 | "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", | ||
| 19 | "created_at": <Unix timestamp in seconds>, | 17 | "created_at": <Unix timestamp in seconds>, |
| 20 | "kind": 34550, | 18 | "kind": 34550, |
| 21 | "tags": [ | 19 | "tags": [ |
| 22 | ["d", "<Community name>"], | 20 | ["d", "<community-d-identifier>"], |
| 23 | ["description", "<Community description>"], | 21 | ["description", "<Community description>"], |
| 24 | ["image", "<Community image url>", "<Width>x<Height>"], | 22 | ["image", "<Community image url>", "<Width>x<Height>"], |
| 25 | 23 | ||
| @@ -35,24 +33,23 @@ The goal of this NIP is to create moderator-approved public communities around a | |||
| 35 | ["relay", "<relay where to send and receive requests>", "requests"], | 33 | ["relay", "<relay where to send and receive requests>", "requests"], |
| 36 | ["relay", "<relay where to send and receive approvals>", "approvals"], | 34 | ["relay", "<relay where to send and receive approvals>", "approvals"], |
| 37 | ["relay", "<relay where to post requests to and fetch approvals from>"] | 35 | ["relay", "<relay where to post requests to and fetch approvals from>"] |
| 38 | ] | 36 | ], |
| 37 | ... | ||
| 39 | } | 38 | } |
| 40 | ``` | 39 | ``` |
| 41 | 40 | ||
| 42 | # New Post Request | 41 | # New Post Request |
| 43 | 42 | ||
| 44 | Any Nostr event can be a post request. Clients MUST add the community's `a` tag to the new post event in order to be presented for the moderator's approval. | 43 | Any Nostr event can be submitted to a community by anyone for approval. Clients MUST add the community's `a` tag to the new post event in order to be presented for the moderator's approval. |
| 45 | 44 | ||
| 46 | ```json | 45 | ```jsonc |
| 47 | { | 46 | { |
| 48 | "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", | ||
| 49 | "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", | ||
| 50 | "created_at": <Unix timestamp in seconds>, | ||
| 51 | "kind": 1, | 47 | "kind": 1, |
| 52 | "tags": [ | 48 | "tags": [ |
| 53 | ["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], | 49 | ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"], |
| 54 | ], | 50 | ], |
| 55 | "content": "<My content>" | 51 | "content": "hello world", |
| 52 | // ... | ||
| 56 | } | 53 | } |
| 57 | ``` | 54 | ``` |
| 58 | 55 | ||
| @@ -62,25 +59,24 @@ Community management clients MAY filter all mentions to a given `kind:34550` eve | |||
| 62 | 59 | ||
| 63 | The post-approval event MUST include `a` tags of the communities the moderator is posting into (one or more), the `e` tag of the post and `p` tag of the author of the post (for approval notifications). The event SHOULD also include the stringified `post request` event inside the `.content` ([NIP-18-style](18.md)) and a `k` tag with the original post's event kind to allow filtering of approved posts by kind. | 60 | The post-approval event MUST include `a` tags of the communities the moderator is posting into (one or more), the `e` tag of the post and `p` tag of the author of the post (for approval notifications). The event SHOULD also include the stringified `post request` event inside the `.content` ([NIP-18-style](18.md)) and a `k` tag with the original post's event kind to allow filtering of approved posts by kind. |
| 64 | 61 | ||
| 65 | ```json | 62 | ```jsonc |
| 66 | { | 63 | { |
| 67 | "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", | ||
| 68 | "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", | 64 | "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", |
| 69 | "created_at": <Unix timestamp in seconds>, | ||
| 70 | "kind": 4550, | 65 | "kind": 4550, |
| 71 | "tags": [ | 66 | "tags": [ |
| 72 | ["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], | 67 | ["a", "34550:<event-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"], |
| 73 | ["e", "<Post Request ID>", "<Optional relay url>"], | 68 | ["e", "<post-id>", "<optional-relay-url>"], |
| 74 | ["p", "<Post Request Author ID>", "<Optional relay url>"], | 69 | ["p", "<port-author-pubkey>", "<optional-relay-url>"], |
| 75 | ["k", "<New Post Request kind>"], | 70 | ["k", "<post-request-kind>"] |
| 76 | ], | 71 | ], |
| 77 | "content": "<New Post Request JSON>" | 72 | "content": "<the full approved event, JSON-encoded>", |
| 73 | // ... | ||
| 78 | } | 74 | } |
| 79 | ``` | 75 | ``` |
| 80 | 76 | ||
| 81 | 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. | 77 | 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. |
| 82 | 78 | ||
| 83 | Post Approvals of replaceable events can be created in three ways: (i) by tagging the replaceable event as an `e` tag if moderators want to approve each individual change to the repleceable event; (ii) by tagging the replaceable event as an `a` tag if the moderator authorizes the replaceable event author to make changes without additional approvals and (iii) 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 `e`-approval MUST have the specific version of the event or Clients might not be able to find that version of the content anywhere. | 79 | Post Approvals of replaceable events can be created in three ways: (i) by tagging the replaceable event as an `e` tag if moderators want to approve each individual change to the replaceable event; (ii) by tagging the replaceable event as an `a` tag if the moderator authorizes the replaceable event author to make changes without additional approvals and (iii) 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 `e`-approval MUST have the specific version of the event or Clients might not be able to find that version of the content anywhere. |
| 84 | 80 | ||
| 85 | Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be included in all `34550:*` `a` tags. | 81 | Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be included in all `34550:*` `a` tags. |
| 86 | 82 | ||
| @@ -90,12 +86,16 @@ Community clients SHOULD display posts that have been approved by at least 1 mod | |||
| 90 | 86 | ||
| 91 | The following filter displays the approved posts. | 87 | The following filter displays the approved posts. |
| 92 | 88 | ||
| 93 | ```js | 89 | ```json |
| 94 | { | 90 | [ |
| 95 | "authors": ["<Author pubkey>", "<Moderator1 pubkey>", "<Moderator2 pubkey>", "<Moderator3 pubkey>", ...], | 91 | "REQ", |
| 96 | "kinds": [4550], | 92 | "_", |
| 97 | "#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"], | 93 | { |
| 98 | } | 94 | "authors": ["<owner-pubkey>", "<moderator1-pubkey>", "<moderator2-pubkey>", "<moderator3-pubkey>", ...], |
| 95 | "kinds": [4550], | ||
| 96 | "#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"], | ||
| 97 | } | ||
| 98 | ] | ||
| 99 | ``` | 99 | ``` |
| 100 | 100 | ||
| 101 | Clients MAY hide approvals by blocked moderators at the user's request. | 101 | Clients MAY hide approvals by blocked moderators at the user's request. |