# Nektar v0.1 — Complete Agent & Operator Technical Manual (llm.txt) > **One static zero-CGO Go 1.27 binary (`nektar`)** giving AI agents and operators shared Git-versioned **Memories**, offline-verifiable **Receipts** (`nektarr1.*` / `nektarx1.*`), tradable `.nkt` **Capsules**, pay-per-call WebAssembly **Boxes**, and optional bare-origin **Hubs** — anchored on BSV with zero Docker, zero Node.js, and zero external database sidecars. - Website: https://nektar.run/ - Interactive 3-Column Command & MCP Reference: https://nektar.run/docs/ - Zero-Leakage Receipt Verifier: https://nektar.run/verify - Short Index: https://nektar.run/llms.txt - Mirror of this Full Manual: https://nektar.run/llms-full.txt - Source Repository (MIT): https://github.com/kryptokrates/nektar --- ## 1. Core Vocabulary (5 Words + Dock) & Honesty Rule Always use **Memory** (never "shard") in user-facing text. 1. **Memory:** A local, encrypted-by-default, Git-compatible knowledge workspace stored in pure-Go SQLite (`modernc.org/sqlite`, WAL + FTS5 Okapi BM25) with commit DAG objects (`CommitObject`, `TreeObject`, `BlobObject`), branches, tags, line-level diff3 merge, blame, bisect, and optional BSV Merkle anchors (`anchor/`). Watched code repositories live in isolated `code-*` Memories so source code never pollutes default factual recall. 2. **Capsule (`.nkt`):** A portable, content-addressed, offline-verifiable CHIRP snapshot of a Memory (including commit lineage, blobs, signatures, and SPV Merkle proofs) that can be exported as a file, shared via URL/`chirp://`, or traded atomically over connected Hubs. 3. **Box (WASM):** A sealed, deterministic WebAssembly (WASI) blackbox executed inside pure-Go `wazero` with strict versioned JSON Schema and anchored Go-RE2 input/output contracts. Callable pay-per-call over zero-hardware HTTP 402 (`hosted` default) or hardware-encrypted AMD SEV-SNP RAM enclaves (`tee-only` / `both`). Invalid inputs reject pre-pay with HTTP 400 at `0 sats`. 4. **Hub:** A lightweight LightBSV bare-origin discovery and NAT-relay server (`overlay.nektar.run`, `overlay2.nektar.run`, `testnet.nektar.run`, or self-hosted via `nektar hub up`). Hubs route signed `OfferAd`, `StandingOrder`, and encrypted delivery envelopes; they never hold your private Memories or wallet keys. 5. **Receipt:** Cryptographic proof of origin, integrity, and Bitcoin anchoring (`0.041 ms` offline SPV verification): - **Memory Receipt (`nektarr1.`):** Verifies that every cited factual claim in an AI answer came unaltered from anchored or recorded Memory fragments via quote matching + Google Mangle stratified Datalog derivation. - **Box Receipt (`nektarx1.`):** Verifies deterministic WASM Box execution against pinned module commit hash, input SHA-256, output SHA-256, execution mode (`hosted` or SEV-SNP measurement), and BSV payment txid. 6. **Dock:** Non-clobbering 1-command wiring (`nektar dock`) connecting Nektar into 16 AI apps (MCP stdio/HTTP, OpenClaw native plugin, and transparent L0 OpenAI/Anthropic proxy) with full reversibility (`--uninstall`). ### Mandatory Honesty Rule (Never Violate) > **Proofs establish `recorded + unaltered + derivable` — NEVER that a memory's content is objectively true in the real world.** > > - Model identity (`ModelID`) is **self-declared**, not zkML-proven. > - Never omit `TruthNote` when reporting verification results. > - Never fabricate, guess, or emit a `receipt: nektarr1.*` footer when `groundedAnswer` did not return a real signed token. If no verified receipt comes back, explicitly state the answer is **ungrounded**. --- ## 2. User Roles & Agent Decision Tree Before running commands, determine which role matches the user's goal so you never overwhelm an AI user with infrastructure steps: ### Role A: AI Agent User ("I just want my AI tools to share provable memory") - **Needs:** `nektar up`, `nektar dock`, `nektar open` (switch UI focus to `AI user`), MCP tools (`recall`, `remember`, `groundedAnswer`, `verifyReceipt`, `ingest`, `watchWorkspace`, `memory`). - **Does NOT need:** Hub hosting (`nektar hub up`), `bstore-provider`, `payee`, `bweb`, `vault`, `bond`, or manual UTXO management. - **Default network:** Free Testnet (`nektar up` auto-claims test sats, auto-docks installed AI apps, and verifies a live receipt in ~25 seconds). ### Role B: Node & Market Operator ("I want to operate a node, sell Capsules/Boxes, and earn/spend sats") - **Needs:** Everything in Role A + Mainnet setup (`nektar up --mainnet --confirm I_UNDERSTAND`), wallet custody (`embedded` SQLite or BSV Desktop `:3321`), spending policies (`nektar policy`), `nektar sell` / `nektar buy` / `nektar box publish` / `nektar box call`, `nektar backup`, `nektar service install`, `nektar open` (`Operator` focus). - **Still does NOT need to host a Hub:** Nodes automatically connect to public Hubs (`https://overlay.nektar.run`, `https://overlay2.nektar.run` on Mainnet; `https://testnet.nektar.run` on Testnet). ### Role C: Optional Infrastructure Host ("I want to run a public/private Hub, storage provider, or verifiable bweb site") - **Needs:** `nektar hub up --domain `, `OVERLAY_GASP_PEERS`, `nektar bstore-provider`, `nektar payee`, `nektar publish`, `nektar bweb`, `nektar domain-docs`. - **Important:** Never deploy a Hub unless the user explicitly asks to host relay/overlay infrastructure. --- ## 3. Zero-Config Install, Onboarding & Key Custody ### 3.1 One-Line Install & Start (Testnet — 25 Seconds) ```sh # macOS / Linux curl -fsSL https://nektar.run/install.sh | sh -s -- --up # Windows (PowerShell) & ([scriptblock]::Create((irm https://nektar.run/install.ps1))) -Up ``` Headless / AI-agent friendly onboarding (starts detached daemon on `127.0.0.1:18420`, claims free Testnet sats, arms bounded starter buyer+seller policy, auto-docks installed AI apps, verifies a live `nektarr1.*` receipt, prints structured JSON): ```sh nektar up --no-open --json ``` ### 3.2 One-Line Install & Start (BSV Mainnet) Mainnet always requires explicit acknowledgement (`--confirm I_UNDERSTAND` or `NEKTAR_MAINNET_CONFIRM=I_UNDERSTAND`) and stores state in an isolated directory (`~/.nektar/main`): ```sh # macOS / Linux curl -fsSL https://nektar.run/install.sh | sh -s -- --up --mainnet --confirm I_UNDERSTAND # Windows (PowerShell) & ([scriptblock]::Create((irm https://nektar.run/install.ps1))) -Up -Mainnet -Confirm I_UNDERSTAND # Already installed binary: nektar up --mainnet --confirm I_UNDERSTAND --no-open --json ``` On Mainnet startup: - Zero-risk **seller mode** arms immediately so the node can earn sats right away. - Bounded **buying** unlocks once funded via QR (`nektar wallet address --network main --qr`, 100–10,000 sats is fractions of a cent) or automatically via **BSV Desktop** on `127.0.0.1:3321`. - Verify live Mainnet readiness (dual-witness PoW headers, broadcaster, SpendGuard, ZK SRS) before funding: ```sh NEKTAR_NETWORK=main NEKTAR_MAINNET_CONFIRM=I_UNDERSTAND \ NEKTAR_HEADERS_SOURCE="arcade:https://arcade-eu-1.bsvblockchain.tech,arcade:https://arcade-v2-us-1.bsvblockchain.tech,woc:main" \ NEKTAR_SETTLE_SPEC="broadcaster:main" \ nektar check-mainnet -live ``` ### 3.3 Key Custody Modes (`NEKTAR_WALLET` / `--wallet`) - **`embedded` (default when `127.0.0.1:3321` is closed):** Pure-LightBSV SQLite wallet engine (`internal/wallet`, backed by `/wallet/wallet.sqlite`, BRC-43/BRC-29 derivation, ARC/BEEF broadcast reconciliation). Raw private keys never leave `internal/wallet`. - **`client` (auto-selected when BSV Desktop / Metanet Desktop is open on `127.0.0.1:3321`):** Uses `lightwebinc/bcommon/wirewallet` over loopback with zero spending private keys stored inside Nektar, still guarded by `SpendGuard`. Refused on `memory` and `regtest`. Force explicitly with `nektar up --wallet client`. --- ## 4. Docking 16 AI Apps, L0 LLM Proxy & Native Hooks ### 4.1 Non-Clobbering Docking (`nektar dock`) Merges a `nektar` MCP server entry cleanly into existing client configuration files without overwriting other servers. Always reversible with `--uninstall` and inspectable beforehand with `--dry`. Supported `--client` identifiers: - `auto` (detect and wire all installed apps) - `claude` (Claude Code) - `claude-desktop` (Claude Desktop — supports inline SEP-1865 MCP App provenance UI) - `antigravity` (Google Antigravity — supports inline SEP-1865 MCP App provenance UI) - `cursor` (Cursor) - `windsurf` (Windsurf) - `vscode` (VS Code — Streamable HTTP MCP + SEP-1865) - `zed` (Zed) - `cline` (Cline) - `continue` (Continue) - `opencode` (OpenCode) - `codex` (OpenAI Codex CLI) - `gemini` (Gemini CLI) - `hermes` (Hermes Agent) - `goose` (Goose — SEP-1865) - `openclaw` (OpenClaw native Memory Slot Plugin) - `openai` / `proxy` (L0 transparent OpenAI & Anthropic SDK proxy) ```sh nektar dock --client auto --dry # Preview config diffs first nektar dock --client auto # Apply non-clobbering wiring + run live probe nektar dock --client claude --uninstall ``` ### 4.2 Zero-Code L0 OpenAI & Anthropic Memory Proxy Running `nektar dock openai` writes `~/.nektar/openai.env` and `~/.nektar/openai-mcp.json`: ```sh export OPENAI_BASE_URL="http://127.0.0.1:18420/v1/proxy/openai/v1" export ANTHROPIC_BASE_URL="http://127.0.0.1:18420/v1/proxy/anthropic" ``` Proxy headers & features: - Every prompt automatically recalls authorized local Memories and injects grounded context. - Raw turn capture is **OFF by default**; send `X-Nektar-Capture: 1` to opt in. - Isolate a specific Memory with `X-Nektar-Shard: `. - When daemon auth is enabled, pass `X-Nektar-Token: `. - Supports `bsecret://` Vault KV v2 secret substitution so raw API keys stay sealed in local `bsecret` storage instead of plaintext prompts. ### 4.3 Native Agent Hooks (`nektar hook`) ```sh nektar hook session-start # Inject high-signal Memory context at session start nektar hook prefetch # Prefetch relevant Memories per user prompt nektar hook verify-receipt [--codex] # Verify emitted nektarr1.* tokens in agent output nektar hook outcome --exit-code 0 --deal-id --note "tests passed" # Record objective deal outcome ``` --- ## 5. Mandatory Factual Grounding & Receipt Loop Whenever an AI agent answers a factual question that may come from stored Memories: 1. **Recall first:** Call MCP `recall` (omit `memory`/`shard` to search across all readable Memories including `welcome`; pass `atCommit: "anchor/"` or a tag/commit hash for time-travel recall). Note: watched codebases in `code-*` are excluded from default factual recall unless explicitly targeted. 2. **Ground every claim:** Call MCP `groundedAnswer` passing structured claims with exact `cites: [{shard, seq}]` and/or `quotes: [{quote, shard, seq}]` (or ground-atom Mangle derivations). The tool deterministically strips any claim that cannot be grounded and mints a signed `nektarr1.` Memory Receipt. 3. **Emit the exact receipt footer:** Always end grounded answers with: ``` receipt: nektarr1. verify: ``` 4. **If ungrounded:** If `groundedAnswer` returns `ungrounded: true` or no `receiptToken`, clearly tell the user the answer is ungrounded and emit NO receipt footer. ### Receipt Verification & Inline Provenance Surfaces - **CLI offline verification:** `nektar verify -token "nektarr1."` (or `nektarx1.` for Box Receipts, or `-bundle ./audit.json -offline-structural`). - **Zero-leakage Browser Verifier:** `https://nektar.run/verify#nektarr1.` (fragment `#` keeps token out of HTTP path logs & Referer headers; local node also serves `http://127.0.0.1:18420/verify`). - **HTML / JSON API:** `GET /v1/verify/{token}` or `POST /v1/verify` (`{"token":"..."}`). - **SEP-1865 MCP App (`ui://nektar/provenance.html`):** Renders dotted-underline word provenance, "Dim AI phrasing" X-Ray, and visual fragment history inline inside Antigravity, Claude Desktop, VS Code, and Goose. - **One-line Web Provenance Embed:** Drop `` on any webpage to turn `/v1/verify/nektarr1.*` links into hoverable provenance cards + Shadow-DOM drawer. --- ## 6. Complete CLI Command Reference (All 51 Commands) All commands are subcommands of the single `nektar` binary (`cmd/nektar`). ### 6.1 Start & AI Docking | Command | Usage & Key Flags | Purpose & Example | |---|---|---| | `up` (alias `start`) | `nektar up [--network testnet\|main\|memory] [--mainnet] [--confirm I_UNDERSTAND] [--wallet auto\|client\|embedded] [--wallet-wire-url URL] [--listen 127.0.0.1:18420] [--data-dir DIR] [--hub] [--dock auto] [--no-dock] [--no-open] [--install-service] [--json]` | Start detached daemon, auto-fund Testnet / arm policy, auto-dock AI apps, verify first receipt.
`nektar up --no-open --json` | | `stop` | `nektar stop [--data-dir DIR] [--network NET] [--uninstall-service]` | Gracefully stop background daemon and optionally uninstall OS login service.
`nektar stop` | | `serve` | `nektar serve [--listen 127.0.0.1:18420] [--network NET] [--confirm I_UNDERSTAND] [--wallet MODE] [--data-dir DIR] [--ephemeral] [--public-url URL] [--hosts CSV] [--hub] [--hub-listen 127.0.0.1:18421]` | Run foreground daemon (Cockpit UI, `/mcp`, `/a2a`, L0 proxy, market sagas, optional embedded Hub).
`nektar serve --listen 127.0.0.1:18420 --hosts https://overlay.nektar.run` | | `open` | `nektar open [--start] [--network NET] [--data-dir DIR]` | Open the paired Live Nektar Core cockpit in the default browser.
`nektar open --start` | | `dock` | `nektar dock [client] [--client auto\|claude\|cursor\|openai\|...] [--dry] [--uninstall] [--url URL] [--token TOK] [--shard M] [--json]` | Wire installed AI apps non-destructively into Nektar + run live memory probe.
`nektar dock --client auto --dry` | | `mcp` | `nektar mcp [--network NET] [--data-dir DIR] [--direct]` | Run stdio MCP server, auto-bridging to (and auto-starting) the shared local daemon unless `--direct`.
`nektar mcp` | | `hook` | `nektar hook [--codex] [--verbose] [--exit-code N] [--deal-id ID] [--note STR]` | Native Claude Code & Codex lifecycle hooks.
`nektar hook outcome --exit-code 0 --note "tests passed"` | | `status` | `nektar status [--data-dir DIR] [--network NET] [--json]` | Print node pubkey, network, balance, Memories, policy hash, SpendGuard state.
`nektar status --json` | | `doctor` | `nektar doctor [--data-dir DIR] [--network NET] [--json]` | Full diagnostic check (memory, wallet, policies, Hubs, peers, SSE) with exact next steps.
`nektar doctor --json` | | `version` | `nektar version` (also `-v`, `--version`) | Print version and embedded pure-Go subsystem summary.
`nektar version` | ### 6.2 Memories & Git History | Command | Usage & Key Flags | Purpose & Example | |---|---|---| | `memories` (alias `ls`) | `nektar memories [-json] [-network NET] [-data-dir DIR]` | List all Memories with branches, commit/file counts, active HEAD, and BSV `anchor/` tags.
`nektar memories -json` | | `switch` | `nektar switch [branch] [-c]` | Switch active default HEAD Memory and branch (`-c` creates branch).
`nektar switch ops working/s1 -c` | | `commit` (alias `remember`) | `nektar commit [memory] [-memory M] [-branch B] [-m MSG] [-text TXT] [-file PATH] [-path TREEPATH] [-group G] [-public] [-ontology ID] [-ontology-strict] [-freshness CLASS] [-valid-until TS] [-subject-version V] [-rights R] [-anchor]` | Commit signed text fragment or file blob (private-by-default unless `-public`).
`nektar commit ops -m "API port" -text "Prod API listens on :8443" -anchor` | | `recall` | `nektar recall [query...] [-memory M] [-branch B] [-at REF] [-query Q] [-spv=true]` | Recall authorized decrypted facts with offline SPV checks and time-travel (`-at anchor/0`).
`nektar recall -memory ops -at anchor/0 -query "API port" -spv` | | `log` | `nektar log [memory] [-branch B] [-n 25] [-json]` | Show signed commit history, MPE roots, and BSV anchor UTXOs.
`nektar log ops -n 15` | | `show` | `nektar show [memory] [ref] [-json]` | Show commit metadata, BSV anchor note, and unified diff.
`nektar show ops anchor/0` | | `diff` | `nektar diff [memory] [from..to] [-from A] [-to B] [-json]` | Show unified diff between two refs or anchors.
`nektar diff ops anchor/0..HEAD` | | `blame` | `nektar blame [memory] ` | Line-by-line provenance blame with AuthorPub, declared ModelID, and `anchor/`.
`nektar blame ops runbook.md` | | `tree` | `nektar tree [memory] [-at ref]` | List encrypted and public entries in a Memory tree.
`nektar tree ops -at anchor/0` | | `branch` | `nektar branch [memory] [new-branch] [-from ref]` | List or create Memory branches.
`nektar branch ops experiment -from anchor/0` | | `merge` | `nektar merge [memory] ` | 3-way merge preserving encrypted blobs and lineage.
`nektar merge ops experiment` | | `tag` | `nektar tag [memory] [tag] [-at ref]` | List or create signed immutable checkpoint tags.
`nektar tag ops release-q3` | | `revert` | `nektar revert [memory] ` | Append non-destructive inverse commit.
`nektar revert ops HEAD~1` | | `cherry-pick` | `nektar cherry-pick [memory] ` | Apply a commit across branches via 3-way merge.
`nektar cherry-pick ops 9f3a1c2` | | `bisect` | `nektar bisect -query "..."` | O(log N) binary search pinpointing when a claim entered history.
`nektar bisect -query "port 8443"` | | `rm` | `nektar rm [memory] ` | Non-destructively remove path from HEAD tree.
`nektar rm ops old-notes.md` | | `forget` | `nektar forget [memory] -seq ` | Crypto-shred historical keys and write tombstone while keeping Merkle commitment.
`nektar forget ops -seq 3` | | `checkout` | `nektar checkout [memory] [-dir ./out]` | Materialize a Memory as a standard `.git` workspace on disk.
`nektar checkout ops -dir ./ops-git` | | `anchor` | `nektar anchor [memory] \| rotate -memory M -new-owner ` | Anchor unanchored commits onto BSV (`anchor/`) or rotate shard ownership.
`nektar anchor ops` | | `verify` | `nektar verify [token\|file.nkt\|memory] [-token T] [-bundle FILE] [-export-bundle FILE] [-policy-dag-root HEX] [-offline-structural]` | Verify `nektarr1.*` / `nektarx1.*` / `nektardr1.*` receipt, §16 AuditBundle, `.nkt` Capsule, or local chain.
`nektar verify -bundle ./audit.json -offline-structural` | | `ingest` | `nektar ingest [-memory M] [-branch main] [--dry-run] [-scrub] [-anchor] [-sell] [-domains ops] [-price 50] [-export FILE] [-public] [-ontology ID] [-max-files N] [-max-mb N] [-json]` | Structural ~400-word chunking & ingestion with fail-closed secret blocking and optional 1-call sell.
`nektar ingest ./docs -memory team-docs --dry-run` | | `watch` | `nektar watch [path] [-list] [-json]` | Tree-sitter AST index & live-watch local Git codebase into private `code-*` Memory.
`nektar watch . -json` | | `unwatch` | `nektar unwatch [path]` | Stop watching a local Git codebase.
`nektar unwatch .` | | `ontology` | `nektar ontology ` (`-file`, `-text`, `-shard`, `-strict`, `-status`, `-accept`, `-reject`, `-anchor`) | Manage TBox ontologies, Bridge Shards, JevGraph ABox triple extraction, and Mangle edge review.
`nektar ontology extract ont-ops -text "API depends on Redis" -shard ops` | | `distill` | `nektar distill [-shards CSV] [-max-batch 32] [-anchor=true] [-list]` | Run idle PII-scrubbing distillation pass on working shards.
`nektar distill -shards working/s1 -list` | ### 6.3 Capsules & Pay-Per-Call WASM Boxes | Command | Usage & Key Flags | Purpose & Example | |---|---|---| | `export` | `nektar export [memory] [-since anchor/0] [-out file.nkt]` | Export self-verifying `.nkt` CHIRP Capsule (full or delta since anchor).
`nektar export -memory ops -out ./ops.nkt` | | `import` | `nektar import [-memory M] [-branch B] [-strategy auto\|ours\|theirs\|quarantine] [-from handle@domain] [-join-hub]` | Offline SPV + Rúnar verify and 3-way merge `.nkt` from local file, `https://`, or `chirp://`.
`nektar import ./ops.nkt -memory ops -strategy auto` | | `buy` | `nektar buy [question...] [-domains ops] [-question Q] [-max 100] [-min-grade S\|A\|B\|C] [-memory M] [-no-bounty] [-bounty-ttl 86400] [-zk] [-zk-onchain] [-zk-min-units N]` | 1-call Capsule purchase across active Hubs (auto-posts 0%-CPU `StandingOrder` bounty on 0 hits).
`nektar buy -domains ops -question "SQLite lock timeout tuning" -max 100` | | `sell` | `nektar sell [-text TXT] [-file FILE] [-memory M] [-domains ops] [-price 50] [-per-unit] [-query-price N] [-sub-price N] [-sub-days 30] [-export f.nkt] [-freshness F] [-rights R] [-ontology ID] [-dynamic -floor N -ceiling N] [-bounty ID] [-hub URL]` | Fail-closed PII/secret scrub, commit, anchor, broadcast `OfferAd` (spot / `per_query` 402 / SSE subscription), optional `.nkt` export.
`nektar sell -memory ops -domains ops -price 50 -text "SQLite busy_timeout=5000ms prevents lock errors" -export ./sqlite.nkt` | | `want` | `nektar want [-domains ops] [-question Q] [-ontology ID] [-max 200] [-min-grade A] [-max-sats-per-1k N] [-freshness F] [-rights R] [-mode spot\|per_query\|subscription] [-zk] [-zk-onchain] [-zk-min-units N]` | Low-level NMU-1 procurement query over AtomicBEEF + BRC-369 keyed disclosure.
`nektar want -domains ops -question "K8s OOM runbook" -max 200 -min-grade A -zk` | | `box` (alias `skill`) | `nektar box publish (--demo \| --wasm F) --name N --price 25 [--version 1.0.0] [--input-schema F] [--output-schema F] [--input-regex R] [--output-regex R] [--mode hosted\|tee-only\|both] [--allow-measurement 96HEX] [--domains skills]`
`nektar box call --url URL --input JSON [--max-sats 100] [--version V] [--commit HASH]`
`nektar box pack \| list \| run` | Publish deterministic WASM Boxes (zero-hardware HTTP 402 default or AMD SEV-SNP), invoke with pre-pay schema check (0 sats on HTTP 400), pack into `.nkt`, list, or run locally.
`nektar box publish --demo --name my-box --price 25` | | `ticker` | `nektar ticker [-domain D] [-ontology ID] [-grade S\|A\|B\|C] [-mode spot\|per_query\|subscription] [-json]` | Display standardized NMU-1 commodity price ticker (sats/1k units, ask floors, bonded sellers).
`nektar ticker -domain ops -json` | ### 6.4 Wallet, Limits, Security & ZK | Command | Usage & Key Flags | Purpose & Example | |---|---|---| | `wallet` | `nektar wallet status \| address [--qr] \| utxos [--basket all --limit 100] \| actions [--limit 20] \| sync \| fund [--from-desktop --sats 25000 --wire-url URL] \| import [--beef HEX\|@FILE --txid ID] \| send --to ADDR\|PUB --sats N [--confirm I_UNDERSTAND] \| sweep (--to ADDR \| --to-desktop) [--confirm I_UNDERSTAND] \| consolidate [--below 10000 --max 100] \| fuel [--target 24 --sats 2000]` | Full embedded BRC-100 SQLite wallet or BSV Desktop bridge management.
`nektar wallet address --qr` | | `policy` | `nektar policy approve [--preset buyer\|seller\|both] [--domains CSV] [--confirm I_UNDERSTAND] [--ai-mode MODE] [--ai-privacy MODE] [--ai-hosts CSV] [--ai-intent TXT] [--ai-prohibit TXT] [--ai-cedar-file F] \| list \| revoke ` | Approve, inspect, or revoke operator spending policies and Jev AI-matching guardrails.
`nektar policy approve --preset both --domains ops,bsv` | | `vault` | `nektar vault deploy -operator-pub HEX [-deposit 10000 -per-tx-cap 2000 -window-cap 10000 -window-blocks 144 -max-fee 600] \| status \| pause \| resume \| rotate-agent -new-agent PUB \| sweep -to ADDR` | Deploy and cold-key-control an on-chain Rúnar `NektarAgentVault` spend-cap covenant.
`nektar vault status` | | `bond` | `nektar bond open [-deposit 10000 -epoch-len 144 -release-blocks 432] \| commit -root-hex HEX \| status \| seize -beef-hex HEX -vout 0 -to ADDR \| close` | Manage slashable on-chain SLA checkpoint bonds (`NektarCheckpointBond`).
`nektar bond status` | | `backup` | `nektar backup now [--out DIR --keep 14] \| verify --file ARCHIVE \| restore --file ARCHIVE [--confirm I_UNDERSTAND] \| status` | Stream O(1 MiB) chunked WAL-safe AES-256-GCM + BRC-42 `.nktbak` encrypted backups.
`nektar backup now --out ./backups --keep 14` | | `service` | `nektar service [--name nektar] [--network NET] [--confirm I_UNDERSTAND] [--listen ADDR] [--hosts CSV] [--hub] [--system]` | Cross-platform native OS service supervision (`systemd`, `launchd`, Windows Service).
`nektar service install --network testnet` | | `check-mainnet` | `nektar check-mainnet [-live] [-timeout 15s]` | Verify Mainnet confirmation, >=2 independent PoW header witnesses, settlement spec, SpendGuard, ZK SRS.
`nektar check-mainnet -live` | | `zk` | `nektar zk status [-json] \| init [-circuits compact,volumetric,membership,derivation] \| import-ptau -in FILE -sha256 HEX \| export-vk -out FILE \| prove -shard S -seq N -level 1 \| verify -commit 64HEX \| ceremony ` | Pure-Go `consensys/gnark` BN254 + Poseidon2 Universal KZG SRS, PLONK proofs, and Groth16 Phase-2 MPC ceremony.
`nektar zk status -json` | ### 6.5 Hubs & Infrastructure (Optional — Infrastructure Hosts Only) *Regular AI users and node operators do NOT need these commands.* | Command | Usage & Key Flags | Purpose & Example | |---|---|---| | `hub` | `nektar hub list\|ls \| join \| leave \| up --domain FQDN [--port 18421 --gasp-peers CSV --prices SPEC --bdns-zone HEX --bweb-site HEX --mainnet --confirm I_UNDERSTAND --native --docker --dry] \| status \| logs \| down \| template \| run [--listen :18421 --network testnet --gasp-peers CSV --transport plane\|lan-relay\|unicast]` | Join discovery Hubs or deploy a native zero-Docker bare-origin LightBSV Overlay Hub with WAN SSE push, BRC-88 GASP sync, and automatic TLS.
`nektar hub up --domain overlay.example.com` | | `peers` | `nektar peers [join\|leave ] [-json]` | List connected Hubs, verified peers, and LightBSV handles, or join/leave Hubs.
`nektar peers join https://overlay.nektar.run` | | `bstore-provider` | `nektar bstore-provider init -data DIR \| run -config provider.json` | Initialize and operate a LightBSV BRC-178 `bstore` + BRC-167 `chirp` content-addressed storage provider.
`nektar bstore-provider init -data ./bstore-data` | | `payee` | `nektar payee key -out FILE\|- [-app nektar] \| settle ... [-in-flight 8]` | Export `_PAYEE_KEY` for `termsroute` paywalls and batch-settle BEEF ledgers.
`nektar payee settle ./payments.jsonl -in-flight 8` | | `publish` | `nektar publish [memory] [-memory M] [-dir DIR] [-branch B] [-commit C] -host FQDN [-index index.html] [--no-wait] [-json]` | Publish a Memory tree or directory onto a verifiable LightBSV `bweb` site backed by `bstore`.
`nektar publish -memory docs -host docs.example.com --no-wait` | | `bweb` | `nektar bweb terms -site HEX -sats N -term 24h \| advertise -site HEX -url URL -location FRA -country DE \| race -site HEX \| check -site HEX -addr IP -port 443 \| advertised -site HEX` | Manage `bweb` hosting escrow terms, edge ads, hosting races, and loopback site verification.
`nektar bweb check -site <64-hex> -addr 203.0.113.10 -port 443` | | `domain-docs` | `nektar domain-docs -domain FQDN -handle NAME [-network testnet] [-hub-url URL] [-json]` | Generate BRC-180 `/manifest.json`, BRC-169 handle-resolver JSON, and DNS instructions.
`nektar domain-docs -domain agents.example.com -handle alice` | --- ## 7. Complete MCP Tools Reference (All 40 Tools) Available over stdio (`nektar mcp`) and Streamable HTTP (`POST http://127.0.0.1:18420/mcp`), plus REST shortcut `POST /v1/tools/{name}`. ### 7.1 Agent Profile (27 Tools — Enabled by Default) 1. `remember` — Commit or update a provenance-signed fragment/file in a Memory (`shard`/`memory`, `text`, `autoAnchor`, `path`, `branch`). 2. `recall` — Retrieve Cedar-authorized, Borg-decrypted fragments via FTS5 BM25 + Mangle + Knowledge DAG (`query`, optional `shard`/`memory`, `branch`, `atCommit`, `limit`). 3. `memory` — Full Git-compatible Memory operations (`action`: `list|log|show|tree|read|diff|blame|verify|commit|rm|branch|fork|merge|cherryPick|revert|tag|bisect|export|import|prove|rotate`). 4. `groundedAnswer` — Verify claims against cited fragments (`claims`: `[{text, cites, quotes}]`, `mode`), strip hallucinations, and mint a signed `nektarr1.*` Memory Receipt + `verifyUrl` + `footer`. 5. `verifyReceipt` — Verify a `nektarr1.*` or `nektarx1.*` receipt token, §16 delegations, `ZKAttestation`, and SPV anchor status. 6. `forget` — Crypto-shred a fragment's historical keys while preserving its on-chain Merkle commitment. 7. `ingest` — Ingest local files, note vaults, folders, `extractedDocs`, or HTTPS URLs with ~400-word structural chunking, `--dry-run` preview, fail-closed secret blocking, `pendingRichFiles` handoff, and optional 1-call sell. 8. `watchWorkspace` — Index and live-watch a local Git repo with Tree-sitter into a private `code-*` Memory (`dir`, `unwatch`). 9. `pinMemoryToSymbol` — Bind a Memory fragment `(shard, seq)` to a repository AST symbol hash to detect codebase drift. 10. `buyCapsule` — 1-call Capsule purchase across connected Hubs (`question`, `domains`, `maxSats`); automatically posts a bounded 0%-CPU `StandingOrder` bounty if 0 offers match. 11. `sellCapsule` — 1-call fail-closed PII/secret scrub, commit, anchor, signed `OfferAd` broadcast, and optional `.nkt` export (`text`, `repo`, `domains`, `priceSats`, `exportPath`, `bountyId`). 12. `importCapsule` — 1-call offline SPV + Rúnar verified import and 3-way merge of a `.nkt` Capsule from local file, `https://`, or `chirp://`. 13. `listBoxes` — List verified local WebAssembly Boxes stored in Memories. 14. `runBox` — Execute a local verified WASM Box inside `wazero` under live Cedar policy and return output + signed `nektarx1.*` Box Receipt. 15. `publishBox` — Seal and publish a pay-per-call WASM Box (`hosted` HTTP 402 default, `tee-only` AMD SEV-SNP, or `both`) with JSON Schema / Go-RE2 contracts. 16. `callBox` — Invoke a pay-per-call WASM Box, validate schema pre-pay (0 sats on invalid input), auto-select SEV-SNP or HTTP 402, and verify the signed `nektarx1.*` Box Receipt. 17. `want` — Low-level NMU-1 market buy query over BSV AtomicBEEF + BRC-369 keyed disclosure. 18. `watchKnowledge` — Create, list, live-steer, or cancel durable 0%-CPU `StandingOrder` satoshi bounties. 19. `sell` — Arm a Memory for NMU-1 autonomous selling (`spot`, `per_query` 402, `subscription` SSE) or submit to an open Hub bounty. 20. `marketContract` — Query the NMU-1 Commodity Ticker or list/revoke active shard feed subscriptions (`ticker|subscriptions|revokeSubscription`). 21. `deals` — Inspect persisted market deals, pending operator approvals, 6D EigenTrust reputation, and network liquidity. 22. `ontology` — Manage domain TBox ontologies, Bridge Shards, JevGraph extraction, and Mangle-gated edge review (`init|list|show|validate|extract|edges|review|align`). 23. `lineage` — Inspect the cryptographic Knowledge DAG (ancestors, descendants, signed edges, modality) for a fragment. 24. `proveZK` — Generate a pure-Go BN254 PLONK membership + clearance proof against an anchored batch `ZKRoot` (`membership_clearance|status`). 25. `fund` — Inspect wallet address, balance, UTXOs, SpendGuard caps, and optionally request Testnet faucet sats. 26. `peers` — Discover verified peers, `bfinger` handles, BRC-180 Hubs, CHIRP capsules, and open bounties (`joinHub`). 27. `doctor` — Run full self-diagnosis across storage, wallet, policies, Hubs, peers, and SSE with exact next steps. ### 7.2 Operator Profile Additions (13 Additional Tools When Profile != `agent`) 28. `anchor` — Anchor unanchored fragments in a Memory onto BSV via `NektarAnchor`. 29. `prove` — Build and offline-verify a self-contained SPV `ProofBundle` for `(shard, seq)`. 30. `compactProve` — Build and SPV-verify an O(log N) MMR `CompactProofBundle` against the head `NektarAnchor` UTXO. 31. `consistencyProof` — Build an O(log N) MMR append-only consistency proof between anchor batches `fromN` and `toN`. 32. `exportPack` — Export a Memory Repo as a self-verifying `.nkt` CHIRP Capsule closure. 33. `importPack` — Import and verify a local or remote `.nkt` Capsule into a local Memory Repo. 34. `authorize` — Evaluate the active native AWS Cedar policy set for a principal, action, and resource. 35. `borgGroup` — Create and manage Borg access groups and BRC-369 epoch key rotation (`create|add|revoke|get`). 36. `provisionClearance` — Provision a downward-only CLKA clearance bundle for a Memory. 37. `rotateLattice` — Rotate a Memory's CLKA encryption epoch for forward secrecy. 38. `commitOntology` — Compile and commit DL-Lite / OWL 2 RL / deontic axioms into `__ontology__`. 39. `publishSite` — Publish a Memory tree or static directory as a verifiable LightBSV `bweb` site backed by `bstore`. 40. `status` — Return full node status: identity, network, balance, repos, SpendGuard, policy hash, and deals. --- ## 8. Local Daemon HTTP, REST, SSE & A2A API (`127.0.0.1:18420`) ### Authentication & Pairing - By default on loopback, read/agent endpoints work seamlessly; when `NEKTAR_HTTP_TOKEN` or `NEKTAR_OPERATOR_TOKEN` is set, pass `Authorization: Bearer ` (or `X-Nektar-Token: ` on proxy routes) or establish a cookie session via `POST /v1/auth/session` (`{"token":"..."}`) / 1-click pairing `GET /pair?code=...`. - Browser origin guard enforces same-origin protection against DNS-rebinding and CSRF. ### Key Endpoints - **Discovery & Protocols:** - `GET /v1/health` — Liveness, version, active network - `GET /v1/status` — Full node status JSON - `GET /state` — Full Cockpit UI state snapshot - `GET /events` — Server-Sent Events (SSE) push stream (`remember`, `anchor`, `deal_settled`, `box_published`, `dock_updated`, `hub_joined`, `kill_switch`, etc.) - `POST /mcp` — Official Streamable HTTP MCP endpoint - `GET /.well-known/agent.json` & `POST /a2a` — Agent-to-Agent (A2A) Agent Card & JSON-RPC - `GET /.well-known/nektar` — Node capability & Hub discovery metadata - `GET /v1/tools` & `POST /v1/tools/{name}` — Direct JSON invocation of any registered MCP tool - **Memories, Repos & Verification:** - `POST /v1/remember`, `POST /v1/recall`, `POST /v1/answer` - `GET /v1/repos/{repo}`, `GET /v1/repos/{repo}/tree`, `GET /v1/repos/{repo}/diff`, `PUT /v1/repos/{repo}/file`, `GET /v1/repos/{repo}/capsule`, `POST /v1/repos/inspect-capsule`, `POST /v1/repos/import` - `GET /verify` — Zero-leakage `#nektarr1.*` / `#nektarx1.*` fragment portal - `GET|POST /v1/verify`, `GET /v1/verify/{token}` — JSON or HTML Receipt X-Ray verifier - `GET /v1/embed/provenance.js` — Drop-in Shadow-DOM provenance widget script - `GET /v1/lineage/{shard}/{seq}`, `GET /v1/prove/compact/{shard}/{seq}`, `GET /v1/prove/consistency/{shard}`, `GET /v1/zkproof/{commit}` - **WASM Boxes:** - `GET /v1/boxes/catalog`, `POST /v1/boxes/invoke` - **Market, Policies & Autonomy:** - `POST /v1/market/purchase`, `POST /v1/market/direct-quote`, `POST /v1/market/query`, `POST /v1/market/subscriptions`, `GET /v1/market/feeds/{shard}`, `GET /v1/market/ticker`, `POST /v1/market/claim-preview` - `PATCH|DELETE /v1/market/listings/{shard}` - `GET|POST /v1/market/standing`, `POST /v1/market/standing/{id}/steer`, `DELETE /v1/market/standing/{id}` - `GET /v1/policies`, `POST /v1/onboard/policy-preset`, `DELETE /v1/policies/{id}` - `POST /v1/automation/kill` (`{"enabled": true|false}`), `POST /v1/automation/approvals/{id}` (`{"approve": true|false}`) - `GET /v1/autonomy/status`, `POST /v1/autonomy/backup`, `POST /v1/autonomy/reset` - **Wallet & Docking:** - `GET /v1/wallet/actions`, `GET /v1/wallet/qr?mode=uri|raw&format=json`, `POST /v1/wallet/sync`, `POST /v1/wallet/fund-desktop`, `POST /v1/wallet/send`, `POST /v1/wallet/sweep`, `POST /v1/onboard/faucet` - `GET /v1/dock/detect`, `POST /v1/dock/apply`, `POST /v1/dock/probe` - **Hubs, Proxy & Metrics:** - `GET /v1/hubs/directory`, `POST /v1/hosts`, `DELETE /v1/hosts?url=...` - `POST /v1/proxy/openai/v1/...`, `POST /v1/proxy/anthropic/...` - `GET /v1/metrics` — Authenticated Prometheus metrics --- ## 9. Pay-Per-Call WASM Boxes (`nektarx1.*`) Wrap deterministic logic (pricing engines, medical/compliance rule checks, parsers, financial models, proprietary algorithms) as sealed WebAssembly modules callable per request with zero LLM hallucinations: 1. **Zero-Hardware Default (`--mode hosted`):** Runs deterministically inside embedded pure-Go `wazero` on any laptop or server over HTTP 402 + BRC-29 micropayments. 2. **Confidential Enclave Mode (`--mode tee-only` or `--mode both`):** Locks execution to hardware-encrypted AMD SEV-SNP RAM (`google/go-sev-guest`), verifying `--allow-measurement <96-hex>` attestation reports before releasing ephemeral vault keys. 3. **Zero-Sat Pre-Pay Schema Validation:** Input JSON is validated against the pinned JSON Schema and/or anchored Go-RE2 regex **before** HTTP 402 payment triggers. Invalid inputs immediately return `HTTP 400` at **`0 sats`**. 4. **Signed Box Receipt (`nektarx1.*`):** Every paid call returns a verifiable receipt binding `box`, `version`, `commitHash`, `wasmSha256`, `inputSha256`, `outputSha256`, `executionMode`, `paidSats`, and `paymentTxId`. ```sh # Built-in deterministic demo Box (zero setup) nektar box publish --demo --name decision-box --price 10 nektar box call decision-box --url http://127.0.0.1:18420 --input '{"score":88}' # Custom compiled WASI .wasm module with strict schema files nektar box publish --wasm ./pricing.wasm --name pricing-v1 --price 25 \ --input-schema ./in.schema.json --output-schema ./out.schema.json ``` --- ## 10. Capsules, Market Economics, ZK & Covenants - **Fail-Closed Scrubbing:** Before any Capsule leaves your machine via `sellCapsule` or `nektar sell`, Aho-Corasick + Gitleaks rules scrub PII and **hard-block** secrets/private keys. - **Zero-CPU Standing Orders:** When `buyCapsule` / `nektar buy` finds 0 immediate offers, it posts a durable `StandingOrder` bounty using embedded SQLite WAL `cschleiden/go-workflows` sagas (0% idle CPU, event-driven wakeups via WAN SSE + BRC-223 + `bbox` NAT relay). - **Atomic Settlement & Safe Merge:** Trades settle atomically over BRC-29 + BRC-369 keyed disclosure (`DisclosureSale` Rúnar covenant), SPV-verify offline (`0.041 ms`), and 3-way merge into your Memory. Conflicting edits never clobber local work — they isolate safely on a `fork/` branch. - **Zero-Knowledge Engine (`internal/zk`):** Pure-Go `consensys/gnark` BN254 + Poseidon2 algebraic spine, depth-20 `ZKTree`, Gear 1 PLONK circuits (`BlindCapsuleSaleCompact`, `BlindCapsuleSaleVolumetric`, `AnchoredMembershipAndClearance`, `PrivateDerivation`), and Gear 2 5-input Groth16 `OnChainVerdict` + Rúnar SP1 VK exporter. - **Safety Watchdogs:** Every broadcast passes through `SpendGuard` atomic reservation caps; consensus BSV PoW `MedianTimePast` clock-drift monitor (zero SNTP side-channels) and spend-anomaly circuit breaker pause trading automatically on anomalies. --- ## 11. Optional Infrastructure: Bare-Origin Hubs & Public Network *Only needed if you choose to host public or private overlay infrastructure.* - **Live Public Mainnet Hubs:** - EU: `https://overlay.nektar.run` - US: `https://overlay2.nektar.run` - **Live Public Testnet Hub:** - EU: `https://testnet.nektar.run` - **Browse & Join Hubs:** ```sh nektar hub list nektar hub join https://overlay.nektar.run ``` - **Deploy a Native Bare-Origin Hub (Zero Docker, Automatic TLS, BRC-88 GASP Peer Sync):** ```sh # Testnet Hub nektar hub up --domain hub.example.com # Mainnet Hub peering with EU + US seeds OVERLAY_GASP_PEERS="https://overlay.nektar.run,https://overlay2.nektar.run" \ nektar hub up --domain overlay.example.com --mainnet --confirm I_UNDERSTAND ``` - **LightBSV Stack Mounted on Bare-Origin Hubs:** `go-overlay-services` Engine + `module/` (`tm_nektar__` + `ls_nektar`), `bfinger`, `bbox`, `blogs`, `borg`, `bsecret`, `bstore`, `bdns`, `bweb`, stock `bcommon/termsroute` paywalls, root BRC-180 `/manifest.json`, and BRC-169 `/.well-known/metanet-handles/resolve`. --- ## 12. Key Environment Variables | Variable | Role | |---|---| | `NEKTAR_NETWORK` | Target network: `testnet` (default), `main`, `regtest`, or `memory` | | `NEKTAR_MAINNET_CONFIRM` | Must equal `I_UNDERSTAND` to unlock Mainnet operation | | `NEKTAR_DATA_DIR` | Data directory (defaults to `~/.nektar/test` or `~/.nektar/main`) | | `NEKTAR_WALLET` | Custody mode: `auto` (default), `embedded`, or `client` (BSV Desktop `:3321`) | | `NEKTAR_WALLET_WIRE_URL` | Wirewallet URL for `client` custody (default `http://127.0.0.1:3321`) | | `NEKTAR_HTTP_TOKEN` | Bearer token protecting agent HTTP/MCP/proxy endpoints | | `NEKTAR_OPERATOR_TOKEN` | Elevated bearer token protecting wallet, policy, kill-switch & Hub admin routes | | `NEKTAR_MARKET_HOSTS` | Comma-separated discovery Hub origins | | `NEKTAR_PUBLIC_URL` | Public origin for direct peer-to-peer delivery | | `NEKTAR_HEADERS_SOURCE` | Dual-witness PoW header sources (required >=2 independent sources on Mainnet) | | `NEKTAR_SETTLE_SPEC` | Settlement broadcaster spec (e.g. `broadcaster:main`) | | `NEKTAR_BACKUP_DIR` | Local directory target for automatic `NKTBAK02` WAL-safe encrypted backups | | `NEKTAR_BACKUP_BSTORE_URL` | Optional LightBSV `bstore` sink URL for encrypted off-host backups | | `NEKTAR_JEV_MODE` | Semantic matcher mode (`off`, `gated`, etc.) | | `OVERLAY_GASP_PEERS` | Comma-separated peer Hub origins for BRC-88 GASP synchronization | | `NEKTAR_LISTEN` / `NEKTAR_PRICES` / `NEKTAR_PAYEE_KEY_FILE` | `termsroute` paywall front configuration for hosted overlay Hubs | --- ## 13. Autonomous Agent Playbook & Troubleshooting ### Recipe 1: First-Time Autonomous Setup (Zero Prompting) ```sh curl -fsSL https://nektar.run/install.sh | sh -s -- --up nektar doctor --json ``` Check `ok: true` and verify `dockedCount >= 1` or run `nektar dock --client auto`. ### Recipe 2: Safe Ingestion of a Project or Knowledge Vault ```sh nektar ingest ./notes -memory project-notes --dry-run # Inspect chunk count & blocked secrets first nektar ingest ./notes -memory project-notes -scrub -anchor nektar watch . # Keep AST symbols isolated in code-* Memory ``` ### Recipe 3: Answer a User Question with a Real Receipt 1. Call MCP `recall({ query: "" })`. 2. Call MCP `groundedAnswer({ claims: [{ text: "...", cites: [{ shard, seq }], quotes: [{ quote: "...", shard, seq }] }] })`. 3. Output the grounded answer followed verbatim by `receipt: nektarr1.` and `verify: `. ### Recipe 4: Diagnose Any Issue 1. Run `nektar doctor --json` and inspect `nextSteps`. 2. Verify daemon liveness: `GET http://127.0.0.1:18420/v1/health`. 3. If Mainnet refuses to start: confirm `NEKTAR_MAINNET_CONFIRM=I_UNDERSTAND` and run `nektar check-mainnet -live`. 4. If trading is paused: check `nektar status --json` for `killSwitch: true` or `watchdog.spendPaused: true`; resume via `POST /v1/automation/kill` (`{"enabled":false}`) or `POST /v1/autonomy/reset`. 5. If an IDE does not show Nektar MCP tools after `nektar dock`: restart the IDE window once, or run `nektar dock --client --dry` to verify the exact config file path.