nostr-nip-profile-label
= Profile Labeling
This NIP defines two new event kinds (30382 and 31382) to attach labels to profiles.
Both kinds offer public and private tags to describe these labels. Private tags are JSON Stringified, NIP-44-encrypted to the signer’s keys and placed inside the .content of the event.
== Public Profile Labels
Event kind 30382 is used when the labels themselves are public. The d tag contains the target public key in hex.
{
"kind": 30382,
"tags": [
["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"],
["n", "My Network"],
["n", "6064460175057025"],
["a", "30009:communityName:member", "wss://relay.example.com"],
["a", "30009:bob:fren", "wss://relay.example.com"]
],
"content": nip44Encrypt(JSON.stringify([
["petname", "NVK (Coldcard)"],
["summary", "Owes me a beer"]
])),
// ...other fields
}
petname SHOULD be rendered instead of the person’s display name in all interfaces when the signer of this event is logged in.
== Label Categories
Optional n tags ["n", "<identifier>"] add the target key to labeled sets. This allows clients to query by n and download all members of a set. The set identifier can be human readable and public or not.
The a tags ["a", "<identifier>", "<relay url>"] serve as a (retractable) way to hand out Badges to profiles.
For private cases, a new event kind named “Event Set Names” (kind:10008) uses map tags to store the set name. Clients SHOULD display the name instead of the identifier if the identifier is present in this event.
{
"kind": 10008,
"content": nip44Encrypt(JSON.stringify([
["map", "<identifier>", "<name>"],
["map", "bitcoiner", "bitcoiner"],
["map", "6064460175057025", "debtor"]
])),
// ...other fields
}
== Private Profile Labels
For labels that must remain private (e.g private follows, client lists, etc), the event kind 31382 uses a similar structure but with a hashed d tag using NIP-44’s hkdf function.
== Label Acceptance
Profiles can accept labels by including them in their kind 0 (metadata) event. This serves as an explicit acknowledgment of the label. The accepted labels should be stored in a badges or labels tag within the kind 0 event.
{
"kind": 0,
"tags": [
["name", "Alice"],
["about", "..."],
["badges", <specfific kind 30382 event id>, <specfific kind 30382 event id>, <specfific kind 30382 event id>]
["labels", <specfific kind 30382 event id>, <specfific kind 30382 event id>, <specfific kind 30382 event id>]
]
}
When a profile accepts a label, clients SHOULD display it as an official part of their profile. Labels that haven’t been accepted MAY be displayed differently or with a visual indicator to show they are pending acceptance.
Comments
Public conversation about this article.
No comments yet.
Article metadata
About this entry
Event Id
Raw event
Other authors
No one else has published this topic yet.
