diff options
| author | Kieran <kieran@harkin.me> | 2024-10-15 11:15:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 11:15:54 +0100 |
| commit | 1e2f19863ca56754daa2466881eb22087a71b17d (patch) | |
| tree | 4f7be759dce290fea1d3ae10c403260b466ee16c /32.md | |
| parent | 53afaaece61f02e92b5ef9c3e9c32945c7ebf522 (diff) | |
| parent | e381b577c997b849fa544eea7dc9f08b360b4a33 (diff) | |
Merge branch 'master' into nip71-imeta
Diffstat (limited to '32.md')
| -rw-r--r-- | 32.md | 57 |
1 files changed, 36 insertions, 21 deletions
| @@ -2,14 +2,13 @@ NIP-32 | |||
| 2 | ====== | 2 | ====== |
| 3 | 3 | ||
| 4 | Labeling | 4 | Labeling |
| 5 | --------- | 5 | -------- |
| 6 | 6 | ||
| 7 | `draft` `optional` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, | 9 | This NIP defines two new indexable tags to label events and a new event kind (`kind:1985`) to attach those labels to existing events. This supports several use cases, including distributed moderation, collection management, license assignment, and content classification. |
| 10 | including distributed moderation, collection management, license assignment, and content classification. | ||
| 11 | 10 | ||
| 12 | This NIP introduces two new tags: | 11 | New Tags: |
| 13 | 12 | ||
| 14 | - `L` denotes a label namespace | 13 | - `L` denotes a label namespace |
| 15 | - `l` denotes a label | 14 | - `l` denotes a label |
| @@ -20,7 +19,7 @@ Label Namespace Tag | |||
| 20 | An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace | 19 | An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace |
| 21 | (such as an ISO standard) or reverse domain name notation. | 20 | (such as an ISO standard) or reverse domain name notation. |
| 22 | 21 | ||
| 23 | `L` tags are REQUIRED in order to support searching by namespace rather than by a specific tag. The special `ugc` | 22 | `L` tags are RECOMMENDED in order to support searching by namespace rather than by a specific tag. The special `ugc` |
| 24 | ("user generated content") namespace MAY be used when the label content is provided by an end user. | 23 | ("user generated content") namespace MAY be used when the label content is provided by an end user. |
| 25 | 24 | ||
| 26 | `L` tags starting with `#` indicate that the label target should be associated with the label's value. | 25 | `L` tags starting with `#` indicate that the label target should be associated with the label's value. |
| @@ -29,7 +28,9 @@ This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, | |||
| 29 | Label Tag | 28 | Label Tag |
| 30 | ---- | 29 | ---- |
| 31 | 30 | ||
| 32 | An `l` tag's value can be any string. `l` tags MUST include a `mark` matching an `L` tag value in the same event. | 31 | An `l` tag's value can be any string. If using an `L` tag, `l` tags MUST include a mark matching an `L` |
| 32 | tag value in the same event. If no `L` tag is included, a mark SHOULD still be included. If none is | ||
| 33 | included, `ugc` is implied. | ||
| 33 | 34 | ||
| 34 | Label Target | 35 | Label Target |
| 35 | ---- | 36 | ---- |
| @@ -42,7 +43,7 @@ or topics respectively. As with NIP-01, a relay hint SHOULD be included when usi | |||
| 42 | Content | 43 | Content |
| 43 | ------- | 44 | ------- |
| 44 | 45 | ||
| 45 | Labels should be short, meaningful strings. Longer discussions, such as for a review, or an | 46 | Labels should be short, meaningful strings. Longer discussions, such as for an |
| 46 | explanation of why something was labeled the way it was, should go in the event's `content` field. | 47 | explanation of why something was labeled the way it was, should go in the event's `content` field. |
| 47 | 48 | ||
| 48 | Self-Reporting | 49 | Self-Reporting |
| @@ -56,7 +57,7 @@ Example events | |||
| 56 | 57 | ||
| 57 | A suggestion that multiple pubkeys be associated with the `permies` topic. | 58 | A suggestion that multiple pubkeys be associated with the `permies` topic. |
| 58 | 59 | ||
| 59 | ```json | 60 | ```jsonc |
| 60 | { | 61 | { |
| 61 | "kind": 1985, | 62 | "kind": 1985, |
| 62 | "tags": [ | 63 | "tags": [ |
| @@ -65,13 +66,13 @@ A suggestion that multiple pubkeys be associated with the `permies` topic. | |||
| 65 | ["p", <pubkey1>, <relay_url>], | 66 | ["p", <pubkey1>, <relay_url>], |
| 66 | ["p", <pubkey2>, <relay_url>] | 67 | ["p", <pubkey2>, <relay_url>] |
| 67 | ], | 68 | ], |
| 68 | ... | 69 | // other fields... |
| 69 | } | 70 | } |
| 70 | ``` | 71 | ``` |
| 71 | 72 | ||
| 72 | A report flagging violence toward a human being as defined by ontology.example.com. | 73 | A report flagging violence toward a human being as defined by ontology.example.com. |
| 73 | 74 | ||
| 74 | ```json | 75 | ```jsonc |
| 75 | { | 76 | { |
| 76 | "kind": 1985, | 77 | "kind": 1985, |
| 77 | "tags": [ | 78 | "tags": [ |
| @@ -80,13 +81,13 @@ A report flagging violence toward a human being as defined by ontology.example.c | |||
| 80 | ["p", <pubkey1>, <relay_url>], | 81 | ["p", <pubkey1>, <relay_url>], |
| 81 | ["p", <pubkey2>, <relay_url>] | 82 | ["p", <pubkey2>, <relay_url>] |
| 82 | ], | 83 | ], |
| 83 | ... | 84 | // other fields... |
| 84 | } | 85 | } |
| 85 | ``` | 86 | ``` |
| 86 | 87 | ||
| 87 | A moderation suggestion for a chat event. | 88 | A moderation suggestion for a chat event. |
| 88 | 89 | ||
| 89 | ```json | 90 | ```jsonc |
| 90 | { | 91 | { |
| 91 | "kind": 1985, | 92 | "kind": 1985, |
| 92 | "tags": [ | 93 | "tags": [ |
| @@ -94,13 +95,13 @@ A moderation suggestion for a chat event. | |||
| 94 | ["l", "approve", "nip28.moderation"], | 95 | ["l", "approve", "nip28.moderation"], |
| 95 | ["e", <kind40_event_id>, <relay_url>] | 96 | ["e", <kind40_event_id>, <relay_url>] |
| 96 | ], | 97 | ], |
| 97 | ... | 98 | // other fields... |
| 98 | } | 99 | } |
| 99 | ``` | 100 | ``` |
| 100 | 101 | ||
| 101 | Assignment of a license to an event. | 102 | Assignment of a license to an event. |
| 102 | 103 | ||
| 103 | ```json | 104 | ```jsonc |
| 104 | { | 105 | { |
| 105 | "kind": 1985, | 106 | "kind": 1985, |
| 106 | "tags": [ | 107 | "tags": [ |
| @@ -108,14 +109,14 @@ Assignment of a license to an event. | |||
| 108 | ["l", "MIT", "license"], | 109 | ["l", "MIT", "license"], |
| 109 | ["e", <event_id>, <relay_url>] | 110 | ["e", <event_id>, <relay_url>] |
| 110 | ], | 111 | ], |
| 111 | ... | 112 | // other fields... |
| 112 | } | 113 | } |
| 113 | ``` | 114 | ``` |
| 114 | 115 | ||
| 115 | Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author | 116 | Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author |
| 116 | is labeling their note as being related to Milan, Italy using ISO 3166-2. | 117 | is labeling their note as being related to Milan, Italy using ISO 3166-2. |
| 117 | 118 | ||
| 118 | ```json | 119 | ```jsonc |
| 119 | { | 120 | { |
| 120 | "kind": 1, | 121 | "kind": 1, |
| 121 | "tags": [ | 122 | "tags": [ |
| @@ -123,15 +124,29 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2. | |||
| 123 | ["l", "IT-MI", "ISO-3166-2"] | 124 | ["l", "IT-MI", "ISO-3166-2"] |
| 124 | ], | 125 | ], |
| 125 | "content": "It's beautiful here in Milan!", | 126 | "content": "It's beautiful here in Milan!", |
| 126 | ... | 127 | // other fields... |
| 128 | } | ||
| 129 | ``` | ||
| 130 | |||
| 131 | Author is labeling their note language as English using ISO-639-1. | ||
| 132 | |||
| 133 | ```jsonc | ||
| 134 | { | ||
| 135 | "kind": 1, | ||
| 136 | "tags": [ | ||
| 137 | ["L", "ISO-639-1"], | ||
| 138 | ["l", "en", "ISO-639-1"] | ||
| 139 | ], | ||
| 140 | "content": "English text", | ||
| 141 | // other fields... | ||
| 127 | } | 142 | } |
| 128 | ``` | 143 | ``` |
| 129 | 144 | ||
| 130 | Other Notes | 145 | Other Notes |
| 131 | ----------- | 146 | ----------- |
| 132 | 147 | ||
| 133 | When using this NIP to bulk-label many targets at once, events may be deleted and a replacement | 148 | When using this NIP to bulk-label many targets at once, events may be requested for deletion using [NIP-09](09.md) and a replacement |
| 134 | may be published. We have opted not to use parameterizable/replaceable events for this due to the | 149 | may be published. We have opted not to use addressable/replaceable events for this due to the |
| 135 | complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying, | 150 | complexity in coming up with a standard `d` tag. In order to avoid ambiguity when querying, |
| 136 | publishers SHOULD limit labeling events to a single namespace. | 151 | publishers SHOULD limit labeling events to a single namespace. |
| 137 | 152 | ||
| @@ -154,8 +169,8 @@ be handled in some other way. | |||
| 154 | 169 | ||
| 155 | 170 | ||
| 156 | Appendix: Known Ontologies | 171 | Appendix: Known Ontologies |
| 157 | ------------------------- | 172 | -------------------------- |
| 158 | 173 | ||
| 159 | Below is a non-exhaustive list of ontologies currently in widespread use. | 174 | Below is a non-exhaustive list of ontologies currently in widespread use. |
| 160 | 175 | ||
| 161 | - (social.ontolo.categories)[https://ontolo.social/] | 176 | - [social.ontolo.categories](https://ontolo.social/) |