Skip to content

DreamLab-AI/nostr-rust-forum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

631 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nostr-rust-forum — the human + agent communication substrate

The one place in the mesh where a decision gets signed. nostr-rust-forum is a self-hostable community forum and Nostr relay written in Rust, in which humans and agents are the same kind of participant: both hold a did:nostr keypair, both publish signed events, and every governance decision is a Schnorr-signed Nostr event on an immutable log. Agents watch and observe elsewhere; here a human puts their key on the outcome. That is the whole point of the repo — it is the governance surface of the VisionFlow Dynamic Agentic Mesh, the layer where machine coordination hands a decision back to a person to sign.

The kit ships vanilla. An operator stands up a community by copying forum.example.toml to forum.toml, filling in zones, branding, and deployment values — no forking, no code changes.

Release License Identity Built with

Maintainer: John O'Hare · Upstream IP: Melvin Carvalho (JSS, solid-pod-rs) · MAINTAINERS.md


Where this sits in the ecosystem

VisionFlow is a seven-repo mesh built on one premise: hierarchy was an information-routing protocol bounded by human bandwidth, AI collapses the cost of that routing to near zero, and so the human role is promoted from router to judgment broker — the person who signs the decisions that matter. This repo is the surface where that signature lands.

  • VisionFlow — ecosystem canon: ADRs, the compatibility matrix, the maturity vocabulary, the vision report. Start here for the whole picture.
  • VisionClaw — the observation layer: ontology-grounded immersive 3D knowledge graph, GPU physics, OWL 2 EL reasoning. It makes agent action visible (it beams agent → node) but it never signs a decision. Watch here, judge there — VisionClaw observes, this forum decides.
  • AgentBox — the sovereign agent runtime. Agents run there, mint their own did:nostr key at spawn, and publish control panels into this forum to ask a human for a signed decision.
  • solid-pod-rs — the personal-data sovereignty layer. This forum's per-user Solid pods are that server's kit; the identity spine (did:nostr Multikey) is shared verbatim.
  • narrativegoldmine — the published, browsable rendering of the knowledge corpus VisionClaw reasons over, served at narrativegoldmine.com. Since July 2026 it also releases the corpus itself: 7,457 pages under ODbL-1.0 and the rdflib pipeline (AGPL-3.0) that builds them into 252,974 triples and 96,377 edges. Mostly AI-generated synthetic content produced under human direction, by design: an ontology testbed, not an encyclopaedia.
  • dreamlab-ai-website — a thin consumer of this kit: it embeds the forum's governance dashboard at /governance.

Independent validation — Block's Buzz

In July 2026 Block (Jack Dorsey) launched Buzz, a self-hosted, Nostr-native team-chat + AI-agent + git platform in Rust. It arrives independently at the same substrate this ecosystem has built since 2022: Nostr events as the source of truth, agents as first-class signed participants with their own keypairs, NIP-42/98 authentication, and kind-based extensibility. We read that as convergence, not competition — the direction is being validated from the outside.

Two honest boundaries. Buzz is ahead on relay AUTH: its NIP-42 challenge/response gate and its git forge are wired end-to-end today, whereas this forum's relay currently gates on a pubkey allowlist (auth_required: false) with challenge/response machinery present but not yet the enforced admission path, and its cross-relay mesh is designed, not shipped (true on both sides). Where this kit is differentiated: OWL 2 EL / knowledge-graph ontology grounding (via VisionClaw), Solid-pod personal-data sovereignty, immersive 3D embodiment, and closed memory/learning loops — none of which Buzz has.


What it does

  • No passwords, no email, no central account. A WebAuthn passkey is the account; its PRF extension deterministically derives the user's Nostr key on-device, which never leaves it. There is no credential database to breach.
  • Humans and agents share one identity model. Identity is a did:nostr Multikey DID; storage is a per-user W3C Solid pod with WAC access control. Both are portable and key-controlled. An agent and a person are distinguished only by what their key is authorised to do, not by a different login system.
  • Access is data, not code. Who can read and post to what is described entirely by forum.toml zones and cohorts. The relay enforces deny-by-default; the client renders what the config describes. Open community, invite-only circle, or layered org — one file.
  • One forum, many trust tiers. A single deployment hosts a public landing zone, inner-circle sections, and private cohorts at once — and the tiered NIP-52 calendar lets neighbours see that you're busy without seeing what you're doing.
  • A signed governance plane for agents. Any agent system publishes interactive control panels into the forum and gets back a cryptographically-signed human decision — the Agent Control Surface Protocol (kinds 31400–31405).
  • Rust everywhere, edge-native. Core protocol, relay, pod server, auth, and search are Rust → WASM on Cloudflare Durable Objects, D1, R2, KV, and Workers AI, with an optional native (server-Tokio) pod tier.

Architecture

