diff options
Diffstat (limited to '58.md')
| -rw-r--r-- | 58.md | 20 |
1 files changed, 11 insertions, 9 deletions
| @@ -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. | ||