Skip to content

Tag: alt

Overview

The alt tag provides a short human-readable plaintext summary for custom event kinds that aren't meant to be read as text. This allows social clients that primarily display kind:1 notes to show meaningful context when encountering unknown event kinds.

Specification

PropertyValue
Tag Namealt
Defined inNIP-31
Required forCustom event kinds that are part of custom protocols

Format

["alt", "<human-readable summary>"]

Usage Description

When creating a new custom event kind that is part of a custom protocol and isn't meant to be read as text (like kind:1), clients should use an alt tag to write a short human-readable plaintext summary of what that event is about.

The content of the alt tag should provide enough context for a user that doesn't know anything about this event kind to understand what it is.

Examples

Basic Example

json
["alt", "User updated their profile picture"]

Custom Protocol Example

json
["alt", "Chess game move: Knight to E4"]

Marketplace Event Example

json
["alt", "Listed item for sale: Vintage guitar"]

Client Behavior

Social clients that are used to displaying only kind:1 notes should:

  1. Display the content of the alt tag when encountering unknown event kinds.
  2. Use this fallback text to provide context to users who reference these events in their notes.
  3. Consider supporting NIP-89 to make interacting with custom event kinds more functional.

Clients that only know kind:1 are not expected to ask relays for events of different kinds, but when these events are referenced, the alt tag ensures the reference makes sense.

Relay Behavior

Relays should treat the alt tag like any other tag and include it when serving events that contain it. No special handling is required from the relay perspective.

References

  • No directly related tags, but the alt tag complements any custom event kind implementation.

Notes

  • The alt tag is particularly important for maintaining user experience when custom protocols introduce new event kinds.
  • Without proper context from the alt tag, references to custom events in kind:1 notes could appear nonsensical to users.
  • This tag serves as a bridge between custom protocols and general-purpose social clients.