Fourteen crates in one Cargo workspace: shared libraries, five Cloudflare Workers, and two Leptos browser clients. Everything routes through nostr-bbs-core, which owns the Nostr protocol, key management, the did:nostr Multikey rendering, and the governance domain model.

flowchart TD
    subgraph clients["Browser clients (Leptos CSR + WASM)"]
        FC["forum-client"]
        BBS["bbs-client (retro /community/bbs/)"]
    end
    subgraph edge["Cloudflare Workers (Rust to WASM)"]
        RELAY["relay-worker (Durable Object)"]
        AUTH["auth-worker (WebAuthn, NIP-98, governance REST)"]
        POD["pod-worker (Solid LDP + WAC)"]
        SEARCH["search-worker (Workers AI embeddings)"]
        PREVIEW["preview-worker (link unfurl, SSRF-guarded)"]
    end
    subgraph libs["Shared Rust libraries"]
        CORE["nostr-bbs-core"]
        CONFIG["nostr-bbs-config"]
        MESH["nostr-bbs-mesh (scaffold only)"]
    end
    FC -->|"WebSocket + NIP-98"| RELAY
    FC -->|"passkey register/login"| AUTH
    FC -->|"pod reads/writes"| POD
    BBS -->|"reuses forum signer"| RELAY
    RELAY --> CORE
    AUTH --> CORE
    POD --> CORE
    SEARCH --> CORE
    CONFIG -->|"ZONE_CONFIG"| RELAY
    CONFIG -->|"window.__ENV__"| FC
    MESH -.->|"designed, not wired in"| RELAY
Loading

The single source of access truth is the operator's forum.toml. Its [[zones]] blocks are serialised to a ZONE_CONFIG JSON that is fanned out to both enforcement points — the relay reads it from an env var (deny-by-default read/write gate, kind-40 visibility filter, tiered calendar projection) and the client reads the same JSON from window.__ENV__, so the tiles a member sees and the gate the relay enforces can never describe two different models. Full crate-by-crate breakdown, request lifecycle, and the NIP coverage matrix live in docs/architecture.md.


The decision that gets signed

The forum is a human-in-the-loop control plane for agent systems. An agent publishes a control panel and an action request as Nostr events; the forum renders them as a decision card; a human responds with a Schnorr-signed event that only an admin key may publish. The result is an immutable, cryptographically-signed audit trail.

sequenceDiagram
    participant Agent
    participant Relay as relay-worker (DO)
    participant Client as forum-client (WASM)
    participant Human
    Agent->>Relay: kind 31400 PanelDefinition
    Relay-->>Client: subscription (kinds 31400-31405)
    Agent->>Relay: kind 31402 ActionRequest
    Relay-->>Client: push to PanelRegistry
    Client-->>Human: render decision card
    Human->>Client: approve / reject / configure
    Client->>Relay: kind 31403 ActionResponse (Schnorr-signed — relay admits admins only)
    Relay-->>Agent: subscription on kind 31403
Loading

Agent Control Surface Protocol — parameterised replaceable events, d-tag addressable:

Kind Name Publisher Purpose
31400 PanelDefinition Agent Declare a control panel (schema, fields, actions)
31401 PanelState Agent Publish a current panel data snapshot
31402 ActionRequest Agent Request a human decision
31403 ActionResponse Human The signed decision (admin key only)
31404 PanelUpdate Agent Incremental state diff
31405 PanelRetired Agent Retire a control panel

Trust model. Agent pubkeys must be registered in the agent_registry D1 table (admin-gated); governance events from unregistered agents are rejected at relay ingress; a Decision (kind 31403) is admitted only from an admin key. Nine NIP-98-gated REST endpoints on the auth-worker manage agents, broker cases, and roles.

Scope, stated plainly. The protocol is general-purpose, but it has exactly one live consumer today: ontology-concept elevation in VisionClaw (a case queue capped at five concurrent). Treat "universal human-in-the-loop surface" as the design target, not a claim that many production consumers exist yet — one does. See docs/consumer-surface-map.md and docs/prd/prd-gap-close-forum.md.


Identity & keys

Identity is a did:nostr Multikey DID — the canonical form used across the wider did-nostr ecosystem, so a member's identity is portable to any system that speaks the method.

  • The DID is did:nostr:<x-only-hex>; its document carries a single Multikey verification method whose publicKeyMultibase encodes the BIP-340 x-only key. The identity string and key bytes are invariant — only the document encoding is canonical.
  • The passkey is the root of trust. WebAuthn PRF derives the root Nostr key on-device; it is never stored server-side. Purpose-scoped subkeys derive deterministically via derive_subkey(root, tag) = HMAC-SHA-256, so device and capability keys are rotatable and recoverable from the root alone (ADR-094).
  • Auth reads the raw signature, not the document. NIP-98 (HTTP) and NIP-42 (relay) verify a Schnorr signature against the raw event pubkey, so re-encoding the DID document cannot affect the auth path.
  • The pod + identity layers build on solid-pod-rs 0.5.0-alpha.7 (the JSS Rust port), the canonical encoder of record for the Multikey DID document.

