Appearance
Kind 30009: Badge Definition
Overview
Badge Definition events (kind 30009) are used to create and define badges in the Nostr ecosystem. These events establish what a badge looks like, what it means, and who issued it. Badge definitions are created by badge issuers and can be awarded to users through Badge Award events (kind 8).
Specification
| Property | Value |
|---|---|
| Kind Number | 30009 |
| Event Range | Parameterized Replaceable |
| Defined in | NIP-58 |
Content Format
The content field contains a description of the badge, explaining its purpose, how it's earned, or what it represents.
Schema
json
"content": "This badge is awarded to community members who demonstrate extraordinary courage and selflessness in supporting the Nostr ecosystem."Tags
| Tag Name | Description | Format | Required |
|---|---|---|---|
d | Badge identifier | ["d", "<badge-id>"] | Yes |
name | Short badge name | ["name", "<name>"] | Yes |
description | Brief badge description | ["description", "<description>"] | No |
image | Badge image URL | ["image", "<url>"] | Yes |
thumb | Thumbnail image URL | ["thumb", "<url>"] | No |
Client Behavior
Clients should:
- Parse Badge Definition events to display badges in user profiles
- Use the
imagetag to show the badge graphic - Use the
thumbtag for smaller thumbnail versions when appropriate - Display the badge name and description when users interact with the badge
- Allow badge issuers to update their badge definitions (as these are parameterized replaceable events)
- Enable badge explorers or galleries that show available badges
Relay Behavior
Relays should:
- Handle kind 30009 events as parameterized replaceable events with the
dtag as discriminator - Index these events to allow efficient retrieval by
pubkeyanddtag value - Return these events when queried for a specific author and badge identifier
Use Cases
- Defining community achievement badges
- Creating certification or credential badges
- Establishing membership or affiliation badges
- Designing special event participation badges
- Setting up verification or trust badges
Example
json
{
"id": "c2d96e06f189309aed10f27168f059941ffa27d8bf569c9b32c8505f5ebf9f65",
"pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
"created_at": 1679589657,
"kind": 30009,
"tags": [
["d", "bravery"],
["name", "Badge of Bravery"],
["description", "Awarded for exceptional courage in the Nostr community"],
["image", "https://example.com/badges/bravery.png"],
["thumb", "https://example.com/badges/bravery_thumb.png"]
],
"content": "This badge recognizes individuals who have shown extraordinary courage in supporting and defending the Nostr protocol and its values of freedom and decentralization.",
"sig": "6e8f573e83e0c1f3a030f95f89a47e6c641f24f40b1189e1f6de2e49cf3cf230c9a4d304104ca1ef57a3d232bf357fba3e5aef2a537ae615c6c2e30c523a7ab2"
}Badge System Architecture
The Nostr badge system consists of three key components:
- Badge Definition (kind 30009) - Created by badge issuers, defines what a badge looks like and means
- Badge Award (kind 8) - Created by badge issuers, grants a specific badge to a user
- Profile Badges (kind 30008) - Created by badge recipients, displays chosen badges on their profile
The workflow is:
- Badge issuer creates a Badge Definition with a unique identifier
- Badge issuer awards this badge to users via Badge Award events
- Users can display badges they've received in their profiles
Badge References
Badges are referenced in other events using the a tag with the format:
["a", "30009:<pubkey>:<identifier>"]Where:
30009is the kind number<pubkey>is the badge issuer's public key<identifier>is the badge identifier from thedtag
References
Related Kinds
- Kind 8: Badge Award - Awards badges to users
- Kind 30008: Profile Badges - Displays badges on user profiles
Notes
- Badge images should be hosted on reliable servers to ensure long-term availability
- Badge issuers can update their badge definitions (e.g., to fix broken image links)
- The badge identifier in the
dtag should be consistent and unique for that issuer - Clients may implement caching mechanisms for badge images to improve performance
- Badge definitions are public and can be discovered by anyone, which enables badge explorers