Wikifreedia
All versions

Nostr is an open protocol for signed, relay-distributed events. Like Markdown, it has no single authority — most implementations converge on the same kind numbers for the same content types, but differ in which tags they support, which conventions they follow, and how they combine kinds into larger systems. This document describes our flavour: the event kinds, tags, and conventions used across these specs, with references to where each is defined in detail.

The Event

Every object on Nostr is an event — a signed JSON structure with the following fields:

{
  "id":         "<32-byte lowercase hex sha256 of the serialized event>",
  "pubkey":     "<32-byte lowercase hex public key of the author>",
  "created_at": "<unix timestamp in seconds>",
  "kind":       "<integer 0–65535>",
  "tags":       [["<tag-name>", "<value>", "..."], "..."],
  "content":    "<arbitrary string>",
  "sig":        "<64-byte lowercase hex Schnorr signature over id>"
}

Keys and signatures use Schnorr signatures over secp256k1. The id is the SHA-256 of the UTF-8 JSON serialization of [0, pubkey, created_at, kind, tags, content] with no extra whitespace.

Kinds

The kind integer tells clients and relays how to interpret an event. Ranges carry structural meaning:

Range Behaviour
0, 3, 10000–19999 Replaceable — only the latest event per pubkey + kind is kept.
1–9999 (excl. 0, 3) Regular — all events stored.
20000–29999 Ephemeral — not expected to be stored.
30000–39999 Addressable — only the latest per pubkey + kind + d is kept.

When two replaceable or addressable events share the same timestamp, the one with the lexically lower id wins.

Kind Reference

A selection of event kinds defined across these specs:

Kind Name Spec
0 User Metadata Profile
9 Chat Message Community
11 Forum Post Community
1069 Form Response Form
1111 Comment Comment
1983 Status Status
7 Reaction Reaction
1985 Label Label
10222 Community Community
30000 Profile List / Follow Set Profile List
30101 Docs Index Docs
30168 Form Template Form
30315 Project Project
30316 Milestone Milestone
30818 Wiki Article Wiki
37060 Task Task

Tags

Tags are arrays of strings attached to an event. The first element is the tag name; the second is the primary value. Single-letter tag names (az, AZ) are indexed by relays, enabling filter queries like {"#e": ["<event-id>"]}. Multi-word tag names are not relay-indexed.

The four universal single-letter tags used across all kinds:

Tag Format Use
e ["e", "<event-id>", "<relay-url?>", "<pubkey?>"] Reference to a regular event
p ["p", "<pubkey>", "<relay-url?>"] Reference to a user
a ["a", "<kind>:<pubkey>:<d>", "<relay-url?>"] Reference to an addressable event
d ["d", "<slug>"] Unique identifier for addressable events

Tag Reference

A selection of tags defined across these specs:

Tag Values Use Spec
a kind:pubkey:d Target or reference any addressable event Protocol
d slug Unique id for addressable events Protocol
e event-id Reference a regular event Protocol
p pubkey, role Reference a person Protocol
h community-pubkey Target a community Community
k kind number Allowed event kind in a section Community
r relay-url Relay reference Community
t string Category / hashtag Task, Project
title string Display title Task, Wiki, Project
due unix timestamp Deadline Task, Project, Milestone
status string Status value Status
content section name Content section in a community Community
field id, type, label, … Form field definition Form
response field-id, value Form field response Form
l / L value, namespace Label / label namespace Label
repository kind:pubkey:d Git repository reference Project
application kind:pubkey:d App reference Project
milestone kind:pubkey:d Milestone reference (via a tag) Project

Other authors

No one else has published this topic yet.