Skip to content

Tag: e

Overview

The "e" tag is used to refer to another event in the Nostr protocol. It allows events to reference other events, enabling threaded conversations, replies, reactions, and other interactions between events.

Specification

PropertyValue
Tag Namee
Defined inNIP-01
Required forGeneral use across event kinds

Format

["e", "<32-bytes lowercase hex of the id of another event>", "<recommended relay URL, optional>", "<32-bytes lowercase hex of the author's pubkey, optional>"]

Usage Description

The "e" tag is used to reference another event by its event ID. The tag can include optional additional information:

  1. The event ID (required) - a 32-byte hex string representing the referenced event
  2. A recommended relay URL (optional) - where the referenced event might be found
  3. The pubkey of the event author (optional) - a 32-byte hex string

As a convention, all single-letter key tags (including "e") are expected to be indexed by relays, enabling queries and subscriptions that filter for events referencing specific event IDs.

Examples

Basic Example

json
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"]

Extended Example with Relay URL

json
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"]

Extended Example with Relay URL and Author's Pubkey

json
["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"]

Client Behavior

Clients should:

  1. Interpret "e" tags as references to other events
  2. When displaying events with "e" tags, potentially show them as replies or references to the original events
  3. Use the included relay URL (if present) as a hint for where to fetch the referenced event if it's not already available
  4. Consider the optional author pubkey as additional metadata about the referenced event

Relay Behavior

Relays should:

  1. Index events by the first value in their "e" tags
  2. Support filtering queries based on "e" tags using the #e filter parameter in subscription requests
  3. For a filter like {"#e": ["5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"]}, return all events that reference the specified event ID

References

Notes

The "e" tag is one of the three standard tags defined in NIP-01, alongside the "p" and "a" tags. These three tags form the foundation of referencing in the Nostr protocol, enabling a web of connections between events and users.