diff options
Diffstat (limited to '32.md')
| -rw-r--r-- | 32.md | 129 |
1 files changed, 129 insertions, 0 deletions
| @@ -0,0 +1,129 @@ | |||
| 1 | NIP-32 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Labeling | ||
| 5 | --------- | ||
| 6 | |||
| 7 | `draft` `optional` `author:staab` `author:gruruya` | ||
| 8 | |||
| 9 | A 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 | |||
| 15 | This NIP does not supersede NIP-56, which supports reporting content for the purpose of | ||
| 16 | direct moderation, in order to comply with laws or app store requirements. "Moderation" | ||
| 17 | as defined by this NIP is only relative to user preferences and should be interpreted | ||
| 18 | with the social graph in view to provide a better user experience. | ||
| 19 | |||
| 20 | Label Target | ||
| 21 | ---- | ||
| 22 | |||
| 23 | The label event MUST include one or more tags representing the object or objects being | ||
| 24 | labeled: `e`, `p`, `r`, or `t` tags. This allows for labeling of events, people, relays, | ||
| 25 | or topics respectively. | ||
| 26 | |||
| 27 | Label Tag | ||
| 28 | ---- | ||
| 29 | |||
| 30 | This 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 | |||
| 39 | As much as possible, fully-qualified labels should be used. | ||
| 40 | |||
| 41 | Other Tags | ||
| 42 | ----- | ||
| 43 | |||
| 44 | The label event MAY include a `quality` tag with a value of 0 to 1. This allows for an | ||
| 45 | absolute, granular scale that can be represented in any way (5 stars, color scale, etc). | ||
| 46 | |||
| 47 | The 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 | |||
| 49 | Example events | ||
| 50 | -------------- | ||
| 51 | |||
| 52 | A 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 | |||
| 66 | A 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 | |||
| 81 | A review of a relay, as relates to certain topics, including additional dimensions. The author | ||
| 82 | is indicating here that `relay_url` is related to the bitcoin topic, but they're not very sure | ||
| 83 | that'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 | |||
| 99 | A 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 | |||
| 114 | A more abstract use case: defining an edge in a graph structure, in this case identifying | ||
| 115 | a lightning channel that is open between two pubkeys. This just demonstrates the flexibility | ||
| 116 | this 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 | ``` | ||