Wiki-on-Nostr Architecture

Host the Kapnet wiki as NIP-23 long-form content events on public Nostr relays. Any NIP-23-aware client Yakihonne, Habla, etc. can read them. | Wiki Field | NIP-23 Field | Notes |

Wiki-on-Nostr Architecture

Concept

Host the Kapnet wiki as NIP-23 long-form content events on public Nostr relays. Any NIP-23-aware client (Yakihonne, Habla, etc.) can read them.

NIP-23 (kind:30023) Mapping

Wiki Page → NIP-23 Event

Wiki Field NIP-23 Field Notes
filename d tag kapnet-wiki-{slug}
first H1 title tag Page title
first 200 chars summary tag Page summary
first image image tag First image URL
last modified created_at Last edit timestamp
commit date published_at tag First publish date
category t tag kapnet-wiki-{category}
parent page e tag Reference to parent
tags t tags Hashtags from frontmatter
body content Full page content (Markdown)

Example Event

{
  "kind": 30023,
  "created_at": 1781040000,
  "tags": [
    ["d", "kapnet-wiki-txxm"],
    ["title", "TXXM Envelope Format"],
    ["summary", "A TXXM (Coordination Transaction) is the atomic coordination act of Kapnet..."],
    ["image", "https://kapnet.org/images/txxm-envelope.png"],
    ["published_at", "1780867200"],
    ["t", "kapnet-wiki-concepts"],
    ["t", "txxm"],
    ["t", "envelope"]
  ],
  "content": "# TXXM Envelope Format\n\nA TXXM is the atomic coordination object...\n\n## Fields\n\n- `hs`: unique content hash\n- `ps`: payload\n- `ds`: dependency metadata\n..."
}

Reader Architecture

Option A: Existing NIP-23 Clients (Yakihonne, Habla)

These clients already support kind-30023. They will:

  • Discover our wiki pages by subscribing to our pubkey + kind:30023
  • Render them as articles with title, summary, content
  • Link between articles via NIP-19 naddr codes

No reader development needed.

Option B: Kapnet Web Wiki Reader

A lightweight web app served by kapnet-web that:

  • Queries the relay for our kind:30023 events
  • Renders them as a wiki with sidebar navigation
  • Implements edit button (via Kapnet TUI or API)

Publisher Architecture

wiki-to-nip23.mjs

Reads wiki pages from shared-rw/llmwiki/ and publishes as NIP-23 events.

Flow:

  1. Read *.md files from shared-rw/llmwiki/
  2. Extract title, summary, tags, images
  3. Publish as kind-30023 with d-tag = kappa-wiki-{slug}
  4. Store mapping in shared-rw/kapnet-wiki/registry.json

Registry

{
  "pages": {
    "kapnet-wiki-txxm": {
      "slug": "txxm",
      "title": "TXXM Envelope Format",
      "eventId": "abc123...",
      "publishedAt": 1781040000,
      "updatedAt": 1781040000,
      "category": "concepts"
    }
  },
  "totalPublished": 42,
  "lastSync": 1781040000
}

Namespace

All wiki pages use d-tag prefix kapnet-wiki-

  • Easy to query: { "kinds": [30023], "#d": ["kapnet-wiki-*"], "authors": [our-pubkey] }
  • Easy to link: NIP-19 naddr with d-tag kapnet-wiki-{slug}
  • No collision with other NIP-23 apps

Edit Flow

Via TUI (F10 Operator)

  1. User selects “Edit Wiki” from F9 Messages or main menu
  2. User selects page from list
  3. Opens in terminal editor (vim/nano)
  4. On save, publishes new kind:30023 with same d-tag
  5. Relay archives old version, new version takes over

Via Web UI

  1. Click “Edit” on any wiki page
  2. Edit in Markdown editor
  3. Click “Publish”
  4. Signs with operator key, publishes to relay

Via Git Push (kor.git)

  1. Edit wiki page in GitHub repo (kor-git/kapnet-wiki)
  2. CI pipeline publishes to Nostr as kind:30023
  3. Both GitHub and Nostr stay in sync

Via Nostr Post (kind:1 or kind:30078)

  1. Reply to a wiki page note with suggested edit
  2. Operator reviews, approves edit
  3. Publishes new version

Publishing Strategy

Initial Launch

Publish the top 10-15 most important wiki pages as NIP-23:

  1. Kapnet overview (concepts/kapnet.md)
  2. TXXM envelope (concepts/hyper-protocolization.md)
  3. Bitcoin settlement (concepts/bitcoin-settlement.md)
  4. Zoo of Souls (concepts/zoo-of-souls.md)
  5. Kor.git (concepts/kor-git.md)
  6. KSP routing (concepts/ksp-inter-herm-routing.md)
  7. Courier Bridge (concepts/courier-bridge.md)
  8. Kapactivity (concepts/kapactivity.md)
  9. Block parser (concepts/block-parser-design.md)
  10. Publicity loops (concepts/nostr-publicity-loops.md)
  11. TUI operator (concepts/kapnet-tui-operator.md)
  12. Communication (concepts/messaging-system.md)
  13. Contact readiness (concepts/contact-readiness.md)
  14. Erudition campaigns (concepts/kapnet-erudition-campaigns.md)
  15. Budget plan (concepts/budget-plan.md)

Ongoing

  • New wiki pages auto-published on merge to main
  • Edits to existing pages published as new versions
  • Monthly “wiki digest” published as kind:1 thread

Infrastructure needed

  • wiki-to-nip23.mjs — exporter script
  • shared-rw/kapnet-wiki/registry.json — page registry
  • shared-rw/kapnet-wiki/sync.sh — sync trigger
  • GitHub Action in kor-git/kapnet-wiki → publish to Nostr on merge

Write a comment
No comments yet.