Nostr Protocol Manual — Page Authoring Guide
You are authoring ONE chapter of a static site: a complete dictionary of Nostr NIPs styled
as an early-2000s printed game manual. Follow this guide exactly. The finished exemplar is
site/ — read it first and match it precisely (structure, classes, tone).
Hard rules
- The character
·(middle dot) is BANNED. Use-instead. Check your output. - Filenames are lowercase:
site/(e.g.nips/ <num-lowercase>.html 5a.html,a0.html,f4.html). - Cross-links to other NIPs are relative:
<a href="19.html">NIP-19</. Link every NIP mention.a> - Full coverage: EVERY normative rule, kind, tag, field, message type, and error code in the source markdown must appear on the page, restated. Never drop a table row or a defined kind. Restate in your own STE prose; do not paste raw markdown.
- No new CSS files and no
<style>blocks except tiny page-specific SVG tweaks if truly needed. Use only../classes. No JavaScript.assets/ manual.css - Escape
<and>as<>inside code blocks.
Writing style: Simplified Technical English (STE)
- Short sentences: at most ~20 words. One idea per sentence.
- Active voice, present tense. "The relay stores the event." Not "the event will be stored".
- Imperative mood for procedures: "Serialize the event. Hash it with sha256."
- One term per concept, always the same term: event, relay, client, publish, subscribe, sign, kind, tag, filter. Never vary for elegance.
- Define each term at first use. No idioms, no filler, no marketing language.
- The playful 2000s-manual flavor lives ONLY in callout labels, figure captions, and the cartridge/credits framing — never in the technical prose itself.
Page anatomy (in order)
Copy the skeleton from 01.html:
<head>: titleNIP-XX - <Title> — Nostr Instruction Manual, meta description, the 7 font<link rel="preload">lines (copy verbatim from 01.html), favicon link (../), stylesheetassets/ favicon.svg ../. Beforeassets/ manual.css </:body> <script src="../(the one allowed script — it registers WebMCP tools for browser agents; page content itself stays JS-free). After creating or editing a page, runassets/ webmcp.js" defer></ script> python3 tools/to refresh the agent-facing index.build_nip_index.py - The hidden
<svg><defs>block with thearr/arrbarrow markers (copy verbatim from 01.html). .pagewrapper with two.staplespans..bandheader: logo links to../;index.html .booklet-note=Chapter XX - <short category>(pick a 1-3 word category: Core, Social, Payments, Encryption, Relay Ops, Media, Commerce, ...)..tabsnav: Contents, Overview, Spec, Examples, History (anchor links)..chapterheader:.nipnowithdata-n="XX"(uppercase), kickerNostr Implementation Possibility - Hex № XX,<h1>title, one-sentence.sub.- Deprecated NIP: add
<div class="stamp">Deprecated</insidediv> .chapter. - Merged NIP: add
<div class="stamp merged">Merged</.div>
- Deprecated NIP: add
<main class="spread">grid (a real<main>element, closed with</after themain> </):aside> .maincontent div +<aside>with the.cartridgespec card. Card headings inside.cartridgeand.creditsare<h3 class="cardhead">— never<h5>.- Numbered sections as
<h2 class="bar"><span class="num">N</:span> Title</ h2> - 1 Overview — what problem this NIP solves, for whom, in plain STE. 2-4 paragraphs.
- 2..n Spec sections — the full specification: event formats in
.crtterminals, field/tag/kind reference intable.ref, flows as diagrams. Structure follows the source NIP's own structure. - Worked Example(s) — at least one realistic end-to-end example: full JSON events
and/or a client-relay session transcript in a
.crtblock (use.send/.recv/.cspans). - Version History —
.patchnoteslist, newest first, 4-10 notable entries, condensed from git history. Last entry = origin (author + date). - See Also — related NIPs with one-line reasons. Always link back to NIP-01 dependencies.
.creditsbox: Author (from first commit), First commit date + subject, PR number linked ashttps:/if the first commit subject contains/ github.com/ nostr-protocol/ nips/ pull/ <N> (#N), Status chips, link tohttps:/and its/ github.com/ nostr-protocol/ nips/ blob/ master/ XX.md /history.commits/ master/ XX.md .navbtns: prev / next NIP in hex order (lowercase hrefs, real titles). First page's prev and last page's next go to../.index.html .pagefoot: left link to../labeledindex.html Nostr Protocol Manual, right<span class="pageno">NIP XX /.F4</ span>
Component catalog
- Callouts:
<div class="box hint|warn|danger|tech"><span class="tag">Hint!|Warning!|Deprecated|Tech Note</span> <p>…</ p></ div> - Code/terminal:
.crtwith.titlebarand<pre>; span classesk(keys),s(strings),c(comments/placeholders),send(client→relay lines),recv(relay→client lines). - Tables:
<div class="tscroll"><table class="ref">…</withtable></ div> <caption>; the.tscrollwrapper is mandatory (it gives wide tables horizontal scroll on small screens). Wrap key names in<td class="btn">or<span class="kbd">for the chunky-button look. - Chips:
<span class="chip draft|final|mandatory|unrecommended">…</.span> - Diagrams:
<figure class="diagram"><div class="frame"><svg viewBox="…" role="img" aria-label="…">with classesd-actor,d-actor-label,d-wire,d-msg(orange, arrowhead) /d-msg blue,d-flow(animated marching ants),d-label(mono),d-note. Animate packets with SMIL:<circle r="4" fill="#f26a00"><animateMotion dur="2.6s" repeatCount="indefinite" path="…"/. Caption:></ circle> <figcaption>Fig. X-N — <b>Name.</. Add a diagram wherever a flow, structure, or state machine exists (aim for 1-3 per page; 0 is fine only for trivial NIPs). Sequence diagrams: copy Fig. 1-4 pattern from 01.html.b> One STE sentence.</ figcaption> .stampfor deprecated/merged,hr.tearas a section divider if needed.
Status handling
- Deprecated (
unrecommendedwarning in source): full page anyway. Stamp + a.box dangerwith tagDeprecatedright after the Overview bar, stating the reason from the source warning and linking the replacement NIP. In the cartridge use<span class="led err"></leds and anspan> unrecommendedchip. - Merged (12, 16, 20, 33 — "Moved to NIP-01"): a SHORT page. Stamp
merged, explain what the NIP defined, when and why it merged into NIP-01, where that content lives now (link the 01.html anchor), short history, credits. No fabricated spec content. - Note any issues you find (contradictions, dead references, unclear rules) in a
.box techwith tagTech Note— do not silently fix or omit them.
Data sources (all local)
- Spec text:
source-nips/(uppercase filename). Read ALL of it.XX.md - History:
cd source-nips && git log --follow --format='%as|%an|%s' -- XX.md(LAST line = origin). Do NOT add--reverse— combined with--followit can jump into an unrelated file's history via rename detection. Sanity-check that commit subjects actually relate to your NIP's topic; if they look foreign, drop--follow. Condense; group typo fixes as oneclass="minor"entry or skip them. - Dates/tags/status:
manifest.json(fields: num, title, status, note, tags, created, updated). - Do not use the network. Everything needed is local. GitHub URLs are constructed, not fetched.
Cartridge spec card
dt/ rows (adapt to the NIP): Status (chips from manifest tags), Defines (kinds/tags/messages
introduced), Kind(s) (numbers), Requires (NIP deps as links), Transport/Crypto if relevant,
First commit, Last updated. LEDs: 3 led on for active, led on+2 led warn for draft-ish,
3 led err for deprecated.
QA checklist before finishing
- [ ] No
·character anywhere in the file. - [ ] Every kind, tag, message, and error code from the source appears on the page.
- [ ] All NIP cross-references are links to lowercase local pages.
- [ ] prev/next links point to the correct hex neighbors with correct titles.
- [ ] Valid HTML, all tags closed;
</>escaped in code blocks. - [ ] Diagrams have
viewBox,role="img",aria-label, and a figcaption.