diff options
| author | Alex Gleason <alex@alexgleason.me> | 2025-07-11 00:58:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-11 00:58:51 -0400 |
| commit | 82fffa05807f75c49ce322170e73ec538b998959 (patch) | |
| tree | 3699df6cddc918f5b97be49be3144abd8beac50e | |
| parent | 477e3dfd4d672a830d157f32c41795b7a143b9d7 (diff) | |
NIP-72: use kind 1111 events for text notes (#1953)
| -rw-r--r-- | 72.md | 44 |
1 files changed, 40 insertions, 4 deletions
| @@ -41,19 +41,55 @@ The goal of this NIP is to enable public communities. It defines the replaceable | |||
| 41 | 41 | ||
| 42 | # Posting to a community | 42 | # Posting to a community |
| 43 | 43 | ||
| 44 | Any Nostr event can be posted to a community. Clients MUST add one or more community `a` tags, each with a recommended relay. | 44 | [NIP-22](NIP-22) kind 1111 events SHOULD be used for text notes posted to a community, with the `A` tag always scoped to the community definition. |
| 45 | |||
| 46 | ## Top-level posts | ||
| 47 | |||
| 48 | For top-level posts, the uppercase and lowercase NIP-22 tags should both refer to the community definition itself. | ||
| 49 | |||
| 50 | ```jsonc | ||
| 51 | { | ||
| 52 | "kind": 1111, | ||
| 53 | "tags": [ | ||
| 54 | ["A", "34550:<community-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"], | ||
| 55 | ["a", "34550:<community-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"], | ||
| 56 | ["P", "<community-author-pubkey>", "<optional-relay-url>"], | ||
| 57 | ["p", "<community-author-pubkey>", "<optional-relay-url>"], | ||
| 58 | ["K", "34550"], | ||
| 59 | ["k", "34550"], | ||
| 60 | ], | ||
| 61 | "content": "Hi everyone. It's great to be here!", | ||
| 62 | // other fields... | ||
| 63 | } | ||
| 64 | ``` | ||
| 65 | |||
| 66 | ## Nested replies | ||
| 67 | |||
| 68 | For nested replies, the uppercase tags should still refer to the community definition, while the lowercase tags should refer to the parent post or reply. | ||
| 45 | 69 | ||
| 46 | ```jsonc | 70 | ```jsonc |
| 47 | { | 71 | { |
| 48 | "kind": 1, | 72 | "kind": 1111, |
| 49 | "tags": [ | 73 | "tags": [ |
| 50 | ["a", "34550:<community event author pubkey>:<community-d-identifier>", "<optional-relay-url>"], | 74 | // community definition itself |
| 75 | ["A", "34550:<community-author-pubkey>:<community-d-identifier>", "<optional-relay-url>"], | ||
| 76 | ["P", "<community-author-pubkey>", "<optional-relay-url>"], | ||
| 77 | ["K", "34550"], | ||
| 78 | |||
| 79 | // parent post or reply | ||
| 80 | ["e", "<parent-event-id>", "<optional-relay-url>"], | ||
| 81 | ["p", "<parent-event-author-pubkey>", "<optional-relay-url>"], | ||
| 82 | ["k", "<parent-event-kind>"] // most likely "1111" | ||
| 51 | ], | 83 | ], |
| 52 | "content": "hello world", | 84 | "content": "Agreed! Welcome everyone!", |
| 53 | // other fields... | 85 | // other fields... |
| 54 | } | 86 | } |
| 55 | ``` | 87 | ``` |
| 56 | 88 | ||
| 89 | ## Backwards compatibility note | ||
| 90 | |||
| 91 | Previously kind 1 events were used for posts in communities, with an "a" tag pointing to the community. For backwards compatibility, clients MAY still query for kind 1 events, but SHOULD NOT use them for new posts. Instead, clients SHOULD use kind 1111 events with the `A` and `a` tags as described above. | ||
| 92 | |||
| 57 | # Moderation | 93 | # Moderation |
| 58 | 94 | ||
| 59 | 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. | 95 | 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. |