upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/58.md
diff options
context:
space:
mode:
authorFrancisco Calderón <fjcalderon@gmail.com>2024-11-04 15:39:21 -0300
committerGitHub <noreply@github.com>2024-11-04 15:39:21 -0300
commit03f3bc39678262ecbd5d870c9da44723023557ff (patch)
treee75ecf32d3bc906a8b26314488a1ae90996169c1 /58.md
parentf72a2f69ed93cf442e83bf9e7e16f6c06da40384 (diff)
parent6bcd89c097e97e65dbc95e7c6b7b8348e8dd6b5c (diff)
Merge branch 'master' into p2p-nip
Diffstat (limited to '58.md')
-rw-r--r--58.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/58.md b/58.md
index 4a9ed4c..23921bd 100644
--- a/58.md
+++ b/58.md
@@ -9,12 +9,11 @@ Badges
9Three special events are used to define, award and display badges in 9Three special events are used to define, award and display badges in
10user profiles: 10user profiles:
11 11
121. 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. 121. 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
142. 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. 142. 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
163. A "Profile Badges" event is defined as a parameterized replaceable event 163. A "Profile Badges" event is defined as an _addressable event_ with kind `30008` with a `d` tag with the value `profile_badges`.
17with kind `30008` with a `d` tag with the value `profile_badges`.
18Profile 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. 17Profile 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
110Honorable Bob The Brave: 109Honorable 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```