Appearance
Tag: t
Overview
The t
tag is used for hashtags in Nostr, allowing content to be categorized, searched, and filtered. It's a fundamental tag for content organization across the entire Nostr ecosystem and is widely used in many different event kinds.
Specification
Property | Value |
---|---|
Tag Name | t |
Defined in | NIP-24 |
Required for | Optional for most event kinds, recommended for content organization |
Format
["t", "<hashtag>"]
Usage Description
The t
tag contains a single value parameter: a hashtag string that categorizes the event. According to NIP-24, the value MUST be a lowercase string. This convention ensures consistent searching and filtering of hashtags across clients.
Hashtags can be used for many purposes:
- Topic categorization (e.g.,
["t", "nostr"]
,["t", "bitcoin"]
) - Event types (e.g.,
["t", "announcement"]
,["t", "question"]
) - Content classification (e.g.,
["t", "movie"]
,["t", "music"]
) - Geographic locations (e.g.,
["t", "london"]
,["t", "newyork"]
) - Events and conferences (e.g.,
["t", "bitcoinconf2023"]
) - Memes and trends (e.g.,
["t", "wojak"]
)
Multiple hashtags can be added by using multiple t
tags, not by putting multiple values in a single tag.
Examples
Basic Text Note with Hashtags
json
{
"kind": 1,
"content": "Just learned about NIP-24 and how to properly use hashtags in Nostr!",
"tags": [
["t", "nostr"],
["t", "nip24"],
["t", "learning"]
]
}
Calendar Event with Category Hashtags
json
{
"kind": 31922,
"content": "Annual Bitcoin conference with workshops and networking",
"tags": [
["d", "5371fe41-2964-4f3e-b203-e56009f54729"],
["title", "Bitcoin Conference 2023"],
["start", "2023-10-20"],
["end", "2023-10-22"],
["t", "bitcoin"],
["t", "conference"],
["t", "blockchain"]
]
}
Repository with Topic Tags
json
{
"kind": 30617,
"content": "",
"tags": [
["d", "nostr-client"],
["name", "Awesome Nostr Client"],
["description", "A lightweight Nostr client built with React"],
["clone", "https://github.com/user/awesome-nostr-client.git"],
["t", "nostr"],
["t", "client"],
["t", "react"],
["t", "opensource"]
]
}
Client Behavior
Clients should:
- Ensure hashtags are displayed prominently and are clickable/tappable
- When a user clicks/taps on a hashtag, show other events with the same hashtag
- Provide a way for users to easily add hashtags to their content
- Support searching for events by hashtag
- Convert uppercase hashtags to lowercase before storing/transmitting
- Consider displaying trending or popular hashtags
- Allow users to follow specific hashtags
- Support muting specific hashtags (via kind:10000 events)
Relay Behavior
Relays should:
- Index events by hashtag to support efficient searching and filtering
- Support queries that filter by hashtag, allowing efficient discovery of content
- Respect case-insensitivity in hashtag searches (though tags themselves should be lowercase)
References
- NIP-24: Extra metadata fields and tags
- NIP-34: Git stuff (uses
t
for repository categories) - NIP-35: Torrents (uses
t
for torrent categories) - NIP-10: Text Notes and Threads (standard format for text notes which commonly use hashtags)
Related Tags
- d - Often used together with
t
in replaceable and parameterized replaceable events - g - Geographic location, which can complement topic hashtags for location-based events
Notes
While NIP-24 stipulates that hashtag values MUST be lowercase, not all clients enforce this. For maximum compatibility, always use lowercase hashtags in your applications.
Some clients extract hashtags from the
content
field (words prefixed with#
) and automatically add them ast
tags to the event. However, this behavior is not standardized and should not be relied upon.For multi-word hashtags, common conventions include:
- Using CamelCase:
["t", "bitcoinConference"]
- Using hyphens:
["t", "bitcoin-conference"]
- No separators:
["t", "bitcoinconference"]
The community has not standardized on a single approach, but all client implementations should handle these formats.
- Using CamelCase: