{"id":"8ce3ff65db3ec2909978ce45b1e5da1a138dfb0502a1dca7bdae4bfcf25e2239","pubkey":"2b39b4ffe62933df970e19366c22c1e092f953f83fcfed754e0f04d5a3b459f9","created_at":1781353189,"kind":30817,"tags":[["d","nip-58"],["title","NIP-58: Badges"],["summary","Badges: the definition an issuer publishes, the award it grants to a key, and the list a user chooses to show on their profile."],["s","draft"],["t","nostr"],["t","nip"],["k","8","Badge Award"],["k","10008","Profile Badges"],["k","30008","Badge sets"],["k","30009","Badge Definition"],["alt","A specification: NIP-58: Badges"],["client","openspecs-import"],["published_at","1677114715"],["proxy","https://github.com/nostr-protocol/nips/blob/656cecc7c0a815b6a2b218d3b5d6f078b3f4dbab/58.md","web"],["x","7260c83afdfa3898d635e39cfc2fc9919d3d5eca128c284eb7b3156eacd7bf32"]],"content":"NIP-58\n======\n\nBadges\n------\n\n`draft` `optional`\n\nFour special events are used to define, award, display and categorize badges in\nuser profiles:\n\n1. 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.\n\n2. 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.\n\n3. A \"Profile Badges\" event is defined as a _replaceable event_ with kind `10008` as a [NIP-51](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts956nzk0x2rf) standard list.\nProfile 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.\n\n4. A \"Badge Set\" event is defined as an _addressable event_ with kind `30008` as a [NIP-51](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts956nzk0x2rf) set.\nBadge 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.\n\n### Badge Definition event\n\nThe following tags MUST be present:\n\n- `d` tag with the unique name of the badge.\n\nThe following tags MAY be present:\n\n- A `name` tag with a short name for the badge.\n- `image` tag whose value is the URL of a high-resolution image representing the badge. The second value optionally specifies the dimensions of the image as  `width`x`height` in pixels. Badge recommended dimensions is 1024x1024 pixels.\n- A `description` tag whose value MAY contain a textual representation of the\nimage, the meaning behind the badge, or the reason of its issuance.\n- One or more `thumb` tags whose first value is an URL pointing to a thumbnail version of the image referenced in the `image` tag. The second value optionally specifies the dimensions of the thumbnail as `width`x`height` in pixels.\n\n### Badge Award event\n\nThe following tags MUST be present:\n\n- An `a` tag referencing a kind `30009` Badge Definition event.\n- One or more `p` tags referencing each pubkey awarded.\n\n### Profile Badges Event\n\nThe number of badges a pubkey can be awarded is unbounded. The Profile Badge\nevent allows individual users to accept or reject awarded badges, as well\nas choose the display order of badges on their profiles.\n\nThe following tags MAY be present:\n\n- 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\nignore `a` without corresponding `e` tag and viceversa. Badge Awards referenced\nby the `e` tags should contain the same `a` tag.\n\n### Motivation\n\nUsers MAY be awarded badges (but not limited to) in recognition, in gratitude, for participation, or in appreciation of a certain goal, task or cause.\n\nUsers MAY choose to decorate their profiles with badges for fame, notoriety, recognition, support, etc., from badge issuers they deem reputable.\n\n### Recommendations\n\nClients MAY whitelist badge issuers (pubkeys) for the purpose of ensuring they retain a valuable/special factor for their users.\n\nBadge image recommended aspect ratio is 1:1 with a high-res size of 1024x1024 pixels.\n\nBadge thumbnail image recommended dimensions are: 512x512 (xl), 256x256 (l), 64x64 (m), 32x32 (s) and 16x16 (xs).\n\nClients MAY choose to render less badges than those specified by users in the Profile Badges event or replace the badge image and thumbnails with ones that fits the theme of the client.\n\nClients SHOULD attempt to render the most appropriate badge thumbnail according to the number of badges chosen by the user and space available. Clients SHOULD attempt render the high-res version on user action (click, tap, hover).\n\n### Example of a Badge Definition event\n\n```yaml\n{\n  \"pubkey\": \"alice\",\n  \"kind\": 30009,\n  \"tags\": [\n    [\"d\", \"bravery\"],\n    [\"name\", \"Medal of Bravery\"],\n    [\"description\", \"Awarded to users demonstrating bravery\"],\n    [\"image\", \"https://nostr.academy/awards/bravery.png\", \"1024x1024\"],\n    [\"thumb\", \"https://nostr.academy/awards/bravery_256x256.png\", \"256x256\"]\n  ],\n  // other fields...\n}\n```\n\n### Example of Badge Award event\n\n```yaml\n{\n  \"id\": \"<badge award event id>\",\n  \"kind\": 8,\n  \"pubkey\": \"alice\",\n  \"tags\": [\n    [\"a\", \"30009:alice:bravery\"],\n    [\"p\", \"bob\", \"wss://relay\"],\n    [\"p\", \"charlie\", \"wss://relay\"]\n  ],\n  // other fields...\n}\n```\n\n### Example of a Profile Badges event\n\nHonorable Bob The Brave:\n```yaml\n{\n  \"kind\": 10008,\n  \"pubkey\": \"bob\",\n  \"tags\": [\n    [\"a\", \"30009:alice:bravery\"],\n    [\"e\", \"<bravery badge award event id>\", \"wss://nostr.academy\"],\n    [\"a\", \"30009:alice:honor\"],\n    [\"e\", \"<honor badge award event id>\", \"wss://nostr.academy\"]\n  ],\n  // other fields...\n}\n```\n\n### Deprecated Profile Badges event\n\nAn 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.\n","sig":"ed6459efdd0ac72780e4076f4594405e97737b8561dc6beb193aec6a259d04a0d3f3b568a7e791dfb983ee0b2dac123a672ef13df4277242610e07ba69711206"}