Appearance
Nostr Tags
Tags are key components of Nostr events that provide additional context, metadata, and relationships between events. They are especially important for the discoverability and interconnectedness of the Nostr protocol.
Available Tag Definitions
The following tags have detailed definitions in this documentation:
Tag Name | Description | Defined in |
---|---|---|
a | References an addressable or replaceable event | NIP-01 |
d | Provides a unique identifier for addressable events | NIP-01 |
e | References another event | NIP-01 |
g | Provides geographic location using a geohash | NIP-52 |
h | Identifies a group in the relay-based groups system | NIP-29 |
i | References external identities and content identifiers | NIP-39, NIP-35, NIP-73 |
p | References a user's public key | NIP-01 |
q | References an event in a quote repost | NIP-18 |
r | References a URL or relay address | NIP-24, NIP-65 |
t | Hashtags for content categorization | NIP-24 |
- | Indicates a "protected" event that can only be published by its author | NIP-70 |
client | Identifies the client application that published an event | NIP-89 |
emoji | Defines a custom emoji for use in event content | NIP-30 |
proxy | Links events to their original source from other protocols | NIP-48 |
zap | Specifies recipients for Lightning Network payments (zaps) on events | NIP-57 |
Tag Format
In Nostr events, tags are represented as arrays of strings within the tags
array of an event. The first element of a tag array is always the tag name, followed by one or more values.
Example:
json
{
"kinds": 1,
"tags": [
["client", "MyNostrClient"],
["d", "article-identifier"],
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "", "reply"],
["p", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"],
["a", "30023:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:abcd"]
],
// other fields...
}
Tag Categories
Tags in Nostr can serve several purposes:
- Referencing other events (e.g.,
e
tag for event references) - Referencing users (e.g.,
p
tag for pubkey references) - Referencing addressable content (e.g.,
a
tag for replaceable or addressable events) - Identifying content (e.g.,
d
tag for uniquely identifying addressable events) - Providing metadata (e.g.,
client
tag for identifying the publishing application) - Defining relationships (e.g.,
d
tag for replaceable events) - Structuring content (e.g.,
subject
tag for setting a title) - Group membership (e.g.,
h
tag for associating events with a specific group)
Contributing
To add a new tag definition to this documentation, use the following command:
bash
deno task generate_tag <tag_name> <nip_number>