upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/72.md
diff options
context:
space:
mode:
authorfiatjaf <fiatjaf@gmail.com>2023-08-08 13:31:54 -0300
committerfiatjaf <fiatjaf@gmail.com>2023-08-08 13:31:54 -0300
commit892fe9e4004dbb515d71729b92d0432665f8e823 (patch)
tree633a2c71182c3b470673f8c5b572f3b70729cadb /72.md
parent507b0c20a52e4288d4ebaa9df0c4e12b89835172 (diff)
move 172 to 72 and update indexes.
Diffstat (limited to '72.md')
-rw-r--r--72.md101
1 files changed, 101 insertions, 0 deletions
diff --git a/72.md b/72.md
new file mode 100644
index 0000000..750b076
--- /dev/null
+++ b/72.md
@@ -0,0 +1,101 @@
1NIP-72
2======
3
4Moderated Communities (Reddit Style)
5------------------------------------
6
7`draft` `optional` `author:vitorpamplona` `author:arthurfranca`
8
9The 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 (See [NIP-33](33.md)). Moderators issue an approval event `kind:4550` that links the community with the new post.
10
11# Community Definition
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.
14
15```json
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>,
20 "kind": 34550,
21 "tags": [
22 ["d", "<Community name>"],
23 ["description", "<Community description>"],
24 ["image", "<Community image url>", "<Width>x<Height>"],
25
26 //.. other tags relevant to defining the community
27
28 // moderators
29 ["p", "<32-bytes hex of a pubkey1>", "<optional recommended relay URL>", "moderator"],
30 ["p", "<32-bytes hex of a pubkey2>", "<optional recommended relay URL>", "moderator"],
31 ["p", "<32-bytes hex of a pubkey3>", "<optional recommended relay URL>", "moderator"],
32
33 // relays used by the community (w/optional marker)
34 ["relay", "<relay hosting author kind 0>", "author"],
35 ["relay", "<relay where to send and receive requests>", "requests"],
36 ["relay", "<relay where to send and receive approvals>", "approvals"],
37 ["relay", "<relay where to post requests to and fetch approvals from>"]
38 ]
39}
40```
41
42# New Post Request
43
44Any 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.
45
46```json
47{
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,
52 "tags": [
53 ["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"],
54 ],
55 "content": "<My content>"
56}
57```
58
59Community management clients MAY filter all mentions to a given `kind:34550` event and request moderators to approve each submission. Moderators MAY delete his/her approval of a post at any time using event deletions (See [NIP-09](09.md)).
60
61# Post Approval by moderators
62
63The 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 notificaitons). 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
65```json
66{
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>",
69 "created_at": <Unix timestamp in seconds>,
70 "kind": 4550,
71 "tags": [
72 ["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"],
73 ["e", "<Post Request ID>", "<Optional relay url>"],
74 ["p", "<Post Request Author ID>", "<Optional relay url>"],
75 ["k", "<New Post Request kind>"],
76 ],
77 "content": "<New Post Request JSON>"
78}
79```
80
81It'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 dissapear with moderators.
82
83Post 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.
84
85Clients SHOULD evaluate any non-`34550:*` `a` tag as posts to be included in all `34550:*` `a` tags.
86
87# Displaying
88
89Community clients SHOULD display posts that have been approved by at least 1 moderator or by the community owner.
90
91The following filter displays the approved posts.
92
93```js
94{
95 "authors": ["<Author pubkey>", "<Moderator1 pubkey>", "<Moderator2 pubkey>", "<Moderator3 pubkey>", ...],
96 "kinds": [4550],
97 "#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"],
98}
99```
100
101Clients MAY hide approvals by blocked moderators at the user's request.