30817:nostr-thread-rendering

Nostr Thread Rendering (skill)

A skill for sensibly rendering threads for any type of original post. Fully backward-compatible and forward-compatible. No breaking changes, no blind responses to users of outdated clients. See and interact with all of the responses, everywhere. Use when building or fixing threads, comments, compose, nesting, filters, or parent blurbs.

Silberengel

published
2026-10-03

Threads

A thread is one root of any kind plus responses that point at that root or at a descendant already in the thread.

Term Meaning
OP An original post of any kind with no thread tags.
Reply Kind 1 with NIP-10 thread tags. Only valid onto a kind 1 parent.
Response Any event that references something higher in the thread (1111, replies, 1244, quotes, highlights, …).

Publish

Parent Default text response Also offer a reply (kind 1)?
Kind 1 reply Kind 1 (another reply) --
Kind 1 original Kind 1111 Yes
Any other kind Kind 1111 No

Tag shapes

NIP-22 uppercase (E / A / P) uses the same field order as lowercase (e / a / p). Replies use the NIP-10 e row, not NIP-01.

Tag When Fields
e / E NIP-01 and NIP-22 id, relay (optional), author pubkey (optional)
e Reply (NIP-10) id, relay, marker (root | reply), author pubkey
p / P Mentions / NIP-22 authors pubkey, relay (optional)
a / A Addressable (30000–39999) kind:pubkey:d-tag, relay (optional)
a / A Replaceable (0, 3, 10000–19999) kind:pubkey: (keep the trailing colon), relay (optional)

Hex ids and pubkeys are 32-byte lowercase.

Kind 1111 (NIP-22 comment = a response, not a reply)

Role Pointer Kind (required) Author if tagging a Nostr event
Root A / E / I K P
Parent a / e / i k p

Omit P / p on I/i-only scopes (URL, hashtag, geohash, podcast, …).

Target Root Parent
Regular event E e (same id if top-level)
Addressable / replaceable A only (no required root E) a and e (this version's id)
NIP-73 scope I Top-level: i = I. Nested: keep I; parent is e on the 1111

Nested 1111 responses copy the uppercase root; lowercase tags point at the parent response (e, k = that event's kind).

Kind 1 replies (NIP-10)

Responding to e tags
The kind 1 OP One e with marker root
A nested reply root, then marker reply (the parent reply)

Copy the parent's p tags and add the author of the parent.

Prefer marked e tags. Still render deprecated positional threads (first e = root, last = parent).

Display

Surface What
Main thread rows Replies and kind 1111 responses, on every OP kind
On those rows (not extra rows) Zap counts (BTC and/or XMR), reactions as badges or counts, boost badges, highlights
Below the fold / subsection Other responses: kind 1244, kind 1 quotes, bookmarks, … Unknown kind → generic card

Nest on the parent: NIP-22 lowercase e / a / i; for replies, the NIP-10 reply marker when both root and reply exist. If lowercase parent tags are present, ignore uppercase E / A / I as the parent. Missing parent → still show the row at top-level.

Fetch without restricting kinds: e E a A q, plus I/i for NIP-73 scopes.

Comments / responses filter: kind 1111 comments and legacy kind 1 replies.

I / i value Card
http(s) URL OpenGraph, or a fallback card
Geohash, hashtag, podcast, … An appropriate non-OG card

Discussion

Connect a key to comment.