mirror of
https://github.com/nostr-protocol/nips.git
synced 2026-10-05 18:58:44 +00:00
NIP-58: change Profile Badges to kind 10008, add kind 30008 Badge sets (#2276)
This commit is contained in:
@@ -31,6 +31,7 @@ For example, _mute list_ can contain the public keys of spammers and bad actors
|
||||
| Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) |
|
||||
| Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) |
|
||||
| Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) |
|
||||
| Profile badges | 10008 | [NIP-58](58.md) badges a user has accepted and chosen to display | `"a"` (kind:30009 badge definitions) and `"e"` (kind:8 badge awards), and `"a"` (kind:30008 badge set) |
|
||||
| Simple groups | 10009 | [NIP-29](29.md) groups the user is in | `"group"` ([NIP-29](29.md) group id + relay URL + optional group name), `"r"` for each relay in use |
|
||||
| Relay feeds | 10012 | user favorite browsable relays (and relay sets) | `"relay"` (relay URLs) and `"a"` (kind:30002 relay set) |
|
||||
| Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) |
|
||||
@@ -59,6 +60,7 @@ Aside from their main identifier, the `"d"` tag, sets can optionally have a `"ti
|
||||
| Curation sets | 30005 | groups of videos picked by users as interesting and/or belonging to the same category | `"e"` (kind:21 videos) |
|
||||
| Curation sets | 30006 | groups of pictures picked by users as interesting and/or belonging to the same category | `"e"` (kind:20 pictures) |
|
||||
| Kind mute sets | 30007 | mute pubkeys by kinds<br>`"d"` tag MUST be the kind string | `"p"` (pubkeys) |
|
||||
| Badge sets | 30008 | [NIP-58](58.md) categorized groups of badges | `"a"` (kind:30009 badge definitions) and `"e"` (kind:8 badge awards) |
|
||||
| Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) |
|
||||
| Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) |
|
||||
| Release artifact sets | 30063 | group of artifacts of a software release | `"e"` (kind:1063 [file metadata](94.md) events), `"a"` (software application event) |
|
||||
|
||||
@@ -6,15 +6,18 @@ Badges
|
||||
|
||||
`draft` `optional`
|
||||
|
||||
Three special events are used to define, award and display badges in
|
||||
Four special events are used to define, award, display and categorize badges in
|
||||
user profiles:
|
||||
|
||||
1. A "Badge Definition" event is defined as an addressable event with kind `30009` having a `d` tag with a value that uniquely identifies the badge (e.g. `bravery`) published by the badge issuer. Badge definitions can be updated.
|
||||
|
||||
2. A "Badge Award" event is a kind `8` event with a single `a` tag referencing a "Badge Definition" event and one or more `p` tags, one for each pubkey the badge issuer wishes to award. Awarded badges are immutable and non-transferable.
|
||||
|
||||
3. A "Profile Badges" event is defined as an _addressable event_ with kind `30008` with a `d` tag with the value `profile_badges`.
|
||||
Profile badges contain an ordered list of pairs of `a` and `e` tags referencing a `Badge Definition` and a `Badge Award` for each badge to be displayed.
|
||||
3. A "Profile Badges" event is defined as a _replaceable event_ with kind `10008` as a [NIP-51](51.md) standard list.
|
||||
Profile badges contain an ordered list of pairs of `a` and `e` tags referencing a `Badge Definition` and a `Badge Award` for each badge to be displayed. It may also contain `a` tags referencing "Badge Set" events.
|
||||
|
||||
4. A "Badge Set" event is defined as an _addressable event_ with kind `30008` as a [NIP-51](51.md) set.
|
||||
Badge sets allow users to categorize accepted badges into labeled groups. They contain ordered pairs of `a` and `e` tags referencing a `Badge Definition` and a `Badge Award` for each badge in the set.
|
||||
|
||||
### Badge Definition event
|
||||
|
||||
@@ -43,10 +46,6 @@ The number of badges a pubkey can be awarded is unbounded. The Profile Badge
|
||||
event allows individual users to accept or reject awarded badges, as well
|
||||
as choose the display order of badges on their profiles.
|
||||
|
||||
The following tags MUST be present:
|
||||
|
||||
- A `d` tag with the unique identifier `profile_badges`
|
||||
|
||||
The following tags MAY be present:
|
||||
|
||||
- Zero or more ordered consecutive pairs of `a` and `e` tags referencing a kind `30009` Badge Definition and kind `8` Badge Award, respectively. Clients SHOULD
|
||||
@@ -109,10 +108,9 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according
|
||||
Honorable Bob The Brave:
|
||||
```jsonc
|
||||
{
|
||||
"kind": 30008,
|
||||
"kind": 10008,
|
||||
"pubkey": "bob",
|
||||
"tags": [
|
||||
["d", "profile_badges"],
|
||||
["a", "30009:alice:bravery"],
|
||||
["e", "<bravery badge award event id>", "wss://nostr.academy"],
|
||||
["a", "30009:alice:honor"],
|
||||
@@ -121,3 +119,7 @@ Honorable Bob The Brave:
|
||||
// other fields...
|
||||
}
|
||||
```
|
||||
|
||||
### Deprecated Profile Badges event
|
||||
|
||||
An earlier version of this NIP used a kind `30008` addressable event with a `d` tag value of `profile_badges` for the Profile Badges event. Clients should treat these events as equivalent to kind `10008` and migrate to the new format.
|
||||
|
||||
@@ -205,6 +205,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `10005` | Public chats list | [51](51.md) |
|
||||
| `10006` | Blocked relays list | [51](51.md) |
|
||||
| `10007` | Search relays list | [51](51.md) |
|
||||
| `10008` | Profile Badges | [51](51.md), [58](58.md) |
|
||||
| `10009` | User groups | [51](51.md), [29](29.md) |
|
||||
| `10011` | External Identities | [39](39.md) |
|
||||
| `10012` | Favorite relays list | [51](51.md) |
|
||||
@@ -244,7 +245,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
||||
| `30005` | Video sets | [51](51.md) |
|
||||
| `30006` | Picture sets | [51](51.md) |
|
||||
| `30007` | Kind mute sets | [51](51.md) |
|
||||
| `30008` | Profile Badges | [58](58.md) |
|
||||
| `30008` | Badge sets | [51](51.md), [58](58.md) |
|
||||
| `30009` | Badge Definition | [58](58.md) |
|
||||
| `30015` | Interest sets | [51](51.md) |
|
||||
| `30017` | Create or update a stall | [15](15.md) |
|
||||
|
||||
Reference in New Issue
Block a user