Signup issues a 100%-client-side printable recovery sheet (nsec/npub/relay QRs, restore steps, optional relay sweep) with a mobile on-ramp (ADR-095). Device keys are revocable with NIP-17 multi-device DM delivery (ADR-099/100/101). The first registrant becomes admin — no hardcoded admin keys.


Zones, cohorts & the tiered calendar

A zone is a named group of channels gated by cohort membership; cohorts are string slugs on the relay whitelist, granted via the NIP-98 admin API. Zone visibility controls what non-members can even see:

visibility Listed to non-members Content readable Kind-40 definition served
public Yes Yes (no auth) Yes
locked (default) Yes — greyed tile No Yes (so the tile renders)
hidden No No No

The client renders what the config describes; the relay is the real access boundary, deny-by-default. A public zone with write_cohorts = ["friends"] gives an openly readable landing zone only an inner circle can post to.

The tiered NIP-52 calendar projects every (viewer, event) pair to one of three outcomes — full, free/busy, or omit — server-side. A neighbouring cohort's event at a shared venue is projected down to an anonymous free/busy block (start, end, "busy"), with title, location, participants, and signature stripped. You learn the room is booked without learning whose party it is. The full projection matrix and its 25 unit tests are documented in docs/architecture.md.


Quick start

# Prerequisites
rustup target add wasm32-unknown-unknown
cargo install trunk
npm i -g wrangler

# Build + test the whole workspace
cargo build --workspace
cargo test  --workspace

# Serve the forum client locally
cd crates/nostr-bbs-forum-client && trunk serve

Then stand up a community from the vanilla kit:

cp forum.example.toml forum.toml
$EDITOR forum.toml          # set hostname, zones, cohorts, admin pubkey…

forum.example.toml documents every config section with safe generic defaults. See SETUP.md for full deployment (Cloudflare resources, DNS, client build).

Consuming-repo dual pin. A deployment pins the kit in two places that must move together — KIT_REF in the deploy workflow (the SHA the WASM client + workers build from) and rev = "<sha>" on every nostr-bbs-* git dependency in the overlay's Cargo.toml. Bump both in the same commit or the client and config schema drift apart.


Documentation


Status & remaining work

As of 2026-07-22. Maturity words follow the VisionFlow ADR-002 ladder (historical / planned / scaffolded / standalone / integrated / federation-verified / released). Current release: v1.0.0-beta.6 (2026-07-19). This section names shortfalls rather than hiding them.

Capability Maturity Honest boundary
Passkey-first did:nostr identity, zero password DB integrated WebAuthn PRF → on-device key; no credential store.
Six-kind ACSP signed governance (31400–31405) integrated Live; only an admin key publishes a Decision (31403). One live consumer today: ontology-concept elevation (capped 5 concurrent) — narrower than a universal-HITL claim.
Config-driven zones + tiered NIP-52 calendar released Deny-by-default relay gate; projection encoded in 25 unit tests.
Semantic search (Workers AI bge-small-en-v1.5) released 384-dim L2-normalised, cosine k-NN over an RVF store.
Solid pods (LDP + WAC, edge + native tier) integrated Native git-backed tier gated by [native_pod], disabled by default.
NIP-42 relay AUTH scaffolded Relay currently gates on a pubkey allowlist (auth_required: false); challenge/response machinery exists but is not yet the enforced admission path. Buzz is ahead here — its NIP-42 gate is wired end-to-end.
Cross-relay mesh federation planned nostr-bbs-mesh is scaffold only (MeshTransport trait + session state, no concrete transport) and is not a dependency of the relay-worker. Standalone is the supported deployment mode. Designed, not shipped — on both sides of the Buzz comparison.

Downstream, the dreamlab-ai-website governance dashboard is blocked on this repo shipping the upstream-disclosure badge and the Agents roster tab — tracked as planned, not delivered. The canonical cross-ecosystem work register is VisionClaw's docs/TODO-unified.md.


Upstream, maintainers & licence

Built on did:nostr Multikey identity and Nostr message passing; deploys standalone or embeds as the governance surface of a larger agent platform.

Foundation Project Role
solid-pod-rs solid-pod-rs Cryptographic foundation — JSS Rust port, did:nostr Multikey identity (0.5.0-alpha.7)
JSS JavaScriptSolidServer Upstream Solid server reference and AGPL-3.0 lineage
did-nostr did:nostr Nostr-keyed DID method for cross-system identity

Maintainers and upstream IP attribution: MAINTAINERS.md. Licensed under AGPL-3.0-only, inherited from upstream JSS.

About

Decentralized Nostr forum — all Rust. Leptos WASM client + 5 Cloudflare Workers. Passkey auth, Solid pods, trust system, moderation, badges. 469 tests.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages