diff options
Diffstat (limited to '32.md')
| -rw-r--r-- | 32.md | 47 |
1 files changed, 30 insertions, 17 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 |
| @@ -58,7 +57,7 @@ Example events | |||
| 58 | 57 | ||
| 59 | A suggestion that multiple pubkeys be associated with the `permies` topic. | 58 | A suggestion that multiple pubkeys be associated with the `permies` topic. |
| 60 | 59 | ||
| 61 | ```json | 60 | ```jsonc |
| 62 | { | 61 | { |
| 63 | "kind": 1985, | 62 | "kind": 1985, |
| 64 | "tags": [ | 63 | "tags": [ |
| @@ -67,13 +66,13 @@ A suggestion that multiple pubkeys be associated with the `permies` topic. | |||
| 67 | ["p", <pubkey1>, <relay_url>], | 66 | ["p", <pubkey1>, <relay_url>], |
| 68 | ["p", <pubkey2>, <relay_url>] | 67 | ["p", <pubkey2>, <relay_url>] |
| 69 | ], | 68 | ], |
| 70 | ... | 69 | // other fields... |
| 71 | } | 70 | } |
| 72 | ``` | 71 | ``` |
| 73 | 72 | ||
| 74 | 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. |
| 75 | 74 | ||
| 76 | ```json | 75 | ```jsonc |
| 77 | { | 76 | { |
| 78 | "kind": 1985, | 77 | "kind": 1985, |
| 79 | "tags": [ | 78 | "tags": [ |
| @@ -82,13 +81,13 @@ A report flagging violence toward a human being as defined by ontology.example.c | |||
| 82 | ["p", <pubkey1>, <relay_url>], | 81 | ["p", <pubkey1>, <relay_url>], |
| 83 | ["p", <pubkey2>, <relay_url>] | 82 | ["p", <pubkey2>, <relay_url>] |
| 84 | ], | 83 | ], |
| 85 | ... | 84 | // other fields... |
| 86 | } | 85 | } |
| 87 | ``` | 86 | ``` |
| 88 | 87 | ||
| 89 | A moderation suggestion for a chat event. | 88 | A moderation suggestion for a chat event. |
| 90 | 89 | ||
| 91 | ```json | 90 | ```jsonc |
| 92 | { | 91 | { |
| 93 | "kind": 1985, | 92 | "kind": 1985, |
| 94 | "tags": [ | 93 | "tags": [ |
| @@ -96,13 +95,13 @@ A moderation suggestion for a chat event. | |||
| 96 | ["l", "approve", "nip28.moderation"], | 95 | ["l", "approve", "nip28.moderation"], |
| 97 | ["e", <kind40_event_id>, <relay_url>] | 96 | ["e", <kind40_event_id>, <relay_url>] |
| 98 | ], | 97 | ], |
| 99 | ... | 98 | // other fields... |
| 100 | } | 99 | } |
| 101 | ``` | 100 | ``` |
| 102 | 101 | ||
| 103 | Assignment of a license to an event. | 102 | Assignment of a license to an event. |
| 104 | 103 | ||
| 105 | ```json | 104 | ```jsonc |
| 106 | { | 105 | { |
| 107 | "kind": 1985, | 106 | "kind": 1985, |
| 108 | "tags": [ | 107 | "tags": [ |
| @@ -110,14 +109,14 @@ Assignment of a license to an event. | |||
| 110 | ["l", "MIT", "license"], | 109 | ["l", "MIT", "license"], |
| 111 | ["e", <event_id>, <relay_url>] | 110 | ["e", <event_id>, <relay_url>] |
| 112 | ], | 111 | ], |
| 113 | ... | 112 | // other fields... |
| 114 | } | 113 | } |
| 115 | ``` | 114 | ``` |
| 116 | 115 | ||
| 117 | 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 |
| 118 | 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. |
| 119 | 118 | ||
| 120 | ```json | 119 | ```jsonc |
| 121 | { | 120 | { |
| 122 | "kind": 1, | 121 | "kind": 1, |
| 123 | "tags": [ | 122 | "tags": [ |
| @@ -125,15 +124,29 @@ is labeling their note as being related to Milan, Italy using ISO 3166-2. | |||
| 125 | ["l", "IT-MI", "ISO-3166-2"] | 124 | ["l", "IT-MI", "ISO-3166-2"] |
| 126 | ], | 125 | ], |
| 127 | "content": "It's beautiful here in Milan!", | 126 | "content": "It's beautiful here in Milan!", |
| 128 | ... | 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... | ||
| 129 | } | 142 | } |
| 130 | ``` | 143 | ``` |
| 131 | 144 | ||
| 132 | Other Notes | 145 | Other Notes |
| 133 | ----------- | 146 | ----------- |
| 134 | 147 | ||
| 135 | 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 |
| 136 | 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 |
| 137 | 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, |
| 138 | publishers SHOULD limit labeling events to a single namespace. | 151 | publishers SHOULD limit labeling events to a single namespace. |
| 139 | 152 | ||
| @@ -156,7 +169,7 @@ be handled in some other way. | |||
| 156 | 169 | ||
| 157 | 170 | ||
| 158 | Appendix: Known Ontologies | 171 | Appendix: Known Ontologies |
| 159 | ------------------------- | 172 | -------------------------- |
| 160 | 173 | ||
| 161 | 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. |
| 162 | 175 | ||