Nostr From Scratch

Building Nostr in Coax.

This book builds Nostr in Coax, from protocol primitives to client and relay programs. Nostr's cryptography is Bitcoin's: SHA-256, HMAC, HKDF, ChaCha20, secp256k1, BIP-340 Schnorr signatures and Bech32 are built in its companion, Bitcoin From Scratch. This book starts from there with x-only ECDH, NIP-19, the JSON that an event ID hashes and NIP-44, and then builds the event model, a WebSocket transport, a client and a relay on them. Part VI examines the NIP families in `nostr/nips/`: the official set, the OpenAgents set and Block's Buzz set. Chapter 104 adds NIP-KEYS; its source-pin review remains pending. Part VII checks the stack against published vectors and other implementations, and Part VIII separates OpenAgents' current consumers from offline integration examples and future deployments. Completing the full protocol and production scope is the destination; the chapter labels below describe the teaching profiles that exist today.

The C host may link one TLS library so native clients reach wss:// relays. Every protocol decision above the socket, including WebSocket framing, Nostr messages, NIP-42 and NIP-44, is Coax code (AGENTS.md). Money follows the repository's Bitcoin-only rule: Lightning and on-chain Bitcoin are built; Cashu and Fedimint are recognized and never built (chapter 74).

You need the Coax language (its book's Parts I–III) and Parts I–V of Bitcoin From Scratch. Chapters 1–13, 15 and 18 moved there; they keep their numbers here, marked moved. The plan gives the order and each chapter's dependencies, done criteria and spec files. The contents list every chapter. The work to implement every chapter is tracked in issue #12612.

Start here

  • What you build. A Nostr client and a relay, and readers for the NIPs that OpenAgents uses.
  • Why Nostr. On Nostr a key is the identity. A person or an agent can sign work, publish it to any relay and be found by anyone, with no account that a platform can close. The same seed gives a Bitcoin wallet (Bitcoin chapter 121).
  • What you need. The Coax book's Parts I–III and Bitcoin From Scratch's Parts I–V.
  • The core path. Parts I–V, chapters 14–44: shared secrets, the event model, transport, a client and a relay. Part VI is a reference: read the NIP you need.
  • The OpenAgents NIPs. Chapters 76–92 are OpenAgents' own NIPs. Read together, they describe how an agent finds work, does it, proves it and is paid: 80 (jobs and markets), 82 (Pylons), 83 (attested work) and 86 (payments for requests). Chapter 102 runs one agent through all of it, offline.
  • Two protocols. The OpenAgents Protocol is a set of protobuf schemas (`proto/`) for messages between OpenAgents' own surfaces. The NIPs are the public form: signed events that anyone can read, verify and write without asking OpenAgents.
  • Where this book sits. See the OpenAgents books for the whole library.

Status

Of the 89 chapters in this book, 88 are implemented and 1 is partly implemented; 15 more numbers are marked moved. All 89 have runnable examples. Chapter 103's production cutover to the Coax relay completed on 2026-11-12 (#13361) and the Rust fallback was retired on 2026-11-13 (#13382). Chapter 104 has teaching text, checked signing/recovery components in regtest and private signet, and still requires a treasury spend broadcast on the public signet.

An implemented chapter meets the promotion standard below for its stated scope. It does not establish full support for every feature of a cited NIP. For example, chapters 75–92 list protocol records and runtime paths they do not build. Chapters 101 and 102 compose offline examples; their label does not claim live Metaverse presence, wallet payment or a migrated hosted agent. The completion route keeps those exits separate.

The code is under coax/lib/crypto/, coax/lib/nostr/ and coax/lib/net/, with checks and dated evidence in docs/verification/. The registry claims native CPU qualification for all 89 chapters and Wasm qualification for 8; 81 remain native-only. These are claims about each chapter's stated profile, not about a complete client, relay or application running on both targets.

The chapter registry records each chapter's status (one of implemented, partly implemented, design draft or planned), its profile, its dependencies and three separate facts: its implemented source (source), the targets with recorded evidence for its profile (qualified_targets), and the code outside the book that uses it today (adopted_by). The status table below, the contents and each chapter's status marker must agree with it; python3 psionic/tests/book.py --book nostr fails when they don't.

adopted_by lists reviewed direct consumers of a source component outside the book. It is not an end-to-end qualification or approval to use production keys. A client importing the shared event reader has not thereby adopted every NIP-01 feature. An empty list means no direct consumer is recorded; it does not rule out transitive use. The registry includes the API's Coax NIP-98 bridge, public homepage reader, CLI and Pylon paths. The complete agent exchange and Metaverse zaps remain offline examples. Chapter 97's runnable report uses a pinned historical registry snapshot, rather than reading this current registry.

Direct consumerAdopted componentScope still outside that edge
coax/web/api/nostr.cChapter 49's Coax NIP-98 verification through its generated CRoute-specific replay, sessions and account admission; other signers
coax/web/project/landing-nostr.coaxPublic event verification, messages, filters, names and beacon checksComplete relay history or trust in provider declarations
apps/openagents-cli/main.coax, relay.coax, api.coaxIdentity derivation, event signing, relay and NIP-98 requestsThe hosted runner's migration and rollback
psionic/lib/pylon/run.coaxNIP-42, signed events, NIP-44 and the Pylon queueProduction key custody and every deployment target
apps/shared/host/apple/SparkWallet.swift, apps/openagents-desktop/Window+Wallet.swiftChapter 101's existing wallet rules and desktop Bitcoin Spark + NIP-06 wallet paneNIP-MV presence, Metaverse zaps and Spark-backed Wallet Connect

What remains

Follow Completion route in order: close recorded integration and pin debt, qualify consumer profiles on their actual targets, finish relay feature parity and production migration, connect the offline the OpenAgents Metaverse and agent examples to applications, and finish treasury signing and independent recovery. The route names each required result and the dependencies in the other books.

Promoting a draft to a teaching chapter

A partly implemented or design draft chapter becomes a teaching chapter only when it has all four of the following:

  1. A worked calculation or trace. A small input whose result the chapter works out by hand, step by step, before the program runs.
  2. Runnable source. The code and an example in nostr/examples/, listed in examples.json, with an exact transcript that the book's checks compare in debug and release.
  3. A deliberately broken case and its diagnostic. An input or an edit that the code refuses, with the exact error or refusal shown and its exit status checked.
  4. An independent check. A published test vector, a reference implementation or a hand-derived value that the checks compare with the code's result.

When all four exist, update the chapter's status in the same commit in four places: the chapter's status marker, its entry in chapters.json, its label in the contents and its row in the table below. The registry check fails when they disagree.

To find a route through the books, see Paths through the books and the shared completion milestones.

Writing style

Write chapters to the Google developer documentation style guide:

  • Use short, plain sentences in active voice and present tense.
  • Address the reader as "you".
  • Say what the code does and what was measured. Don't use metaphors, personification, or literary phrasing.
  • Use numbered lists for steps and bulleted lists for related items.
  • Use code font for code, file names, and identifiers.

Checking the book

Commands run from the repository root.

shell
python3 psionic/tests/book.py --book nostrpython3 psionic/tests/book.py --book nostr --coax coax/bin/coax

The first checks structure: chapter files and headings, the contents, local links, status markers, the chapter registry and the example inventory in examples.json. The second also runs every example in nostr/examples/ in debug and release and compares its output and exit status. It is the same checker as the Psionic and Metaverse Engine books'; build the compiler once with coax/build.sh.

Coax listings, equations and short illustrative blocks use jai fences; commands use shell.

Chapters

Moved to Bitcoin From Scratch (chapters 1–13, 15 and 18)

Bytes, big integers, constant time, SHA-256, HMAC, HKDF, ChaCha20, secp256k1, BIP-340 and Bech32 are now chapters of Bitcoin From Scratch. The plan maps each number here to its Bitcoin chapter.

Part I. Shared secrets, encodings and encryption (chapters 14, 16, 17, 19 and 20)

x-only ECDH for NIP-44 conversation keys, NIP-19 and nostr: URIs, the exact JSON that a Nostr event ID hashes, the retired NIP-04 scheme and its weaknesses, and NIP-44 v2 checked against its official vectors.

ChapterStatusResult
14. Shared secrets with ECDHRunnable: native C and wasmx-only ECDH that validates the peer key and returns the raw shared x, checked against labelled Wycheproof secp256k1 inputs, for NIP-44 conversation keys.
16. NIP-19 entities and nostr: URIsRunnable: native Cnpub, nsec and note, and the TLV forms nprofile, nevent and naddr with relay hints, plus the nostr: URI scheme of NIP-21.
17. JSON you can signRunnable: native CA bounded JSON reader and writer that keep original bytes, and the exact NIP-01 serialization [0, pubkey, created_at, kind, tags, content] with its escape rules, distinct from RFC 8785 JCS.
19. NIP-04 and why it is retiredRunnable: native CNIP-04's AES-256-CBC with the shared x as key and its ?iv= suffix, its weaknesses (no authentication, metadata in the clear, the key used as is), and a decrypt-only reader checked against FIPS-197, SP 800-38A and OpenSSL that refuses to encrypt.
20. NIP-44 encrypted payloadsRunnable: native CNIP-44 version 2: conversation keys, padding, ChaCha20, HMAC over nonce‖ciphertext checked before decryption, and every valid and invalid vector in nip44.vectors.json.

Part II. The event model (chapters 21–25)

NIP-01 events, IDs and signatures, kinds and tags, filters, the relay messages that carry them, and NIP-59 gift wrap built on all of them.

ChapterStatusResult
21. Events, IDs and signaturesRunnable: native C and wasmThe NIP-01 event: id, pubkey, created_at, kind, tags, content, sig; recomputing the ID, verifying the signature, and building signed events separately from reading them.
22. Kinds and tagsRunnable: native CKind ranges (regular, replaceable 0, 3 and 10000–19999, ephemeral 20000–29999, addressable 30000–39999 by d tag) and the standard tags e, p, a and d.
23. FiltersRunnable: native C and wasmNIP-01 filters: ids, authors, kinds, #<letter> tags, since, until and limit; AND across fields, OR within a list, inclusive times, and absent lists distinct from empty ones.
24. Relay messagesRunnable: native CClient frames EVENT, REQ, CLOSE, AUTH and COUNT, relay frames EVENT, OK, EOSE, CLOSED, NOTICE and AUTH, and the OK/CLOSED reason prefixes NIP-20 introduced.
25. Gift wrapRunnable: native CNIP-59 rumors, kind-13 seals and kind-1059 gift wraps from one-time keys, with randomized timestamps, checked in both directions against an independent implementation.

Part III. Transport (chapters 26–28)

WebSocket framing as a client and a server in Coax, over the host's socket and TLS.

ChapterStatusResult
26. WebSocket framesRunnable: native CRFC 6455 as a client: the opening handshake with Sec-WebSocket-Accept from SHA-1, masked client frames, fragmentation, ping, pong and close with status codes.
27. A WebSocket serverRunnable: native CThe server side of RFC 6455: accept the upgrade, refuse unmasked client frames, write unmasked frames, enforce frame and message limits and close cleanly.
28. Sockets, TLS and relay URLsRunnable: native CThe host boundary: the C host opens sockets and does TLS only; Coax parses ws:// and wss:// URLs, decides every frame and owns every protocol decision above the socket.

Part IV. A client (chapters 29–33)

A relay connection with generations and backoff, subscriptions and EOSE, publishing with acknowledgements, the outbox model and a client that survives restarts.

ChapterStatusResult
29. A relay connectionRunnable: native CThe pure client state machine: OPEN, CONNECTING, CLOSED and BACKOFF, connection generations that make stale reports harmless, and capped jittered backoff.
30. Subscriptions and EOSERunnable: native CSubscription IDs that name a slot and its serial, EOSE as the end of stored events and never a completeness claim, NIP-67 completeness hints, and paginated catch-up.
31. Publish and wait for OKRunnable: native CPublishing with acknowledgement deadlines, the distinction between published, acknowledged, refused and unknown, and requeue after AUTH.
32. Many relays and the outbox modelRunnable: native CNIP-65 relay lists (kind 10002 with r tags marked read or write), reading from an author's write relays, writing to your write relays and the tagged users' read relays.
33. A client that survives restartsRunnable: native CA durable client journal that stores verified originals, an offline outbox that sends each event again after a restart without a second copy anywhere, subscriptions that resume with since, and deletions that are never resurrected on reconnect.

Part V. A relay (chapters 34–44)

Admission, durable storage, filter matching with indexes, NIP-11, NIP-42, deletion and expiration, NIP-45 counts, NIP-50 search, NIP-70, NIP-77 negentropy, and limits.

ChapterStatusResult
34. Admit an eventRunnable: native CThe relay's EVENT admission: verify ID and signature, check size, tag and time limits, answer OK with the standard prefixes, and route each frame from one connection.
35. Store eventsRunnable: native CVerified originals with one copy per ID, replaceable and addressable replacement with the same-second lowest-ID rule, an fsync before OK, and crash recovery that cuts only a partial last write.
36. Match filters with indexesRunnable: native CAnswering REQ from the store newest first with query cost limits, then indexes by ID, author, kind and tag that never change which events match.
37. NIP-11 relay informationRunnable: native CThe relay information document served on Accept: application/nostr+json: name, pubkey, supported_nips, software, version and limitation fields that match what the relay enforces.
38. NIP-42 authenticationRunnable: native CChallenges bound to one connection and one relay URL, kind 22242 events with relay and challenge tags checked within a time window, and AUTH on both the client and the relay.
39. Delete, expire and vanishRunnable: native CNIP-40 expiration tags enforced at admission and query, NIP-09 kind-5 deletion requests from the same author with durable tombstones, and NIP-62 kind-62 requests to vanish.
40. Count eventsRunnable: native CNIP-45 COUNT requests and responses, approximate counts, and HyperLogLog with 256 registers whose offset comes from the filter.
41. SearchRunnable: native CNIP-50's search filter field, a word index over the store, results ordered by a word-count score, include:spam, and every other key:value extension ignored.
42. Protected eventsRunnable: native CEvents tagged ["-"] accepted only from their authenticated author, so a third party cannot republish them to this relay.
43. Negentropy syncRunnable: native CNIP-77's NEG-OPEN, NEG-MSG, NEG-CLOSE and NEG-ERR, and Negentropy protocol V1: range-based set reconciliation over (created_at, id) with fingerprints.
44. Limits, policy and floodsRunnable: native CPer-connection and global limits, rate limits with rate-limited: reasons, storage caps, slowloris timeouts and a write policy that is declared, not implicit.

Part VI. Every NIP (chapters 45–92)

Every other official NIP pinned in nostr/nips/official/, every OpenAgents NIP and every Block (Buzz) NIP, grouped by subject and ordered by dependency.

ChapterStatusResult
45. Profiles, follows and namesRunnable: native CKind 0 profiles and their nip05 value, kind 3 follow lists with relay hints and petnames, the newest list replacing older ones in the store, and NIP-05 identifiers checked offline against a /.well-known/nostr.json response, refusing redirects and other keys; and NIP-39 kind 10011 identity claims, with each proof's URL for six platforms and a check that a fetched proof holds the key's npub. NIP-24's extra fields are not read yet.
46. Keys from a seed phraseRunnable: native CBIP-39 words to seed with PBKDF2-HMAC-SHA512, BIP-32 derivation at m/44'/1237'/0'/0/0, and the NIP-06 key and its npub.
47. Encrypted key backupRunnable: native C and wasmNIP-49 ncryptsec: NFKC-normalized passwords, scrypt with log_n from the payload, XChaCha20-Poly1305 with the key-security byte as associated data, and bounded KDF memory.
48. Signers outside the appRunnable: native CNIP-07's window.nostr and NIP-55's Android signer intents described; NIP-46 remote signing built: bunker:// and nostrconnect:// URIs (secret kept, never printed), NIP-44-encrypted kind 24133 requests and responses, a client matching responses by id against a fixed deadline, a one-use connect secret, and an #authority permission check by method and kind.
49. HTTP authRunnable: native C and wasmNIP-98 kind 27235 events in Authorization: Nostr <base64>, binding the exact URL, method and payload hash within 60 seconds, with single-use event IDs.
50. Notes, threads and subjectsRunnable: native CKind 1 notes, NIP-10 marked e tags (root, reply, mention) with the deprecated positional form, p tags for participants, NIP-14 subject and NIP-36 content-warning.
51. References inside contentRunnable: native CNIP-27 nostr: references in content, the deprecated NIP-08 #[index] mentions, and NIP-30 :shortcode: custom emoji with emoji tags and kind 30030 sets.
52. Reposts, reactions and commentsRunnable: native CKind 6 and 16 reposts, kind 7 reactions (+, -, emoji) and kind 17 website reactions, and NIP-22 kind 1111 comments with uppercase root and lowercase parent scope tags.
53. Long-form, drafts and wikiRunnable: native CKind 30023 articles and 30024 drafts in Markdown, NIP-37 kind 31234 draft wraps encrypted with NIP-44, and NIP-54 kind 30818 wiki articles with d-tag normalization.
54. Lists, sets and bookmarksRunnable: native CNIP-51 standard lists (10000 mutes, 10001 pins, 10003 bookmarks and others) and sets (30000 follow sets and others) with public tags and private items encrypted to self, and NIP-B0 kind 39701 web bookmarks.
55. Labels, reports and trusted assertionsRunnable: native CNIP-32 kind 1985 labels in L namespaces, NIP-56 kind 1984 reports with report types, and NIP-85 kinds 30382–30385 assertions from declared providers (kind 10040).
56. Proof of workRunnable: native CNIP-13 difficulty as the number of leading zero bits of the event ID, the nonce tag with its target, and relay admission by pow: reason.
57. Media and filesRunnable: native Cimeta tags (NIP-92) and kind 1063 file metadata (NIP-94) read, written and checked against downloaded bytes' SHA-256; picture, video and voice imeta tags; Blossom blob addresses, kind 10063 server lists and kind 24242 upload authorizations; NIP-96 read only.
58. Calendars, polls and highlightsRunnable: native CNIP-52 date (31922) and time (31923) events, calendars (31924) and RSVPs (31925); NIP-88 polls (1068) and responses (1018); NIP-84 highlights (9802).
59. Groups and communitiesRunnable: native CThe relay side of NIP-29 groups: h tags, moderation kinds 9000–9009 by role, join requests with invite codes, previous references and the relay-signed 39000–39003 state; NIP-72's moderator approval check; NIP-C7 chats (kind 9 with q replies); and NIP-7D threads (kind 11) whose replies are NIP-22 comments on the thread itself.
60. Private messagesRunnable: native CNIP-17 kind 14 chat and kind 15 file messages sent as gift wraps, kind 10050 DM relay lists; NIP-A4 kind 24 public messages, read with their receivers and expiration and refused when they carry an e tag; and the unrecommended NIP-EE MLS groups, which are not implemented.
61. Live activitiesRunnable: native CNIP-53 kind 30311 live events with streaming, status and participant roles, kind 1311 live chat, and kind 30312/30313 meeting spaces and rooms with kind 10312 presence.
62. Badges and statusesRunnable: native CNIP-58 badge definitions (30009), awards (8) and profile badges (10008, formerly 30008), and NIP-38 kind 30315 user statuses with expiration.
63. Git on NostrRunnable: native CNIP-34 repository announcements (30617), issues (1621), patches (1617) and statuses (1630–1633), with the newest status by the author or a maintainer deciding the state; pull requests (1618) and updates (1619), with the tip taken from the author's newest update; and NIP-C0 snippets (1337). Repository state (30618) and a pull request's status are not built.
64. App data and handlersRunnable: native CNIP-78 kind 30078 application data, NIP-89 handler recommendations (31989) and announcements (31990) with follows-first resolution and safe URL templates, and NIP-5A static websites (35128 and 15128 manifests) with every served file checked against its hash. NIP-CD slash commands (31992, 10992) are not built.
65. Data vending machinesRunnable: native CNIP-90 job requests (5000–5999), results (6000–6999) and feedback (7000), results matched to their request through the embedded event, a bid-capped payment check against the bolt11 amount, the customer's job state machine, and encrypted requests on NIP-44 only (NIP-04 refused).
66. Markets and ordersRunnable: native CNIP-99 classified listings (30402 and 30403 drafts) with price in a currency and frequency, NIP-69 peer-to-peer order events (38383), and the unrecommended NIP-15 marketplace.
67. Relay discovery, access and managementRunnable: native CThe NIP-86 management endpoint (Content-Type, NIP-98 with the payload tag, admin keys, single-use event IDs, ban and allow lists for keys, events and kinds) and the policy admission consults; NIP-66 discovery and monitor events and a median round-trip time over trusted monitors; NIP-43 member lists counted only from the relay's NIP-11 self key, and join and leave requests.
68. Bridges, external IDs and timestampsRunnable: native CNIP-48 proxy tags for bridged events, NIP-73 i and k tags for external content IDs (URLs, ISBNs, podcasts, geohashes), and NIP-03 kind 1040 OpenTimestamps attestations.
69. Small content kindsRunnable: native CNIP-35 torrents (2003), NIP-64 chess games in PGN (64), NIP-CC geocaches (37516) and logs (7516, 7517), and NIP-F4 podcasts.
70. Retired and experimental NIPsRunnable: native CNIP-26 delegation tokens, the NIP-31 alt tag and NIP-BE Bluetooth LE transport, each marked unrecommended in the pinned text, with what this stack reads and what it never builds.
71. Lightning zaps and goalsRunnable: native CNIP-57 zap requests (9734) sent to an LNURL server and zap receipts (9735) whose bolt11 description hash commits to the request, and NIP-75 zap goals (9041).
72. Wallet ConnectRunnable: native CNIP-47 Nostr Wallet Connect: nostr+walletconnect:// URIs (secret kept, never printed), the info event (13194) with NIP-04-only wallets refused, every command's request (23194) and response (23195) JSON read and written, NIP-44 v2 under the connection secret, responses matched by author, p, e and result_type, and an #authority spending budget that refuses with QUOTA_EXCEEDED.
73. Payment targetsRunnable: native CNIP-A3 kind 10133 payto tags, with only the Bitcoin and Lightning target types acted on under the repository rule.
74. Cashu and Fedimint are excludedRunnable: native CNIP-60 Cashu wallets, NIP-61 nutzaps and NIP-87 mint discovery, recognized and never built: a classifier marks their nine kinds, references to them and ecash payment values as excluded, and the book check fails if another file names them.
75. Hosts and reachabilityRunnable: native CNIP-HOST grants bound to the original host-signed 3188 envelope and admitted against the host's record (request window, revocation, expiry, epochs, rights, retained replies), and NIP-REACH presence freshness and route generations. Invitations, enrollment, the directory, hint selection and direct channels are not built.
76. Work, coordination and controlRunnable: native CNIP-COORD atomic claims with fencing tokens and leases (renew, release, cancel, the dispatcher fence) and NIP-CTRL pairing, revocation and command admission with the JCS command fingerprint. NIP-WORK items and NIP-CTX frames, COORD proposals, reservations and findings, and CTRL reads are not built.
77. Capabilities, policy and extensionsRunnable: native CNIP-CAP dispatch (definition, exact binding, presence, grant, effects, ceilings, enforcement plan), NIP-POL single-use approvals, and NIP-EXT installation of signed releases (namespace, unknown features, equivocation, revocation, checkpoint freshness). Probes, preferences, instruction sets, listings, migration and NIP-REG are not built.
78. Runs, sessions, terminals and trajectoriesRunnable: native CNIP-RUN record digests and journal replay (gaps, forks, broken chains, controller handoff with fencing, the per-attempt state machine, head hints), NIP-ATIF chunk checks that report missing chunks, NIP-TERM client frame order with gaps. NIP-SESS, RUN retention and the 3187/30186, 3188 and 3198/3199 events are not built.
79. Agents, skills and automationRunnable: native CNIP-AGENT saved agents (every definition field, private 3188 carriage sealed and opened, pinned selection by signer, id, revision and digest) and NIP-AUTO scheduling (once, interval and source triggers, missed and occupied slots recorded once, one occurrence per source revision, authority per occurrence, pause, resume and cancel). Public agents, NIP-SKILL listings, NIP-SOV and AUTO continuation, budgets and journals are not built.
80. Jobs, labor and marketsRunnable: native CNIP-CJ response admission (only the worker the request named), NIP-MKT negotiation from RFQ to confirmed order and fixed-price Lightning settlement (one obligation, one attempt at a time, a preimage of the payment hash), and NIP-LAB submission, verification and acceptance at the exact price. CJ bodies, record encodings and chains, rework, disputes, cancellation, refunds and invoice decoding are not built.
81. Decisions, evaluations, optimization and programsRunnable: native CNIP-DEC body bounds and answer admission (an answer must match its request's question set exactly), NIP-EVAL reports shown as verified, unverifiable or untrusted and the admission that cites them, and NIP-OPT data-plan isolation. NIP-PRG, the DEC wire job, the 3189 publication and most OPT records are not built.
82. Pylons, environments and deploysRunnable: native CNIP-PYLON beacons (30200) and service receipts (3201) verified and read: freshness by the reader's clock, no capacity from an expired beacon, receipts signed by their buyer and credited only to the beacon their p and a tags name. Model-group beacons, paid receipts, 30201 events, NIP-ENV and NIP-DEPLOY are not built.
83. Attested work and sealed dataRunnable: native CNIP-ATT releases (3202), release heads (30202) and attested endpoints (30203) checked by a client under a fixed clock: admission under the notice delay, rollback, the key-to-release binding and a Confidential Space token's claims; an endpoint that does not match its head is refused. NIP-VAULT tier user: an object opens only through a key slot (device or nostr method). Token signatures, raw TEE quotes, rebuilds, transparency, sealed jobs, tiers sealed and operator, and the key index are not built.
84. Knowledge and workspacesRunnable: native CNIP-KB entry versions (3190), heads (30190) and withdrawals (3191) read and checked, equivocation reported, the current version chosen without a withdrawn or conflicting version, and the reader's trust rule; NIP-WS conditional text replacements under the host's grants (stale, conflict, idempotency). Evidence, snapshots, private entries, ranges, worktrees, checkpoints and projections are not built.
85. Live media, worlds and experienceRunnable: native CNIP-MV world definitions (33300), pose frames (23300) admitted for their world (a pose outside its bounds refuses) and ordered by session and sequence under a fixed clock, entity states (33301) with object ids from SHA-256, and the NIP-XP quest, award and revocation readers and the derived ledger (a revoked award is removed). NIP-LIVE, the XP acceptance rules, shared bodies, gestures and zone commands are not built.
86. Lightning payments for requestsRunnable: native CNIP-X402: x402 v2 over HTTP with the three base64 JSON headers, Bitcoin mainnet Lightning with a bolt11 invoice in millisats, and the openagents:spark-receiver:1 settlement profile.
87. Owner attestation and agent authenticationRunnable: native CBlock's NIP-OA auth tag by which an owner key authorizes an agent key, and NIP-AA agent authentication to relays with virtual member privileges and revocation.
88. Federated identityRunnable: native C and wasmNIP-FI stateless assertions verified offline: bounded compact JWS, RS256 only, a closed JWKS, exact kid, and issuer, audience, community, token-class and clock binding. Fetching the JWKS, NIP-42 pairing, sessions and NIP-FA are not built.
89. ChannelsRunnable: native CNIP-CL identity tags, labels, the oldest-channel rule and the legacy-type listing rule for system channels and 44100/44101 notices; NIP-CW channel and thread windows with composite cursors, exact has_more and the client rule that a response without its bounds is never an empty channel; NIP-DV snapshots readable only by their owner; NIP-WP icon commands. Summaries, 39007 binding and overlay signing are not built.
90. Artifacts, archives and remindersRunnable: native CNIP-AR channel artifacts (45010) with compare-and-swap revisions: a stale prev conflicts, an accepted event again succeeds unapplied, writes need the home channel and a move both; NIP-IA archive and unarchive requests with self, admin and owner-of-agent consent, checked against NIP-IA's published vectors; NIP-ER reminders (30300) with one head per address, author-only reads and a notification path that fires each reminder once at its not_before. Query limits, redaction and building reminders are not built.
91. Git signing, projects, leases and read stateRunnable: native CNIP-GS signing hashes, signatures and armor reproducing both published vectors; the NIP-MP ingest rules and fold over all 31 ingest and 12 fold fixtures; the NIP-PL expiration window and replacement order; the NIP-RS max-merge and ciphertext vector; and the four envelope projections. The signing program, lease plaintexts and the read-state override layer are not built.
92. Private agent stateRunnable: native CNIP-AE engrams (30174) sealed, opened by the agent or the owner only, chosen by head selection and protected from rollback; NIP-AO observer frames (24200) admitted only between an owned pair, fanned out in memory and never stored or logged, checked by a canary; the NIP-PMA reservation (30179) refused. NIP-AP personas and NIP-AM turn metrics are not built.

Part VII. Interop and verification (chapters 93–97)

Pinned vectors, differential tests against reference implementations, fuzzing, formal properties and a conformance report.

ChapterStatusResult
93. Test vectors and their provenanceRunnable: native CEvery vector file pinned by source URL, revision, license, retrieval date and SHA-256, with derived adapters labelled and their input hashes recorded.
94. Differential testsRunnable: native CRunning the same inputs through Coax and a reference implementation: the Rust relay from history in a network-less sandbox, and independent libraries for signatures, NIP-44 and NIP-59.
95. FuzzingRunnable: native CA seeded mutation fuzzer for every parser (JSON, events, filters, frames, NIP-19, NIP-44 payloads) under ASan and UBSan, with coverage guidance and shrinking shown on planted bugs, and minimized inputs kept as tests.
96. Formal propertiesRunnable: native CFive properties checked on every case of small domains, each with a planted bug its check finds: filter matching is AND across fields and OR within lists, a subscription is a union, replacement is order-independent, the index equals the scan, and verification refuses every one-bit change.
97. A conformance reportRunnable: native CA machine-readable support matrix per profile (core-read, core-write, phone-signer, openagents-host, block-identity, block-channel, agent-private, key-backup) that refuses to advertise a NIP whose runtime gate is missing.

Part VIII. Nostr in OpenAgents (chapters 98–104)

Where projects, the website, Pylons, the Metaverse, the wallet and agents use the stack, and the cutover of relay.openagents.com.

ChapterStatusResult
98. Projects on NostrRunnable: native C and wasmOpenAgents' project pages fold NIP-34 repositories, issues and statuses and NIP-22 comments from the relay, verify each event in the browser, and replace a snapshot only with a complete bounded capture.
99. The website and sign-inRunnable: native C and wasmLogging in to openagents.com with a Nostr key: a NIP-98 signed challenge from a browser signer (NIP-07) or any other signer becomes a session, a signed request is its key's account at L2, and openagents login joins a computer's key to an account.
100. Pylons and the meshRunnable: native CPylons authenticate to the relay with NIP-42, announce beacons, and answer sealed NIP-44 decision requests; the mesh opens encrypted channels with this book's primitives.
101. The Metaverse and the walletRunnable: native CTwo players' NIP-MV presence through a Coax relay within the latency budget, and one in-world zap from request to counted receipt, paid only when the Spark wallet's rules in pay/wallet.coax pass, with Wallet Connect as a second path; what runs in production today and what is only in this book.
102. Agents on NostrRunnable: native COne attested agent end to end, offline: NIP-42 and NIP-AA login, a NIP-MKT order, a sealed NIP-CJ job claimed once and journaled with NIP-RUN, the answer, and payment against a Lightning preimage; what runs in production today and what is only in this book.
103. Replace relay.openagents.comRunnable: native CAn export format, an import that verifies every id and signature again, event-set equality (a sorted-id digest, with Negentropy naming the difference), a shadow comparer, and the cutover and rollback runbook. The production cutover completed 2026-11-12 (#13361), and the follow-up hardening and Rust fallback retirement completed 2026-11-13 (#13382).
104. Agent treasuries and a network of keysPartly implemented: native CNIP-KEYS wallets, enrollments, independence declarations and signing requests read under closed schemas; a wallet admitted by recomputing its BIP-380 descriptor, applying composition rules 1 to 4 and verifying each enrollment's BIP-322 possession proof; P2WSH scripts from BIP-32 public derivation; a signer that recomputes every output, the change and the fee from a PSBT v0 and refuses a PSBT whose outputs differ from its request; nonce idempotency, recovery timelocks, retired wallets, the co-signer's delay and the hot ceiling; RFC 6979 ECDSA partial signatures over BIP-143 digests, the PSBT with them and the coordinator's 2-of-3 transaction; BIP-341 Taproot key-path digests and signatures; requests and receipts as 3188 artifacts over a Coax relay, with Bitcoin Core confirming the spend and recovering the coins from the descriptor in regtest and on a private signet. Open: the spend has not been broadcast on the public signet. tr wallets, PSBT v2 and miniscript spends are not built.