diff options
| author | Alex Gleason <alex@alexgleason.me> | 2026-04-01 14:17:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-01 16:17:44 -0300 |
| commit | 420f0b181434c348e487c6ffaa8fea6111c10210 (patch) | |
| tree | 7af8688f07284bc637205811987af5a520ec2c4d | |
| parent | ad8f29090795c03ad68c0b29e8e1af906c0e614d (diff) | |
NIP-58: change Profile Badges to kind 10008, add kind 30008 Badge sets (#2276)
| -rw-r--r-- | 51.md | 2 | ||||
| -rw-r--r-- | 58.md | 20 | ||||
| -rw-r--r-- | README.md | 3 |
3 files changed, 15 insertions, 10 deletions
| @@ -31,6 +31,7 @@ For example, _mute list_ can contain the public keys of spammers and bad actors | |||
| 31 | | Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) | | 31 | | Public chats | 10005 | [NIP-28](28.md) chat channels the user is in | `"e"` (kind:40 channel definitions) | |
| 32 | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | | 32 | | Blocked relays | 10006 | relays clients should never connect to | `"relay"` (relay URLs) | |
| 33 | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | | 33 | | Search relays | 10007 | relays clients should use when performing search queries | `"relay"` (relay URLs) | |
| 34 | | 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) | | ||
| 34 | | 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 | | 35 | | 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 | |
| 35 | | Relay feeds | 10012 | user favorite browsable relays (and relay sets) | `"relay"` (relay URLs) and `"a"` (kind:30002 relay set) | | 36 | | Relay feeds | 10012 | user favorite browsable relays (and relay sets) | `"relay"` (relay URLs) and `"a"` (kind:30002 relay set) | |
| 36 | | Interests | 10015 | topics a user may be interested in and pointers | `"t"` (hashtags) and `"a"` (kind:30015 interest set) | | 37 | | 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 | |||
| 59 | | Curation sets | 30005 | groups of videos picked by users as interesting and/or belonging to the same category | `"e"` (kind:21 videos) | | 60 | | Curation sets | 30005 | groups of videos picked by users as interesting and/or belonging to the same category | `"e"` (kind:21 videos) | |
| 60 | | Curation sets | 30006 | groups of pictures picked by users as interesting and/or belonging to the same category | `"e"` (kind:20 pictures) | | 61 | | Curation sets | 30006 | groups of pictures picked by users as interesting and/or belonging to the same category | `"e"` (kind:20 pictures) | |
| 61 | | Kind mute sets | 30007 | mute pubkeys by kinds<br>`"d"` tag MUST be the kind string | `"p"` (pubkeys) | | 62 | | Kind mute sets | 30007 | mute pubkeys by kinds<br>`"d"` tag MUST be the kind string | `"p"` (pubkeys) | |
| 63 | | Badge sets | 30008 | [NIP-58](58.md) categorized groups of badges | `"a"` (kind:30009 badge definitions) and `"e"` (kind:8 badge awards) | | ||
| 62 | | Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) | | 64 | | Interest sets | 30015 | interest topics represented by a bunch of "hashtags" | `"t"` (hashtags) | |
| 63 | | Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | | 65 | | Emoji sets | 30030 | categorized emoji groups | `"emoji"` (see [NIP-30](30.md)) | |
| 64 | | Release artifact sets | 30063 | group of artifacts of a software release | `"e"` (kind:1063 [file metadata](94.md) events), `"a"` (software application event) | | 66 | | 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 | |||
| 6 | 6 | ||
| 7 | `draft` `optional` | 7 | `draft` `optional` |
| 8 | 8 | ||
| 9 | Three special events are used to define, award and display badges in | 9 | Four special events are used to define, award, display and categorize badges in |
| 10 | user profiles: | 10 | user profiles: |
| 11 | 11 | ||
| 12 | 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. | 12 | 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. |
| 13 | 13 | ||
| 14 | 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. | 14 | 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. |
| 15 | 15 | ||
| 16 | 3. A "Profile Badges" event is defined as an _addressable event_ with kind `30008` with a `d` tag with the value `profile_badges`. | 16 | 3. A "Profile Badges" event is defined as a _replaceable event_ with kind `10008` as a [NIP-51](51.md) standard list. |
| 17 | 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. | 17 | 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. |
| 18 | |||
| 19 | 4. A "Badge Set" event is defined as an _addressable event_ with kind `30008` as a [NIP-51](51.md) set. | ||
| 20 | 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. | ||
| 18 | 21 | ||
| 19 | ### Badge Definition event | 22 | ### Badge Definition event |
| 20 | 23 | ||
| @@ -43,10 +46,6 @@ The number of badges a pubkey can be awarded is unbounded. The Profile Badge | |||
| 43 | event allows individual users to accept or reject awarded badges, as well | 46 | event allows individual users to accept or reject awarded badges, as well |
| 44 | as choose the display order of badges on their profiles. | 47 | as choose the display order of badges on their profiles. |
| 45 | 48 | ||
| 46 | The following tags MUST be present: | ||
| 47 | |||
| 48 | - A `d` tag with the unique identifier `profile_badges` | ||
| 49 | |||
| 50 | The following tags MAY be present: | 49 | The following tags MAY be present: |
| 51 | 50 | ||
| 52 | - 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 | 51 | - 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 | |||
| 109 | Honorable Bob The Brave: | 108 | Honorable Bob The Brave: |
| 110 | ```jsonc | 109 | ```jsonc |
| 111 | { | 110 | { |
| 112 | "kind": 30008, | 111 | "kind": 10008, |
| 113 | "pubkey": "bob", | 112 | "pubkey": "bob", |
| 114 | "tags": [ | 113 | "tags": [ |
| 115 | ["d", "profile_badges"], | ||
| 116 | ["a", "30009:alice:bravery"], | 114 | ["a", "30009:alice:bravery"], |
| 117 | ["e", "<bravery badge award event id>", "wss://nostr.academy"], | 115 | ["e", "<bravery badge award event id>", "wss://nostr.academy"], |
| 118 | ["a", "30009:alice:honor"], | 116 | ["a", "30009:alice:honor"], |
| @@ -121,3 +119,7 @@ Honorable Bob The Brave: | |||
| 121 | // other fields... | 119 | // other fields... |
| 122 | } | 120 | } |
| 123 | ``` | 121 | ``` |
| 122 | |||
| 123 | ### Deprecated Profile Badges event | ||
| 124 | |||
| 125 | 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 | |||
| 205 | | `10005` | Public chats list | [51](51.md) | | 205 | | `10005` | Public chats list | [51](51.md) | |
| 206 | | `10006` | Blocked relays list | [51](51.md) | | 206 | | `10006` | Blocked relays list | [51](51.md) | |
| 207 | | `10007` | Search relays list | [51](51.md) | | 207 | | `10007` | Search relays list | [51](51.md) | |
| 208 | | `10008` | Profile Badges | [51](51.md), [58](58.md) | | ||
| 208 | | `10009` | User groups | [51](51.md), [29](29.md) | | 209 | | `10009` | User groups | [51](51.md), [29](29.md) | |
| 209 | | `10011` | External Identities | [39](39.md) | | 210 | | `10011` | External Identities | [39](39.md) | |
| 210 | | `10012` | Favorite relays list | [51](51.md) | | 211 | | `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 | |||
| 244 | | `30005` | Video sets | [51](51.md) | | 245 | | `30005` | Video sets | [51](51.md) | |
| 245 | | `30006` | Picture sets | [51](51.md) | | 246 | | `30006` | Picture sets | [51](51.md) | |
| 246 | | `30007` | Kind mute sets | [51](51.md) | | 247 | | `30007` | Kind mute sets | [51](51.md) | |
| 247 | | `30008` | Profile Badges | [58](58.md) | | 248 | | `30008` | Badge sets | [51](51.md), [58](58.md) | |
| 248 | | `30009` | Badge Definition | [58](58.md) | | 249 | | `30009` | Badge Definition | [58](58.md) | |
| 249 | | `30015` | Interest sets | [51](51.md) | | 250 | | `30015` | Interest sets | [51](51.md) | |
| 250 | | `30017` | Create or update a stall | [15](15.md) | | 251 | | `30017` | Create or update a stall | [15](15.md) | |