upleb.uk

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

summaryrefslogtreecommitdiff
path: root/32.md
diff options
context:
space:
mode:
authorgsovereignty <gsovereignty@proton.me>2023-11-14 09:13:20 +0800
committerGitHub <noreply@github.com>2023-11-14 09:13:20 +0800
commitb06375d164ffa8d2f56df40b037be6ec52f3483e (patch)
tree8bf8d249b9c0da49f66ddd81e0ed892989d79882 /32.md
parentc5930de1076a747eb8181267a76ddaba8a8aad67 (diff)
parentb6c7a255102a65c4978b465a85f124e910e82a2d (diff)
Merge branch 'master' into patch-3
Diffstat (limited to '32.md')
-rw-r--r--32.md114
1 files changed, 68 insertions, 46 deletions
diff --git a/32.md b/32.md
index ddd364a..f8dc002 100644
--- a/32.md
+++ b/32.md
@@ -6,50 +6,38 @@ Labeling
6 6
7`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay` 7`draft` `optional` `author:staab` `author:gruruya` `author:s3x-jay`
8 8
9A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases, from distributed moderation and content recommendations to reviews and ratings. 9A label is a `kind 1985` event that is used to label other entities. This supports a number of use cases,
10including distributed moderation, collection management, license assignment, and content classification.
10 11
11Label Target 12This NIP introduces two new tags:
12----
13 13
14The label event MUST include one or more tags representing the object or objects being 14- `L` denotes a label namespace
15labeled: `e`, `p`, `a`, `r`, or `t` tags. This allows for labeling of events, people, relays, 15- `l` denotes a label
16or topics respectively. As with NIP-01, a relay hint SHOULD be included when using `e` and
17`p` tags.
18 16
19Label Tag 17Label Namespace Tag
20---- 18----
21 19
22This NIP introduces a new tag `l` which denotes a label, and a new `L` tag which denotes a label namespace. 20An `L` tag can be any string, but publishers SHOULD ensure they are unambiguous by using a well-defined namespace
23A label MUST include a mark matching an `L` tag. `L` tags refer to a tag type within nostr, or a nomenclature 21(such as an ISO standard) or reverse domain name notation.
24external to nostr defined either formally or by convention. Any string can be a namespace, but publishers SHOULD
25ensure they are unambiguous by using a well-defined namespace (such as an ISO standard) or reverse domain name notation.
26
27Namespaces starting with `#` indicate that the label target should be associated with the label's value.
28This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc.
29
30Some examples:
31 22
32- `["l", "footstr", "#t"]` - the publisher thinks the given entity should have the `footstr` topic applied. 23`L` tags are REQUIRED in order to support searching by namespace rather than by a specific tag. The special `ugc`
33- `["l", "<pubkey>", "#p"]` - the publisher thinks the given entity is related to `<pubkey>` 24("user generated content") namespace MAY be used when the label content is provided by an end user.
34- `["l", "IT-MI", "ISO-3166-2"]` - Milano, Italy using ISO 3166-2.
35- `["l", "VI-hum", "com.example.ontology"]` - Violence toward a human being as defined by ontology.example.com.
36 25
37`L` tags containing the label namespaces MUST be included in order to support searching by 26`L` tags starting with `#` indicate that the label target should be associated with the label's value.
38namespace rather than by a specific tag. The special `ugc` ("user generated content") namespace 27This is a way of attaching standard nostr tags to events, pubkeys, relays, urls, etc.
39MAY be used when the label content is provided by an end user.
40 28
41`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events 29Label Tag
42with a kind other than 1985, labels refer to the event itself. 30----
43 31
44Label Annotations 32An `l` tag's value can be any string. `l` tags MUST include a `mark` matching an `L` tag value in the same event.
45-----
46 33
47A label tag MAY include a 4th positional element detailing extra metadata about the label in question. This string 34Label Target
48should be a json-encoded object. Any key MAY be used, but the following are recommended: 35----
49 36
50- `quality` may have a value of 0 to 1. This allows for an absolute, granular scale that can be represented in any way (5 stars, color scale, etc). 37The label event MUST include one or more tags representing the object or objects being
51- `confidence` may have a value of 0 to 1. This indicates the certainty which the author has about their rating. 38labeled: `e`, `p`, `a`, `r`, or `t` tags. This allows for labeling of events, people, relays,
52- `context` may be an array of urls (including NIP-21 urls) indicating other context that should be considered when interpreting labels. 39or topics respectively. As with NIP-01, a relay hint SHOULD be included when using `e` and
40`p` tags.
53 41
54Content 42Content
55------- 43-------
@@ -57,6 +45,12 @@ Content
57Labels should be short, meaningful strings. Longer discussions, such as for a review, or an 45Labels should be short, meaningful strings. Longer discussions, such as for a review, or an
58explanation of why something was labeled the way it was, should go in the event's `content` field. 46explanation of why something was labeled the way it was, should go in the event's `content` field.
59 47
48Self-Reporting
49-------
50
51`l` and `L` tags MAY be added to other event kinds to support self-reporting. For events
52with a kind other than 1985, labels refer to the event itself.
53
60Example events 54Example events
61-------------- 55--------------
62 56
@@ -70,38 +64,61 @@ A suggestion that multiple pubkeys be associated with the `permies` topic.
70 ["l", "permies", "#t"], 64 ["l", "permies", "#t"],
71 ["p", <pubkey1>, <relay_url>], 65 ["p", <pubkey1>, <relay_url>],
72 ["p", <pubkey2>, <relay_url>] 66 ["p", <pubkey2>, <relay_url>]
73 ], 67 ]
74 "content": "",
75 ...
76} 68}
77``` 69```
78 70
79A review of a relay. 71A report flagging violence toward a human being as defined by ontology.example.com.
80 72
81```json 73```json
82{ 74{
83 "kind": 1985, 75 "kind": 1985,
84 "tags": [ 76 "tags": [
85 ["L", "com.example.ontology"], 77 ["L", "com.example.ontology"],
86 ["l", "relay/review", "com.example.ontology", "{\"quality\": 0.1}"], 78 ["l", "VI-hum", "com.example.ontology"],
87 ["r", <relay_url>] 79 ["p", <pubkey1>, <relay_url>],
80 ["p", <pubkey2>, <relay_url>]
81 ]
82}
83```
84
85A moderation suggestion for a chat event.
86
87```json
88{
89 "kind": 1985,
90 "tags": [
91 ["L", "nip28.moderation"],
92 ["l", "approve", "nip28.moderation"],
93 ["e", <kind40_event_id>, <relay_url>]
94 ],
95}
96```
97
98Assignment of a license to an event.
99
100```json
101{
102 "kind": 1985,
103 "tags": [
104 ["L", "license"],
105 ["l", "MIT", "license"],
106 ["e", <event_id>, <relay_url>]
88 ], 107 ],
89 "content": "This relay is full of mean people.",
90 ...
91} 108}
92``` 109```
93 110
94Publishers can self-label by adding `l` tags to their own non-1985 events. 111Publishers can self-label by adding `l` tags to their own non-1985 events. In this case, the kind 1 event's author
112is labeling their note as being related to Milan, Italy using ISO 3166-2.
95 113
96```json 114```json
97{ 115{
98 "kind": 1, 116 "kind": 1,
99 "tags": [ 117 "tags": [
100 ["L", "com.example.ontology"], 118 ["L", "ISO-3166-2"],
101 ["l", "IL-frd", "com.example.ontology"] 119 ["l", "IT-MI", "ISO-3166-2"]
102 ], 120 ],
103 "content": "Send me 100 sats and I'll send you 200 back", 121 "content": "It's beautiful here in Milan!",
104 ...
105} 122}
106``` 123```
107 124
@@ -124,3 +141,8 @@ Vocabularies MAY choose to fully qualify all labels within a namespace (for exam
124formal vocabularies that should not be confused with another namespace when querying 141formal vocabularies that should not be confused with another namespace when querying
125without an `L` tag. For these vocabularies, all labels SHOULD include the namespace 142without an `L` tag. For these vocabularies, all labels SHOULD include the namespace
126(rather than mixing qualified and unqualified labels). 143(rather than mixing qualified and unqualified labels).
144
145A good heuristic for whether a use case fits this NIP is whether labels would ever be unique.
146For example, many events might be labeled with a particular place, topic, or pubkey, but labels
147with specific values like "John Doe" or "3.18743" are not labels, they are values, and should
148be handled in some other way.