Skip to content

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

PropertyValue
Tag Nameq
Defined inNIP-18
Required forQuote 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:

  1. First parameter: The event ID (hex) of the event being quoted
  2. Second parameter: The URL of a relay where the quoted event can be found
  3. 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:

  1. Distinguish between quote reposts and regular replies by checking for the presence of a q tag rather than an e tag.
  2. Not include quoted posts in thread replies (unlike events with e tags).
  3. Use the q tag to retrieve and display the quoted event.
  4. Display quote reposts in a way that makes it clear they are quotes, not replies.
  5. 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

  • e tag: Used for regular replies and thread replies
  • p tag: Used for mentioning users and in reposts

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.