NIP-72: reformat and clarify some things.

This commit is contained in:
fiatjaf 2023-11-18 08:48:49 -03:00
parent 7aa751be46
commit b0df71824f
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

36
72.md
View File

@ -10,16 +10,15 @@ The goal of this NIP is to create moderator-approved public communities around a
# Community Definition # Community Definition
`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. `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.
```json ```json
{ {
"id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", ...
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"created_at": <Unix timestamp in seconds>, "created_at": <Unix timestamp in seconds>,
"kind": 34550, "kind": 34550,
"tags": [ "tags": [
["d", "<Community name>"], ["d", "<community-d-identifier>"],
["description", "<Community description>"], ["description", "<Community description>"],
["image", "<Community image url>", "<Width>x<Height>"], ["image", "<Community image url>", "<Width>x<Height>"],
@ -41,18 +40,16 @@ The goal of this NIP is to create moderator-approved public communities around a
# New Post Request # New Post Request
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. 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.
```json ```json
{ {
"id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", ...
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"created_at": <Unix timestamp in seconds>,
"kind": 1, "kind": 1,
"tags": [ "tags": [
["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"],
], ],
"content": "<My content>" "content": "hello world"
} }
``` ```
@ -64,17 +61,16 @@ The post-approval event MUST include `a` tags of the communities the moderator i
```json ```json
{ {
"id": "<32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>", ...
"pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>", "pubkey": "<32-bytes lowercase hex-encoded public key of the event creator>",
"created_at": <Unix timestamp in seconds>,
"kind": 4550, "kind": 4550,
"tags": [ "tags": [
["a", "34550:<Community event author pubkey>:<d-identifier of the community>", "<Optional relay url>"], ["a", "34550:<event-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"],
["e", "<Post Request ID>", "<Optional relay url>"], ["e", "<post-id>", "<optional-relay-url>"],
["p", "<Post Request Author ID>", "<Optional relay url>"], ["p", "<port-author-pubkey>", "<optional-relay-url>"],
["k", "<New Post Request kind>"], ["k", "<post-request-kind>"]
], ],
"content": "<New Post Request JSON>" "content": "<the full approved event, JSON-encoded>"
} }
``` ```
@ -91,11 +87,15 @@ Community clients SHOULD display posts that have been approved by at least 1 mod
The following filter displays the approved posts. The following filter displays the approved posts.
```js ```js
[
"REQ",
"_",
{ {
"authors": ["<Author pubkey>", "<Moderator1 pubkey>", "<Moderator2 pubkey>", "<Moderator3 pubkey>", ...], "authors": ["<owner-pubkey>", "<moderator1-pubkey>", "<moderator2-pubkey>", "<moderator3-pubkey>", ...],
"kinds": [4550], "kinds": [4550],
"#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"], "#a": ["34550:<Community event author pubkey>:<d-identifier of the community>"],
} }
]
``` ```
Clients MAY hide approvals by blocked moderators at the user's request. Clients MAY hide approvals by blocked moderators at the user's request.