upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--32.md129
-rw-r--r--README.md1
2 files changed, 130 insertions, 0 deletions
diff --git a/32.md b/32.md
new file mode 100644
index 0000000..7bb5106
--- /dev/null
+++ b/32.md
@@ -0,0 +1,129 @@
1NIP-32
2======
3
4Labeling
5---------
6
7`draft` `optional` `author:staab` `author:gruruya`
8
9A label is a `kind 1985` note that is used to label other entities. This supports a number of use cases:
10
11- Distributed moderation and content recommendations
12- Reviews and ratings
13- Definition of edges in a graph structure
14
15This NIP does not supersede NIP-56, which supports reporting content for the purpose of
16direct moderation, in order to comply with laws or app store requirements. "Moderation"
17as defined by this NIP is only relative to user preferences and should be interpreted
18with the social graph in view to provide a better user experience.
19
20Label Target
21----
22
23The label event MUST include one or more tags representing the object or objects being
24labeled: `e`, `p`, `r`, or `t` tags. This allows for labeling of events, people, relays,
25or topics respectively.
26
27Label Tag
28----
29
30This NIP introduces a new tag `l` which denotes a label. A label MAY be an unqualified string indicating the type of content based on convention, a qualified string referring to a tag type within nostr, or a qualified string referring to a nomenclature external to nostr. Some examples:
31
32- `review` - the publisher is leaving a review about the given entity.
33- `#t/footstr` - the publisher thinks the given entity should have the `footstr` topic applied.
34- `#p/<pubkey>` - the publisher things the given entity should be tagged with with `<pubkey>`
35- `MeSH/D005528` - ["Foot"](https://meshb.nlm.nih.gov/record/ui?ui=D005528) from NIH's Medical Subject Headings vocabulary
36- `GeoNames/3173435` - [Milan, Italy](https://www.geonames.org/3173435/milan.html) using the GeoNames coding system
37- `ISO-3166-2/IT-MI` - Milano, Italy using ISO 3166-2.
38
39As much as possible, fully-qualified labels should be used.
40
41Other Tags
42-----
43
44The label event MAY include a `quality` tag with a value of 0 to 1. This allows for an
45absolute, granular scale that can be represented in any way (5 stars, color scale, etc).
46
47The label event MAY include a `confidence` tag with a value of 0 to 1. This indicates the certainty which the author has about their rating.
48
49Example events
50--------------
51
52A report that an event contains nudity.
53
54```json
55{
56 "kind": 1985,
57 "tags": [
58 ["e", <id>]
59 ["l", "nudity"],
60 ],
61 "content": "",
62 ...
63}
64```
65
66A suggestion that multiple pubkeys be associated with the `permies` topic.
67
68```json
69{
70 "kind": 1985,
71 "tags": [
72 ["l", "#t/permies"],
73 ["p", <pubkey1>],
74 ["p", <pubkey2>],
75 ],
76 "content": "",
77 ...
78}
79```
80
81A review of a relay, as relates to certain topics, including additional dimensions. The author
82is indicating here that `relay_url` is related to the bitcoin topic, but they're not very sure
83that's the case.
84
85```json
86{
87 "kind": 1985,
88 "tags": [
89 ["l", "#t/bitcoin"],
90 ["r", <relay_url>],
91 ["quality", 0.7],
92 ["confidence", 0.2],
93 ],
94 "content": "I think this relay is mostly just bitcoiners.",
95 ...
96}
97```
98
99A plain review of a relay.
100
101```json
102{
103 "kind": 1985,
104 "tags": [
105 ["l", "review"],
106 ["r", <relay_url>],
107 ["quality", 0.1],
108 ],
109 "content": "This relay is full of mean people.",
110 ...
111}
112```
113
114A more abstract use case: defining an edge in a graph structure, in this case identifying
115a lightning channel that is open between two pubkeys. This just demonstrates the flexibility
116this spec provides for overlaying structured metadata on top of nostr.
117
118```json
119{
120 "kind": 1985,
121 "tags": [
122 ["l", "lightning/channel"],
123 ["p", <pubkey1>],
124 ["p", <pubkey2>],
125 ],
126 "content": "<channel_id>",
127 ...
128}
129```
diff --git a/README.md b/README.md
index a940ba6..b3b1550 100644
--- a/README.md
+++ b/README.md
@@ -47,6 +47,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
47- [NIP-28: Public Chat](28.md) 47- [NIP-28: Public Chat](28.md)
48- [NIP-30: Custom Emoji](30.md) 48- [NIP-30: Custom Emoji](30.md)
49- [NIP-31: Dealing with Unknown Events](31.md) 49- [NIP-31: Dealing with Unknown Events](31.md)
50- [NIP-32: Labeling](32.md)
50- [NIP-33: Parameterized Replaceable Events](33.md) 51- [NIP-33: Parameterized Replaceable Events](33.md)
51- [NIP-36: Sensitive Content](36.md) 52- [NIP-36: Sensitive Content](36.md)
52- [NIP-39: External Identities in Profiles](39.md) 53- [NIP-39: External Identities in Profiles](39.md)