Appearance
Tag: q
Overview
The q tag is used in quote reposts to reference the original event being quoted. It ensures quote reposts are not pulled and included as replies in threads, and it allows for easy retrieval and counting of quotes for a post.
Specification
Property | Value |
---|---|
Tag Name | q |
Defined in | NIP-18 |
Required for | Quote reposts (kind 1 events that quote another event) |
Format
["q", "<event-id>", "<relay-url>", "<pubkey>"]
Usage Description
The q
tag follows similar conventions as the NIP-10 e
tags, with the exception of the mark
argument. The format includes:
- First parameter: The event ID (hex) of the event being quoted
- Second parameter: The URL of a relay where the quoted event can be found
- Third parameter: The public key (hex) of the author of the quoted event
Quote reposts MUST include the NIP-21 nevent
, note
, or naddr
of the event in the content.
Examples
Basic Example
json
["q", "31d7c2875b5fc8a92b0c5029b9ae40910012b6a3f192b1244ed8cf2a8cd3acd1", "wss://relay.example.com"]
Extended Example with Author Pubkey
json
["q", "31d7c2875b5fc8a92b0c5029b9ae40910012b6a3f192b1244ed8cf2a8cd3acd1", "wss://relay.example.com", "32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"]
Client Behavior
Clients should:
- Distinguish between quote reposts and regular replies by checking for the presence of a
q
tag rather than ane
tag. - Not include quoted posts in thread replies (unlike events with
e
tags). - Use the
q
tag to retrieve and display the quoted event. - Display quote reposts in a way that makes it clear they are quotes, not replies.
- Count and display quote reposts separately from regular reposts and replies.
Relay Behavior
Relays should not have any specialized behavior for the q
tag. They should treat events with q
tags like any other events.
References
Related Tags
Notes
The q
tag was specifically designed to differentiate quote reposts from regular replies, allowing for cleaner threading and more accurate metrics on engagement with posts.