I'm trying to implement a thing and struggle to make sense of NIP32 "Labeling". nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn nostr:npub1z7e7ml8kevdfdala8k0cthfhcvfhmxf8mt27qzc83pc8ay0m3zdqlgw4fh nostr:npub1veeqt66jt2j209y9nv4a90w3dej074lavqygq5q0c57dharkgw0qk738wt authored this. Anybody willing to clear some doubts?
Discussion
The nip mentions:
`e`, `p`, `a`, `r`, or `t` tags. This allows for labeling of events, people, relays, or topics respectively.
So e and a are events.
p is pubkeys, some of which represent people.
r being relays is as of nip01 explicitly not universal (e.g. an `"r"` tag may have a meaning in an event of kind 1 and an entirely different meaning in an event of kind 10002) so I wonder how do r-tags work. I found some 1985 events using r-tags for non-relay stuff.
t are topics? How do these work? In the wild I see events using t tags to reference IMDB movies by their ID.
Who wants to help me clarify the nip a bit?
So the following are kind-1985 events observed in the wild:
A)
e,fd87c3863a9044a60f507b952eb0391524f89d941acfec0830b233cab3c0568c
L,#t
l,Nostrasia,#t
B)
L,#t
e,0f2c0dfb2c5a67422999e26b68fe8ae326b9c4cb50cfbfce82056101ba30b917
l,#bitcoinlegal #Bitcoin #imagazine #strefabitcoina,#t
C)
L,#t
e,13a4d33bc1396b1e2e537b77b763d107d06d5f3b37e5cf817ed8870c0d784c87
l,philosophy,#t
l,epistemology,#t
l,defeater,#t
D)
L,#t
l,nostr-beginner,#t
r,httpsXXXnostr.Xhow/en/what-is-nostr
E)
L,#e
l,question/summary,#e
e,1e49a2b5415c1949030c8f3de113f10d31a16501a1220e0445ab3a3500b2fdc8
F)
nonce,37551,15
t,tt2906216
r,tt2906216
l,nostr-movie/rating,tt2906216,{"quality": 0.7}
r,ImdbId,tt2906216
r,tmdbId,493529
r,name,Dungeons & Dragons: Honor Among Thieves
l,year,2023
l,postRatingId,true
My guess of the intended use is:
A) Assign hashtag Nostrasia to event fd...
B) Assign multiple hashtags to event 0f...
C) Assign multiple hashtags to event 13... the right way?
D) Assign hashtag "nostr-beginner" to ... a url referenced using an r-tag
E) Assign label "question/summary" to event 1e...
F) WHAT? Lack of L-tag is against nip-32. Somehow if there was additional tags like L,year, l,year,2023 could make sense as l,2023,year, right?
So my confusion is why would one use L,#t and another L,#e and how can we help whoever is trying to mirror IMDB on relays?
B is wrong, F is hot garbage but could be done with NIP 32 using "[L, mymovienamespace], [l, year, 2023, mymovienamespace]"
with l,year,2023 you couldn't query for movies from 2023.
I misspoke, labels should not have values. The spec supports them in the 4th place but probably shouldn't. nostr:nprofile1qqswfa547pdmqkerzf2uen3agudc67wxffjmenqpge3dylc006fppysppemhxue69uhkummn9ekx7mp0qydhwumn8ghj7mn0wd68ytn0wfskuem9wp5kcmpwv3jhvtcpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhslx9fgh had this use case as well, but labels are not meant to be a general purpose data store
r just means "resource", so may be any url, including a relay url. t tags should be human readable topics, referencing an id with a t tag is incorrect. All those tags in nip32 are " targets", so the things being labeled. Does that help?
Thanks for the reply. I'll try to come up with a patch for the nip so others don't have to struggle there.
What issues are you having? What type of labeling are you trying to implement?
I want community ratings for Bitcoin wallets. The whole thing can get arbitrarily complex where raters might get accredited as experts and they don't only rate from one to five stars but also attest to features and security aspects with long-form reviews backing their ratings.
I don't want to re-invent the wheel and saw that nip32 was for ratings and labels such as bech32 support or lightning support etc. so my hope is that if I do this right, other clients could also author or correctly interpret what comes out from my product.
I have a PR open to remove the ratings component actually. It ended up being a poor fit. I still need ratings though, so feel free to nip it and I'll pitch in.