upleb.uk

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

summaryrefslogtreecommitdiff
path: root/172.md
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2023-06-12 18:35:23 -0400
committerfiatjaf_ <fiatjaf@gmail.com>2023-08-08 13:27:32 -0300
commit1912dacd33e69584e7f451e18a81bdc114ea9d76 (patch)
tree32d0a7ff83c3aac1b45216327782fc792be62521 /172.md
parent33fcb7c9bcdc6179714a7bac35875d54bfa4e15f (diff)
Simple moderated communities flow.
Diffstat (limited to '172.md')
-rw-r--r--172.md85
1 files changed, 85 insertions, 0 deletions
diff --git a/172.md b/172.md
new file mode 100644
index 0000000..0cc8107
--- /dev/null
+++ b/172.md
@@ -0,0 +1,85 @@
1NIP-172
2=======
3
4Moderated Communities (Reddit Style)
5------------------------------------
6
7`draft` `optional` `author:vitorpamplona`
8
9The goal of this NIP is to create moderator-approved public communities arount a topic. It defines the replaceable event `34550` to define the community and the current list of moderators/administrators. Users that want to post into to the community, simply tag any Nostr event with an `a` tag. Moderators the issue an approval event `34551` that links the community with the new post.
10
11# Community definition
12
13Kind 34550 should include any field that helps define the community and the set of moderators.
14
15```js
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
25 // moderators
26 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "moderator"]
27 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "moderator"]
28 ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>", "moderator"]
29 ]
30}
31```
32
33# New Post Request
34
35Any Nostr event can be a post request. Clients should simply add the community's `a` tag to be presented for the moderator's approval.
36
37```js
38{
39 "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>",
40 "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
41 "created_at": "<Unix timestamp in seconds>",
42 "kind": "1",
43 "tags": [
44 ["a", "34550:<community event author pubkey>:<d-identifier of the community>", "<optional relay url>"],
45 ],
46 "content": "<my content>"
47}
48```
49
50Community management clients can filter all mentions to the kind-34550 event and request moderators to approve each submission. The same moderator can remove his/her approval of the post at anytime.
51
52# Post Approval by moderators
53
54The post approval includes a stringified `new post request` event inside the content's of the approval (NIP-18-style).
55
56```js
57{
58 "id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>",
59 "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
60 "created_at": "<Unix timestamp in seconds>",
61 "kind": "34551",
62 "tags": [
63 ["a", "34550:<community event author pubkey>:<d-identifier of the community>", "<optional relay url>"],
64 ["e", "<Post Request ID>", "<optional relay url>"],
65 ["p", "<Post Request Author ID>", "<optional relay url>"],
66 ],
67 "content": "{ <New Post Request JSON> }"
68}
69```
70
71It's recommended that multiple moderators approve posts to avoid unapproving them when a given moderator is removed from the owner's list. In case the full list of moderators must be rotated, the new moderator set must sign post approvals for the past post or the community will restart.
72
73# Displaying
74
75Community clients can display posts that have been approved by at least 1 moderator or by the community owner.
76
77The following filter displays the approved posts.
78
79```js
80{
81 "authors": ["<author>", "moderator1", "moderator2", "moderator3", ...],
82 "kinds": 34551,
83 "#a": ["34550:<community event author pubkey>:<d-identifier of the community>"],
84}
85``` \ No newline at end of file