diff options
| author | Francisco Calderón <fjcalderon@gmail.com> | 2024-11-04 15:39:21 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-04 15:39:21 -0300 |
| commit | 03f3bc39678262ecbd5d870c9da44723023557ff (patch) | |
| tree | e75ecf32d3bc906a8b26314488a1ae90996169c1 /58.md | |
| parent | f72a2f69ed93cf442e83bf9e7e16f6c06da40384 (diff) | |
| parent | 6bcd89c097e97e65dbc95e7c6b7b8348e8dd6b5c (diff) | |
Merge branch 'master' into p2p-nip
Diffstat (limited to '58.md')
| -rw-r--r-- | 58.md | 17 |
1 files changed, 8 insertions, 9 deletions
| @@ -9,12 +9,11 @@ Badges | |||
| 9 | Three special events are used to define, award and display badges in | 9 | Three special events are used to define, award and display badges in |
| 10 | user profiles: | 10 | user profiles: |
| 11 | 11 | ||
| 12 | 1. A "Badge Definition" event is defined as a parameterized replaceable 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-transferrable. | 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-transferrable. |
| 15 | 15 | ||
| 16 | 3. A "Profile Badges" event is defined as a parameterized replaceable event | 16 | 3. A "Profile Badges" event is defined as an _addressable event_ with kind `30008` with a `d` tag with the value `profile_badges`. |
| 17 | with kind `30008` with a `d` tag with the value `profile_badges`. | ||
| 18 | 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. |
| 19 | 18 | ||
| 20 | ### Badge Definition event | 19 | ### Badge Definition event |
| @@ -74,7 +73,7 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according | |||
| 74 | 73 | ||
| 75 | ### Example of a Badge Definition event | 74 | ### Example of a Badge Definition event |
| 76 | 75 | ||
| 77 | ```json | 76 | ```jsonc |
| 78 | { | 77 | { |
| 79 | "pubkey": "alice", | 78 | "pubkey": "alice", |
| 80 | "kind": 30009, | 79 | "kind": 30009, |
| @@ -85,13 +84,13 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according | |||
| 85 | ["image", "https://nostr.academy/awards/bravery.png", "1024x1024"], | 84 | ["image", "https://nostr.academy/awards/bravery.png", "1024x1024"], |
| 86 | ["thumb", "https://nostr.academy/awards/bravery_256x256.png", "256x256"] | 85 | ["thumb", "https://nostr.academy/awards/bravery_256x256.png", "256x256"] |
| 87 | ], | 86 | ], |
| 88 | ... | 87 | // other fields... |
| 89 | } | 88 | } |
| 90 | ``` | 89 | ``` |
| 91 | 90 | ||
| 92 | ### Example of Badge Award event | 91 | ### Example of Badge Award event |
| 93 | 92 | ||
| 94 | ```json | 93 | ```jsonc |
| 95 | { | 94 | { |
| 96 | "id": "<badge award event id>", | 95 | "id": "<badge award event id>", |
| 97 | "kind": 8, | 96 | "kind": 8, |
| @@ -101,14 +100,14 @@ Clients SHOULD attempt to render the most appropriate badge thumbnail according | |||
| 101 | ["p", "bob", "wss://relay"], | 100 | ["p", "bob", "wss://relay"], |
| 102 | ["p", "charlie", "wss://relay"] | 101 | ["p", "charlie", "wss://relay"] |
| 103 | ], | 102 | ], |
| 104 | ... | 103 | // other fields... |
| 105 | } | 104 | } |
| 106 | ``` | 105 | ``` |
| 107 | 106 | ||
| 108 | ### Example of a Profile Badges event | 107 | ### Example of a Profile Badges event |
| 109 | 108 | ||
| 110 | Honorable Bob The Brave: | 109 | Honorable Bob The Brave: |
| 111 | ```json | 110 | ```jsonc |
| 112 | { | 111 | { |
| 113 | "kind": 30008, | 112 | "kind": 30008, |
| 114 | "pubkey": "bob", | 113 | "pubkey": "bob", |
| @@ -119,6 +118,6 @@ Honorable Bob The Brave: | |||
| 119 | ["a", "30009:alice:honor"], | 118 | ["a", "30009:alice:honor"], |
| 120 | ["e", "<honor badge award event id>", "wss://nostr.academy"] | 119 | ["e", "<honor badge award event id>", "wss://nostr.academy"] |
| 121 | ], | 120 | ], |
| 122 | ... | 121 | // other fields... |
| 123 | } | 122 | } |
| 124 | ``` | 123 | ``` |