Wiki-on-Nostr Architecture
- Wiki-on-Nostr Architecture
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:
- Read *.md files from shared-rw/llmwiki/
- Extract title, summary, tags, images
- Publish as kind-30023 with d-tag = kappa-wiki-{slug}
- 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)
- User selects “Edit Wiki” from F9 Messages or main menu
- User selects page from list
- Opens in terminal editor (vim/nano)
- On save, publishes new kind:30023 with same d-tag
- Relay archives old version, new version takes over
Via Web UI
- Click “Edit” on any wiki page
- Edit in Markdown editor
- Click “Publish”
- Signs with operator key, publishes to relay
Via Git Push (kor.git)
- Edit wiki page in GitHub repo (kor-git/kapnet-wiki)
- CI pipeline publishes to Nostr as kind:30023
- Both GitHub and Nostr stay in sync
Via Nostr Post (kind:1 or kind:30078)
- Reply to a wiki page note with suggested edit
- Operator reviews, approves edit
- Publishes new version
Publishing Strategy
Initial Launch
Publish the top 10-15 most important wiki pages as NIP-23:
- Kapnet overview (concepts/kapnet.md)
- TXXM envelope (concepts/hyper-protocolization.md)
- Bitcoin settlement (concepts/bitcoin-settlement.md)
- Zoo of Souls (concepts/zoo-of-souls.md)
- Kor.git (concepts/kor-git.md)
- KSP routing (concepts/ksp-inter-herm-routing.md)
- Courier Bridge (concepts/courier-bridge.md)
- Kapactivity (concepts/kapactivity.md)
- Block parser (concepts/block-parser-design.md)
- Publicity loops (concepts/nostr-publicity-loops.md)
- TUI operator (concepts/kapnet-tui-operator.md)
- Communication (concepts/messaging-system.md)
- Contact readiness (concepts/contact-readiness.md)
- Erudition campaigns (concepts/kapnet-erudition-campaigns.md)
- 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 scriptshared-rw/kapnet-wiki/registry.json— page registryshared-rw/kapnet-wiki/sync.sh— sync trigger- GitHub Action in kor-git/kapnet-wiki → publish to Nostr on merge
Write a comment