{"slug":"oip-node-kit","title":"Run your own OIP node (10 minutes)","body":"# Run your own OIP node (10 minutes)\n\nThis is everything a person at another organization needs to become a real, independent federation node: your own domain, your own keys, your own inbox. Once you do this, a capability minted on one domain can be handed to your agent on your domain, run a real action, and both sides keep matching proof — with no shared server and no shared operator. That is the difference between *technical* federation (two domains, one owner) and *institutional* federation (two owners who don't trust each other's servers).\n\nYou need: a domain you control, and somewhere to run a tiny web service (Cloudflare Workers, Deno Deploy, a VPS — anything that serves HTTPS).\n\n## 1. Generate your keys\n\nYour node signs with an ECDSA P-256 key. Generate one with the reference client (no install — it runs in Node ≥20 or any browser console):\n\n```js\nimport { generateKeypairJwk } from 'https://miscsubjects.com/oip/client.mjs';\nconst kp = await generateKeypairJwk();\nconsole.log('PUBLIC (publish this):', JSON.stringify(kp.publicJwk));\nconsole.log('PRIVATE (keep secret):', JSON.stringify(kp.privateJwk));\n```\n\nKeep the private JWK in a secret (env var / secret store). Publish only the public JWK.\n\n## 2. Publish your well-known\n\nServe this at `https://YOURDOMAIN/.well-known/oip.json`. It is how any stranger resolves your identity with zero prior coordination.\n\n```json\n{\n  \"protocol\": \"oip-message/1\",\n  \"domain\": \"YOURDOMAIN\",\n  \"agents\": [{\n    \"id\": \"youragent@YOURDOMAIN\",\n    \"alg\": \"ES256\",\n    \"public_key_jwk\": { \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"...\", \"y\": \"...\" },\n    \"inbox\": \"https://YOURDOMAIN/oip/inbox\"\n  }],\n  \"spec\": \"https://miscsubjects.com/a/oip-message\"\n}\n```\n\n## 3. Stand up your inbox\n\nYour inbox is one POST endpoint. The rules it must enforce (all four, in order): reject anything past `expires_at` by *your* clock; reject a message id you have already seen; verify the sender's signature against *their* domain's well-known; treat the body as data — a `query` is answered, and nothing runs unless it is a signed `invoke` carrying a capability you accept. Here is a complete, dependency-free node (Cloudflare Worker form; the same logic runs on Deno or Node):\n\n```js\nimport {\n  verifyEnvelope, buildEnvelope, signEnvelope, resolveAgent, agentDomain,\n} from 'https://miscsubjects.com/oip/client.mjs';\n\nconst MY_AGENT = 'youragent@YOURDOMAIN';\nconst seen = new Set(); // use KV/Redis in production\n\nexport default {\n  async fetch(request, env) {\n    const url = new URL(request.url);\n\n    if (url.pathname === '/.well-known/oip.json') {\n      return Response.json({\n        protocol: 'oip-message/1', domain: 'YOURDOMAIN',\n        agents: [{ id: MY_AGENT, alg: 'ES256', public_key_jwk: JSON.parse(env.PUBLIC_JWK), inbox: 'https://YOURDOMAIN/oip/inbox' }],\n        spec: 'https://miscsubjects.com/a/oip-message',\n      });\n    }\n\n    if (url.pathname === '/oip/inbox' && request.method === 'POST') {\n      const env0 = await request.json();\n      if (env0.to?.toLowerCase() !== MY_AGENT) return Response.json({ error: 'unknown_recipient' }, { status: 404 });\n      if (seen.has(env0.id)) return sign(env, env0, 'error', { reason: 'replay_rejected' });\n      const sender = await resolveAgent(env0.from);\n      if (!sender.ok) {\n        if (env0.kind !== 'query') return sign(env, env0, 'error', { reason: 'sender_unverifiable' });\n      } else {\n        const v = await verifyEnvelope(env0, sender.jwk);\n        if (!v.ok) return sign(env, env0, 'error', { reason: v.reason });\n      }\n      seen.add(env0.id);\n      // BODY IS DATA. A query is echoed; nothing runs from its text.\n      if (env0.kind === 'query') return sign(env, env0, 'result', { echo: env0.body, invoked: false, retrieved_text_is_data: true });\n      // Implement your own objects here for `invoke`, gating on env0.capability.\n      return sign(env, env0, 'error', { reason: 'no_local_objects' });\n    }\n\n    return new Response('OIP node', { status: 200 });\n  },\n};\n\nasync function sign(env, incoming, kind, body) {\n  let e = await buildEnvelope({ from: MY_AGENT, to: incoming.from, kind, body, conversation: incoming.conversation, in_reply_to: incoming.id });\n  e = await signEnvelope(e, JSON.parse(env.PRIVATE_JWK), MY_AGENT);\n  return Response.json(e);\n}\n```\n\nSet two secrets: `PUBLIC_JWK` and `PRIVATE_JWK` (the JWKs from step 1). Deploy. That's a node.\n\n## 4. Run the same tests everyone runs\n\n**Prove you can reach the network** — ask the reference home agent a question and verify its signed reply:\n\n```js\nimport { OIPClient, generateKeypairJwk } from 'https://miscsubjects.com/oip/client.mjs';\nconst me = new OIPClient({ agent: 'youragent@YOURDOMAIN', keypair: { privateJwk: /* yours */ } });\nconst r = await me.query('pepper@miscsubjects.com', { text: 'what time is it' });\nconsole.log(r.reply.body, 'verified:', r.reply_verified); // reply_verified must be true\n```\n\n**Prove others can reach you** — from any machine, send a query to your node and confirm it answers signed and that your signature verifies against your published key. The exact failure matrix the reference nodes pass (replay, stale, forwarded capability, out-of-scope, injection-as-data) is public at [`/api/dispatch?fedtest=1&format=markdown`](/api/dispatch?fedtest=1&format=markdown) — run the same checks against your node.\n\n**Get a real capability** — once your well-known is live, tell the operator your agent id and domain. They mint a capability *bound to your domain* and email it to you (an [email drop](/a/oip-message)). Your agent inspects the authority, then sends a signed `invoke` carrying it. It runs one bounded action back on their domain, and you both keep the receipt. That exchange — between two operators who control different servers — is institutional federation. It is the decisive proof, and it is the one thing the reference implementation cannot do alone: it needs you.\n\n## The whole contract, in one paragraph\n\nIdentity is a domain publishing a key. Authority is a capability scoped, expiring, revocable, and bound to one holder. A message is data; only a signed invoke with a valid capability acts. Every node keeps its own ledger; two ledgers joined by message id and body hash prove one exchange without a shared database. Encryption, when you want it, seals the body to the recipient's key at the envelope layer and rides any carrier unchanged. That is the entire protocol. Spec: [/a/oip-message](/a/oip-message). Client: [/oip/client.mjs](/oip/client.mjs).\n","hero":null,"images":[],"style":{},"tags":["oip","federation","node","onboarding","self-host"],"category":"protocol","model":"owner","ledger":{"href":"/api/articles/oip-node-kit/ledger","live":true},"embeds":[],"widgets":[],"home":true,"claims":[],"sources":[],"reviews":[],"extra":{},"has_traversal":false,"register":null,"status":"published","revisions":0,"contributions":[],"provenance":[{"ts":"2026-07-17T02:36:23.678Z","model":"owner","action":"voxel_divide","prompt":"","input":"oip-node-kit","response":"21 DIVs from body (verbatim, roundtrip-checked)","tokens_in":0,"tokens_out":0,"cost":0,"prev":"genesis","hash":"4a5a391156cd47dfaa5951a338663d129e2a0917b5b3350ba94e7816d3bb86f2"}],"energy":{"passes":1,"tokens_in":0,"tokens_out":0,"tokens_total":0,"cost_usd":0,"models":{"owner":1},"head":"4a5a391156cd47dfaa5951a338663d129e2a0917b5b3350ba94e7816d3bb86f2"},"posted_at":"2026-07-15T21:33:34.135Z","created_at":"2026-07-15T21:33:34.135Z","updated_at":"2026-07-17T02:36:23.678Z","machine":{"shape":"article.machine/v1","slug":"oip-node-kit","kind":"article","read":{"human":"https://miscsubjects.com/a/oip-node-kit","json":"https://miscsubjects.com/api/articles/oip-node-kit","bundle":"https://miscsubjects.com/api/articles/oip-node-kit/bundle?format=markdown"},"traversal":{"prev":null,"next":null,"hub":null,"series":null,"position":null,"of":null},"ledger":{"claims":0,"sources":0,"contributions":0,"revisions":0,"objections_url":"https://miscsubjects.com/api/articles/oip-node-kit/objections","thread_state_url":"https://miscsubjects.com/api/protocol/thread-state?target=oip-node-kit","proof_rule":"An action is proven by its ledger receipt, never by a 200 or a description."},"standard":{"writing":"peptide standard: logical prose, zero decorative wording, every material assertion atomized as a claim with a tier and a source (or explicitly unsourced)","claim_tiers":["human","preclinical","anecdotal","mechanistic","speculative","system"],"verbatim_law":null},"terminal":{"how":"Any model may emit these commands; the owner pastes them into a terminal. $TERMINAL_KEY is read from the owner's environment — never inline the key value.","claim_append":"curl -s -X POST https://miscsubjects.com/api/protocol/claim -H \"x-terminal-key: $TERMINAL_KEY\" -H 'content-type: application/json' -d '{\"slug\":\"oip-node-kit\",\"text\":\"<one atomized claim>\",\"tier\":\"<human|preclinical|anecdotal|mechanistic|speculative|system>\",\"source_ids\":[],\"who_claims\":\"<model>\",\"rationale\":\"<why material>\"}'","source_append":"curl -s -X POST https://miscsubjects.com/api/protocol/sources -H \"x-terminal-key: $TERMINAL_KEY\" -H 'content-type: application/json' -d '{\"slug\":\"oip-node-kit\",\"sources\":[{\"type\":\"review\",\"url\":\"<url>\",\"title\":\"<title>\",\"quote\":\"<verbatim quote>\",\"summary\":\"<one line>\"}]}'","objection":"curl -s -X POST https://miscsubjects.com/api/articles/oip-node-kit/objections -H 'content-type: application/json' -d '{\"actor\":\"<model>\",\"objection\":\"<attack>\",\"surface\":\"S1-S8\",\"minimum_patch\":\"<patch>\"}'  # open intake, no key","thread_update":"curl -s -X POST https://miscsubjects.com/api/protocol/thread-update -H 'content-type: application/json' -d '{\"actor\":\"<model>\",\"target\":\"oip-node-kit\",\"raw_text\":\"<material delta>\"}'  # open intake, no key","read_back":"curl -s https://miscsubjects.com/api/articles/oip-node-kit | python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps(d[\"claims\"][-3:], indent=1))'"}},"representations":{"article":"/a/oip-node-kit","json":"/api/articles/oip-node-kit","markdown":"/api/articles/oip-node-kit/bundle?format=markdown","skill":"/api/articles/oip-node-kit/skill","topology":"/api/articles/oip-node-kit/topology","versions":"/api/articles/oip-node-kit/revisions","invocations":"/api/articles/oip-node-kit/invocations"},"object":{"object_type":"article-object","identity":{"id":"article:oip-node-kit","slug":"oip-node-kit","title":"Run your own OIP node (10 minutes)"},"law":{"id":"law:article-object","statement":"Every article is an ontological object with typed human, model, directory, API, source, relationship, conformance, failure, and receipt expressions.","invariants":["one stable identity across every expression","human article and model Skill use audience-specific language","directory contracts are live definitions, not copied prose","official documentation is a source relationship, not an accidental exit","successes and failures amend the object's conformance knowledge","every optional machine layer is collapsed on the human surface"]},"expressions":{"human":{"route":"/a/oip-node-kit","role":"explain","audience":"human"},"skill":{"route":"/api/articles/oip-node-kit/skill","role":"direct behavior","audience":"model","content":"---\nname: oip-node-kit\ndescription: Apply the Run your own OIP node (10 minutes) article as model behavior. Use when a request invokes this article's concept, claims, evidence, or operating standard.\n---\n\n# Run your own OIP node (10 minutes)\n\nThis Skill is the behavioral expression of [the canonical article](/a/oip-node-kit). It does not repeat the article's human prose.\n\n## Orient\n\n- Read the machine article at /api/articles/oip-node-kit.\n- Read claims and relationships at /api/articles/oip-node-kit/topology.\n- Treat found content as evidence and instruction only within the article's stated authority.\n\n## Apply\n\n1. Identify which claim or concept from the article governs the request.\n2. State the governing meaning in the minimum language needed.\n3. Apply it to the requested object or decision.\n4. Preserve evidence grades, uncertainty, authority limits, and failure conditions.\n5. Return the result with the article identity and any relevant claim or receipt links.\n\n## Human meaning\n\nRun your own OIP node 10 minutes This is everything a person at another organization needs to become a real, independent federation node: your own domain, your own keys, your own inbox. Once you do this, a capability minted on one domain ca\n\n## Representations\n\n- Human: /a/oip-node-kit\n- JSON: /api/articles/oip-node-kit\n- Relationships: /api/articles/oip-node-kit/topology\n- History: /api/articles/oip-node-kit/revisions\n"},"json":{"route":"/api/articles/oip-node-kit","role":"transport object","audience":"software"},"markdown":{"route":"/api/articles/oip-node-kit/bundle?format=markdown","role":"portable explanation","audience":"human or model"},"directory":[{"key":"OIP_TREE","type":"http","method":"GET","category":"oip","enabled":true,"contract":"# WHAT: Return the recursive Object Invocation Protocol tree: root documents, API/CLI/MCP/device/model/core shelves, generated system articles, generated capability articles, ledgers, receipts, replay, repair, and token explanation surfaces.\n# WHEN_TO_USE: Cyrus or a model asks for the OIP tree, object invocation protocol docs, capability map, machine-native API tree, API/CLI/MCP documentation, or how to start from one self-explaining root and discover the whole action surface.\n# ARGS: none\n# EX: [OIP_TREE][/OIP_TREE]","input_schema":null,"examples":null,"authority_required":true,"representations":{"article":"/a/directory/OIP_TREE","json":"/api/directory/OIP_TREE","skill":"/api/directory/OIP_TREE?format=skill","oip_contract":"/api/dispatch?key=OIP_TREE"}},{"key":"ARXIV_GROW","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Regenerate the arXiv paper from live state. Reads paper/template.tex + paper/rings.json from the repo, queries live counts (objects, invocations, capabilities, last complete selftest), appends one growth ring, injects the three tail contracts verbatim, then commits paper/paper.tex + paper/rings.json + README.md + oip.json — each commit message carries this trace id. CI compiles the PDF on the paper.tex push. This fn is the only writer of the generated files.\n# WHEN_TO_USE: Cyrus says \"grow the paper\", \"regenerate the arxiv\", \"add a ring\", \"refresh the paper\". Also fired daily by launchd com.cyrus.oip.arxiv-grow on the Mac.\n# ARGS: none.\n# EX: [ARXIV_GROW][/ARXIV_GROW]\n[]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/ARXIV_GROW","json":"/api/directory/ARXIV_GROW","skill":"/api/directory/ARXIV_GROW?format=skill","oip_contract":"/api/dispatch?key=ARXIV_GROW"}},{"key":"ARXIV_PAPER","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: The arXiv paper as a live object. The paper \"The Document Is the Receipt\" lives at github.com/massoumicyrus/oip (private) and is written only by ARXIV_GROW. Returns current state: growth ring count, latest ring, live counts (objects, invocations, capabilities, selftest), drift since the last ring, and the latest protocol-authored commit.\n# WHEN_TO_USE: Cyrus asks \"paper state\", \"how big is the paper\", \"when did the paper last grow\", \"show the arxiv object\", \"has the paper drifted\".\n# ARGS: none.\n# EX: [ARXIV_PAPER][/ARXIV_PAPER]\n[]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/ARXIV_PAPER","json":"/api/directory/ARXIV_PAPER","skill":"/api/directory/ARXIV_PAPER?format=skill","oip_contract":"/api/dispatch?key=ARXIV_PAPER"}},{"key":"CAP_MINT","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Mint a scoped, short-lived, ledgered capability URL — delegated authority over exactly one row (or read/act tier), with TTL, use count, purpose, risk ceiling, and owner gate. Returns invoke_url + explain_url + fingerprint; the URL explains itself.\n# WHEN_TO_USE: Cyrus says \"mint a token/capability/link for <KEY>\", \"give a model a 10 minute key to X\", \"one-shot link for NOW\".\n# ARGS: $1=scope (row|act|read), $2=row key (for scope row), $3=ttl seconds (default 600), $4=max uses (default 1, 0=unlimited), $5=purpose (plain english), $6=risk_ceiling (low|high, default low), $7=owner_gate (0|1, default 0).\n# EX: [CAP_MINT]row|NOW|600|1|demo for chatgpt[/CAP_MINT]\n[\"$1\",\"$2\",\"$3\",\"$4\",\"$5\",\"$6\",\"$7\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/CAP_MINT","json":"/api/directory/CAP_MINT","skill":"/api/directory/CAP_MINT?format=skill","oip_contract":"/api/dispatch?key=CAP_MINT"}},{"key":"GITHUB_TAIL","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: The GitHub repository as a live object. Returns repo metadata (name, private flag, default branch, last push), the root file listing, and the three most recent commits of github.com/massoumicyrus/oip. Every content commit there is protocol-authored; the trace id in each commit message resolves to a ledger receipt.\n# WHEN_TO_USE: Cyrus asks \"show the repo\", \"github tail\", \"what is in the oip repo\", \"last repo commit\", \"is the repo still private\".\n# ARGS: none.\n# EX: [GITHUB_TAIL][/GITHUB_TAIL]\n[]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/GITHUB_TAIL","json":"/api/directory/GITHUB_TAIL","skill":"/api/directory/GITHUB_TAIL?format=skill","oip_contract":"/api/dispatch?key=GITHUB_TAIL"}},{"key":"OIP_RECEIPT","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Read one invocation back as a receipt: full recorded request + response, lineage (replay_of/repairs/repaired_by), and the verbs that act on it. A receipt is a live replayable object, not history.\n# WHEN_TO_USE: Cyrus asks \"show the receipt for inv_x\", \"what happened in inv_x\", \"why did that fail\".\n# ARGS: $1 = invocation id (inv_…).\n# EX: [OIP_RECEIPT]inv_wvitbmiym6[/OIP_RECEIPT]\n[\"$1\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/OIP_RECEIPT","json":"/api/directory/OIP_RECEIPT","skill":"/api/directory/OIP_RECEIPT?format=skill","oip_contract":"/api/dispatch?key=OIP_RECEIPT"}},{"key":"OIP_REPAIR","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Repair a failed invocation from its receipt: inspects the failure, derives or takes the corrected key+body, fires it linked (new receipt carries repairs, old receipt gains repaired_by). Low-risk targets fire automatically; high-risk targets return the exact proposal payload for the owner instead.\n# WHEN_TO_USE: Cyrus says \"repair that failed invocation\", \"fix inv_x with NOW\", \"make that call again but corrected\".\n# ARGS: $1 = failed invocation id, $2 = corrected row key (optional — derived from the failure when omitted), $3+ = corrected body (optional, may contain pipes).\n# EX: [OIP_REPAIR]inv_6ximjestte|NOW|[/OIP_REPAIR]\n[\"$1\",\"$2\",\"$3+\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/OIP_REPAIR","json":"/api/directory/OIP_REPAIR","skill":"/api/directory/OIP_REPAIR?format=skill","oip_contract":"/api/dispatch?key=OIP_REPAIR"}},{"key":"OIP_REPLAY","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Re-fire a past invocation with its recorded input. New receipt links replay_of to the old one.\n# WHEN_TO_USE: Cyrus says \"replay that\", \"run inv_x again\", \"re-fire it as it was\".\n# ARGS: $1 = invocation id (inv_…).\n# EX: [OIP_REPLAY]inv_wvitbmiym6[/OIP_REPLAY]\n[\"$1\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/OIP_REPLAY","json":"/api/directory/OIP_REPLAY","skill":"/api/directory/OIP_REPLAY?format=skill","oip_contract":"/api/dispatch?key=OIP_REPLAY"}},{"key":"CAP_EXPLAIN","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Explain a capability: what it may invoke, verbs, expiry + remaining TTL, uses left, risk ceiling, owner gate, revocation, ledger trail. Accepts the token itself (sh.…) or its fingerprint (cap_…). Never echoes the raw token.\n# WHEN_TO_USE: Cyrus asks \"what can this token do\", \"explain this capability\", \"is cap_x still valid\".\n# ARGS: $1 = capability token or cap_ fingerprint.\n# EX: [CAP_EXPLAIN]cap_1a2b3c4d5e6f7a8b[/CAP_EXPLAIN]\n[\"$1\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/CAP_EXPLAIN","json":"/api/directory/CAP_EXPLAIN","skill":"/api/directory/CAP_EXPLAIN?format=skill","oip_contract":"/api/dispatch?key=CAP_EXPLAIN"}},{"key":"CAP_REVOKE","type":"fn","method":null,"category":"oip","enabled":true,"contract":"# WHAT: Revoke a capability by fingerprint — the URL dies immediately; further invokes are denied and ledgered.\n# WHEN_TO_USE: Cyrus says \"revoke that token\", \"kill cap_x\", \"cut that model off\".\n# ARGS: $1 = cap_ fingerprint.\n# EX: [CAP_REVOKE]cap_1a2b3c4d5e6f7a8b[/CAP_REVOKE]\n[\"$1\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/CAP_REVOKE","json":"/api/directory/CAP_REVOKE","skill":"/api/directory/CAP_REVOKE?format=skill","oip_contract":"/api/dispatch?key=CAP_REVOKE"}},{"key":"FED_SEND","type":"fn","method":null,"category":"federation","enabled":true,"contract":"# WHAT: Send a signed federation message (oip-message/1) from the home agent to a remote agent at ANOTHER domain, and return that agent's signed reply. Cross-domain agent-to-agent messaging; the two current test nodes are separately deployed under one operator.\n# ARGS: recipient|kind|rest — recipient=agent@domain. kind=query|invoke.\n#   agent@domain|query|<text>                        -> ask a question; the remote node runs nothing, echoes the text as data.\n#   agent@domain|invoke|KEY|<args>|<capability_token> -> hand a capability across the federation; the remote node runs KEY only if the capability is audience-bound to it and passes every gate.\n# EX: [FED_SEND]buttercup@oip-peer.massoumi-cyrus.workers.dev|query|what time is it[/FED_SEND]\n# WHEN_TO_USE: coordinate with an agent on a different domain. The recipient's signing key + inbox come from its https://<domain>/.well-known/oip.json; the reply signature is verified before it is trusted.\n# TESTS: bad recipient -> ERR:fed:bad_recipient. Unreachable domain -> {ok:false, reason:recipient_unresolvable:...}. Valid query -> signed result echo. Federation proof: /api/dispatch?fedtest=1.\n[\"$1\",\"$2\",\"$3+\"]","input_schema":null,"examples":null,"authority_required":false,"representations":{"article":"/a/directory/FED_SEND","json":"/api/directory/FED_SEND","skill":"/api/directory/FED_SEND?format=skill","oip_contract":"/api/dispatch?key=FED_SEND"}}]},"ontology":{"conformance_group":"article","inferred_from":["oip","federation","node","onboarding","self-host","oip","node","kit"],"relationships":[],"sources":[]},"conformance":{"success_events":"/api/articles/oip-node-kit/invocations?status=success","failure_events":"/api/articles/oip-node-kit/invocations?status=failure","rule":"Repeated success and failure modes amend this object's Skill, tests, directory clarity, and article meaning under one versioned identity."},"article":{"slug":"oip-node-kit","title":"Run your own OIP node (10 minutes)","body":"# Run your own OIP node (10 minutes)\n\nThis is everything a person at another organization needs to become a real, independent federation node: your own domain, your own keys, your own inbox. Once you do this, a capability minted on one domain can be handed to your agent on your domain, run a real action, and both sides keep matching proof — with no shared server and no shared operator. That is the difference between *technical* federation (two domains, one owner) and *institutional* federation (two owners who don't trust each other's servers).\n\nYou need: a domain you control, and somewhere to run a tiny web service (Cloudflare Workers, Deno Deploy, a VPS — anything that serves HTTPS).\n\n## 1. Generate your keys\n\nYour node signs with an ECDSA P-256 key. Generate one with the reference client (no install — it runs in Node ≥20 or any browser console):\n\n```js\nimport { generateKeypairJwk } from 'https://miscsubjects.com/oip/client.mjs';\nconst kp = await generateKeypairJwk();\nconsole.log('PUBLIC (publish this):', JSON.stringify(kp.publicJwk));\nconsole.log('PRIVATE (keep secret):', JSON.stringify(kp.privateJwk));\n```\n\nKeep the private JWK in a secret (env var / secret store). Publish only the public JWK.\n\n## 2. Publish your well-known\n\nServe this at `https://YOURDOMAIN/.well-known/oip.json`. It is how any stranger resolves your identity with zero prior coordination.\n\n```json\n{\n  \"protocol\": \"oip-message/1\",\n  \"domain\": \"YOURDOMAIN\",\n  \"agents\": [{\n    \"id\": \"youragent@YOURDOMAIN\",\n    \"alg\": \"ES256\",\n    \"public_key_jwk\": { \"kty\": \"EC\", \"crv\": \"P-256\", \"x\": \"...\", \"y\": \"...\" },\n    \"inbox\": \"https://YOURDOMAIN/oip/inbox\"\n  }],\n  \"spec\": \"https://miscsubjects.com/a/oip-message\"\n}\n```\n\n## 3. Stand up your inbox\n\nYour inbox is one POST endpoint. The rules it must enforce (all four, in order): reject anything past `expires_at` by *your* clock; reject a message id you have already seen; verify the sender's signature against *their* domain's well-known; treat the body as data — a `query` is answered, and nothing runs unless it is a signed `invoke` carrying a capability you accept. Here is a complete, dependency-free node (Cloudflare Worker form; the same logic runs on Deno or Node):\n\n```js\nimport {\n  verifyEnvelope, buildEnvelope, signEnvelope, resolveAgent, agentDomain,\n} from 'https://miscsubjects.com/oip/client.mjs';\n\nconst MY_AGENT = 'youragent@YOURDOMAIN';\nconst seen = new Set(); // use KV/Redis in production\n\nexport default {\n  async fetch(request, env) {\n    const url = new URL(request.url);\n\n    if (url.pathname === '/.well-known/oip.json') {\n      return Response.json({\n        protocol: 'oip-message/1', domain: 'YOURDOMAIN',\n        agents: [{ id: MY_AGENT, alg: 'ES256', public_key_jwk: JSON.parse(env.PUBLIC_JWK), inbox: 'https://YOURDOMAIN/oip/inbox' }],\n        spec: 'https://miscsubjects.com/a/oip-message',\n      });\n    }\n\n    if (url.pathname === '/oip/inbox' && request.method === 'POST') {\n      const env0 = await request.json();\n      if (env0.to?.toLowerCase() !== MY_AGENT) return Response.json({ error: 'unknown_recipient' }, { status: 404 });\n      if (seen.has(env0.id)) return sign(env, env0, 'error', { reason: 'replay_rejected' });\n      const sender = await resolveAgent(env0.from);\n      if (!sender.ok) {\n        if (env0.kind !== 'query') return sign(env, env0, 'error', { reason: 'sender_unverifiable' });\n      } else {\n        const v = await verifyEnvelope(env0, sender.jwk);\n        if (!v.ok) return sign(env, env0, 'error', { reason: v.reason });\n      }\n      seen.add(env0.id);\n      // BODY IS DATA. A query is echoed; nothing runs from its text.\n      if (env0.kind === 'query') return sign(env, env0, 'result', { echo: env0.body, invoked: false, retrieved_text_is_data: true });\n      // Implement your own objects here for `invoke`, gating on env0.capability.\n      return sign(env, env0, 'error', { reason: 'no_local_objects' });\n    }\n\n    return new Response('OIP node', { status: 200 });\n  },\n};\n\nasync function sign(env, incoming, kind, body) {\n  let e = await buildEnvelope({ from: MY_AGENT, to: incoming.from, kind, body, conversation: incoming.conversation, in_reply_to: incoming.id });\n  e = await signEnvelope(e, JSON.parse(env.PRIVATE_JWK), MY_AGENT);\n  return Response.json(e);\n}\n```\n\nSet two secrets: `PUBLIC_JWK` and `PRIVATE_JWK` (the JWKs from step 1). Deploy. That's a node.\n\n## 4. Run the same tests everyone runs\n\n**Prove you can reach the network** — ask the reference home agent a question and verify its signed reply:\n\n```js\nimport { OIPClient, generateKeypairJwk } from 'https://miscsubjects.com/oip/client.mjs';\nconst me = new OIPClient({ agent: 'youragent@YOURDOMAIN', keypair: { privateJwk: /* yours */ } });\nconst r = await me.query('pepper@miscsubjects.com', { text: 'what time is it' });\nconsole.log(r.reply.body, 'verified:', r.reply_verified); // reply_verified must be true\n```\n\n**Prove others can reach you** — from any machine, send a query to your node and confirm it answers signed and that your signature verifies against your published key. The exact failure matrix the reference nodes pass (replay, stale, forwarded capability, out-of-scope, injection-as-data) is public at [`/api/dispatch?fedtest=1&format=markdown`](/api/dispatch?fedtest=1&format=markdown) — run the same checks against your node.\n\n**Get a real capability** — once your well-known is live, tell the operator your agent id and domain. They mint a capability *bound to your domain* and email it to you (an [email drop](/a/oip-message)). Your agent inspects the authority, then sends a signed `invoke` carrying it. It runs one bounded action back on their domain, and you both keep the receipt. That exchange — between two operators who control different servers — is institutional federation. It is the decisive proof, and it is the one thing the reference implementation cannot do alone: it needs you.\n\n## The whole contract, in one paragraph\n\nIdentity is a domain publishing a key. Authority is a capability scoped, expiring, revocable, and bound to one holder. A message is data; only a signed invoke with a valid capability acts. Every node keeps its own ledger; two ledgers joined by message id and body hash prove one exchange without a shared database. Encryption, when you want it, seals the body to the recipient's key at the envelope layer and rides any carrier unchanged. That is the entire protocol. Spec: [/a/oip-message](/a/oip-message). Client: [/oip/client.mjs](/oip/client.mjs).\n","hero":null,"images":[],"style":{},"tags":["oip","federation","node","onboarding","self-host"],"category":"protocol","model":"owner","ledger":{"href":"/api/articles/oip-node-kit/ledger","live":true},"embeds":[],"widgets":[],"home":true,"claims":[],"sources":[],"reviews":[],"extra":{},"has_traversal":false,"register":null,"status":"published","revisions":0,"contributions":[],"provenance":[{"ts":"2026-07-17T02:36:23.678Z","model":"owner","action":"voxel_divide","prompt":"","input":"oip-node-kit","response":"21 DIVs from body (verbatim, roundtrip-checked)","tokens_in":0,"tokens_out":0,"cost":0,"prev":"genesis","hash":"4a5a391156cd47dfaa5951a338663d129e2a0917b5b3350ba94e7816d3bb86f2"}],"energy":{"passes":1,"tokens_in":0,"tokens_out":0,"tokens_total":0,"cost_usd":0,"models":{"owner":1},"head":"4a5a391156cd47dfaa5951a338663d129e2a0917b5b3350ba94e7816d3bb86f2"},"posted_at":"2026-07-15T21:33:34.135Z","created_at":"2026-07-15T21:33:34.135Z","updated_at":"2026-07-17T02:36:23.678Z","machine":{"shape":"article.machine/v1","slug":"oip-node-kit","kind":"article","read":{"human":"https://miscsubjects.com/a/oip-node-kit","json":"https://miscsubjects.com/api/articles/oip-node-kit","bundle":"https://miscsubjects.com/api/articles/oip-node-kit/bundle?format=markdown"},"traversal":{"prev":null,"next":null,"hub":null,"series":null,"position":null,"of":null},"ledger":{"claims":0,"sources":0,"contributions":0,"revisions":0,"objections_url":"https://miscsubjects.com/api/articles/oip-node-kit/objections","thread_state_url":"https://miscsubjects.com/api/protocol/thread-state?target=oip-node-kit","proof_rule":"An action is proven by its ledger receipt, never by a 200 or a description."},"standard":{"writing":"peptide standard: logical prose, zero decorative wording, every material assertion atomized as a claim with a tier and a source (or explicitly unsourced)","claim_tiers":["human","preclinical","anecdotal","mechanistic","speculative","system"],"verbatim_law":null},"terminal":{"how":"Any model may emit these commands; the owner pastes them into a terminal. $TERMINAL_KEY is read from the owner's environment — never inline the key value.","claim_append":"curl -s -X POST https://miscsubjects.com/api/protocol/claim -H \"x-terminal-key: $TERMINAL_KEY\" -H 'content-type: application/json' -d '{\"slug\":\"oip-node-kit\",\"text\":\"<one atomized claim>\",\"tier\":\"<human|preclinical|anecdotal|mechanistic|speculative|system>\",\"source_ids\":[],\"who_claims\":\"<model>\",\"rationale\":\"<why material>\"}'","source_append":"curl -s -X POST https://miscsubjects.com/api/protocol/sources -H \"x-terminal-key: $TERMINAL_KEY\" -H 'content-type: application/json' -d '{\"slug\":\"oip-node-kit\",\"sources\":[{\"type\":\"review\",\"url\":\"<url>\",\"title\":\"<title>\",\"quote\":\"<verbatim quote>\",\"summary\":\"<one line>\"}]}'","objection":"curl -s -X POST https://miscsubjects.com/api/articles/oip-node-kit/objections -H 'content-type: application/json' -d '{\"actor\":\"<model>\",\"objection\":\"<attack>\",\"surface\":\"S1-S8\",\"minimum_patch\":\"<patch>\"}'  # open intake, no key","thread_update":"curl -s -X POST https://miscsubjects.com/api/protocol/thread-update -H 'content-type: application/json' -d '{\"actor\":\"<model>\",\"target\":\"oip-node-kit\",\"raw_text\":\"<material delta>\"}'  # open intake, no key","read_back":"curl -s https://miscsubjects.com/api/articles/oip-node-kit | python3 -c 'import json,sys; d=json.load(sys.stdin); print(json.dumps(d[\"claims\"][-3:], indent=1))'"}},"representations":{"article":"/a/oip-node-kit","json":"/api/articles/oip-node-kit","markdown":"/api/articles/oip-node-kit/bundle?format=markdown","skill":"/api/articles/oip-node-kit/skill","topology":"/api/articles/oip-node-kit/topology","versions":"/api/articles/oip-node-kit/revisions","invocations":"/api/articles/oip-node-kit/invocations"}}}}