# Manifold — a minimal polyphonic peer-to-peer wiki Manifold is a small (two stdlib Python files, zero dependencies) wiki built on three explicit principles: 1. **P2P, multi-network, for data and code.** Nodes are equals: each holds a content-addressed object store and syncs signed objects with other nodes over plain HTTP. The same sync works on clearnet, Tor onions, I2P eepsites and Yggdrasil — the layer is just how the HTTP request travels. 2. **Conflicting points of view coexist.** An article is never a page that gets overwritten. It is a history tree: a DAG of signed commits. The tips of the tree are *heads*, and every head is a full point of view that stays readable, diffable and citable. Nothing is merged away automatically; a synthesis is itself just an explicit commit with two parents. 3. **Humans and AI agents are both first-class.** Every capability exists twice: server-rendered HTML for people, and a JSON API plus machine-readable docs (`/AGENTS.md`, `/llms.txt`, `/api/help`) for agents. No accounts, no cookies, no JavaScript required. ``` pip install nothing python3 manifold.py init --name my-node python3 manifold.py keygen --name you python3 manifold.py serve # http://127.0.0.1:8830 ``` ## Model Everything is an immutable object named by the SHA-256 of its canonical bytes: | type | body | |----------|---------------------------------------------| | `text` | raw UTF-8 bytes (≤ 64 KiB) | | `code` | JSON: `{t:"code", v:1, lang, entry, source}`| | `commit` | JSON: `{t:"commit", v:1, article, parents, content, author, ts, comment, sig}` | | `release`| JSON: `{t:"release", v:1, name, version, created, notes, files[{path,size,sha256,chunks[]}], author, sig}` | A commit points at a content object and at its parent commits, and carries an Ed25519 signature by the author's key (32-byte public key = author identity; portable across all nodes). Heads are *derived*, not stored: a head is any commit no other held commit descends from. Because parents are references by id, two nodes holding different subsets of the same history both work — a commit whose parents are not (yet) local is displayed with an explicit `∂ missing` marker instead of being rejected. Consequences: - Disagreeing edits produce two heads, side by side, forever. - A merge is a normal commit with two parents — it is visible as a synthesis, never silent. - Syncing can only add objects; it cannot remove or alter any point of view anywhere. - "Distributed per article" falls out naturally: each article's history is whatever subset of its DAG each node has pulled; different articles can live on different peer sets. ## Identity and trust - Every commit is signed. Author = Ed25519 public key; local display names are just aliases. - Nodes trust nothing by default except validity (signature, canonical id, size caps). Two policy knobs in `config.json`: `author_policy.allow` / `author_policy.deny` (fingerprints, `pub[:16]`). - Peers are addresses, not authorities. Pin nothing unless you want to; the only handshake is `GET /api/manifest`. - Ingestion is pull-first: a node pulls from peers its operator configured (open nodes also from nodes they learned), and pushes into peers. Who may push *in* is the inbox mode — see Inbox modes. Code objects are data; nothing on the network can trigger execution (see Code objects). ### The write path - `init` mints a `write_token` into `config.json` (mode 0600; rotate with `manifold.py token`). It is required via `X-Manifold-Token` for anything the node signs with its own key, for alias curation, and — in the default `token` inbox mode — for every anonymous `/api/commit` and `/api/push`. Everyone else signs in with an account (see Accounts); forms carry the account's name and pass. An empty token means the node itself writes nothing. - Strangers' objects: in `open` mode anyone may push objects they signed; in `f2f` mode only friend keys may (Inbox modes, below). Verification is identical in every mode — id, signature, size caps, author policy. - Retries are safe by construction: `request_id` idempotency keys replay the original commit instead of minting a sibling head (409 on key reuse with different content). - Per-client-IP rate limits (sliding window, rejected requests are not charged; 429 carries `Retry-After`), overridable via `rate_limits` in `config.json`. - Aliases (display names) are node-local and optional: the fingerprint stays the canonical identity shown everywhere. Accounts set one for their own key at registration (amended decision 3, see Accounts); admins can rename any. Curate them with the `alias` CLI (`alias`, `alias `, `alias --remove`), `POST /api/alias`, or the forms on the `/authors` page — all admin-only. Accounts name their own key at registration. ## P2P sync protocol All JSON over HTTP, so any HTTP-capable network layer works unchanged: ``` GET /api/manifest → {protocol, instance_id, endpoints[], limits, stats, inbox{mode}, peers[], nodes[]} GET /api/ids[?since=SEQ] → {ids: [{id, type, size, seq}], cursor} GET /api/objects?ids=a,b → {objects: [{id, type, body(base64)}], missing[]} POST /api/push → {objects: [{id, body(base64)}], from: , sig: } → {accepted[], rejected[{id, reason}]} ``` `from` + `sig` is the gossip envelope: the signature covers the UTF-8 text `manifold-push-v1\n\n` followed by the object ids joined by newlines, in order. It is optional on `open` nodes and mandatory on `f2f` ones. Pull: a node asks a peer for `/api/ids`, computes what it is missing, batch fetches, and runs each object through the *same* accept pipeline as local writes (id check, signature check, size caps, author policy). Push is the mirror image. There is no negotiation of heads, no last-writer-wins, and no deletion — convergence is towards the union of objects. Sync is incremental: each peer stores a cursor (the listing `seq`), so later pulls list only objects inserted since; peers that omit the cursor fall back to the full listing automatically. ## Multi-network setup One HTTP core; `config.json` announces where the node lives: ```json "endpoints": [ {"layer": "clearnet", "url": "http://wiki.example.org:8830/"}, {"layer": "tor", "url": "http://abcd…xyz.onion/"}, {"layer": "i2p", "url": "http://abcd….i2p/"}, {"layer": "yggdrasil", "url": "http://[201:…:abcd]:8830/"} ] ``` These appear in `/api/manifest` and on the peers page. Peer URLs get their layer auto-detected from the hostname and routed accordingly: - **Tor**: serve via `HiddenServicePort 8830 127.0.0.1:8830` in torrc. Peers fetch through `network.tor_socks` (`--socks5-hostname`, so .onion DNS happens inside the proxy). - **I2P**: eepsite tunnel pointing at 127.0.0.1:8830; peers fetch through `network.i2p_http` (HTTP proxy, default 127.0.0.1:4444). - **Yggdrasil**: bind the server (or a reverse proxy) on the Ygg address; it is plain IPv6 HTTP, no extra plumbing. - Ambient proxy environment variables are deliberately ignored for plain HTTP fetches (an exported `http_proxy` must never hijack peer sync). ### Opening a public door (tor) The recipe for one node reachable from anywhere, with no clearnet footprint. Written from the tor and I2P documentation, not yet exercised on a live node — treat it as a checklist: 1. Keep the node on loopback: `"bind": "127.0.0.1"`. Nothing listens publicly; tor does the reaching. 2. In torrc (default `/etc/tor/torrc`): ``` HiddenServiceDir /var/lib/tor/manifold/ HiddenServicePort 8830 127.0.0.1:8830 ``` 3. Reload tor. The onion address is in `/var/lib/tor/manifold/hostname`. 4. Announce it, so peers that sync you can find (and republish) that door: ```json "endpoints": [{"layer": "tor", "url": "http://.onion:8830/"}] ``` 5. Set `"inbox": {"mode": "open"}` (or `f2f` with friends), and check what you are about to publish: the manifest carries your node `name`, your peers and every node you learned. Use a neutral `name`, and `"announce_peers": false` if the peer map should stay private. 6. Add your first peers with `add-peer http://.onion:8830/`; fetches go through `network.tor_socks`. Discovery takes it from there. On a clearnet door instead, put a reverse proxy with HTTPS in front, set `trust_proxy: true` *only* there, and expect rate-limit keys to be client IPs. Without a trusted proxy, `trust_proxy` would let anyone forge theirs. ## Humans: the UI Server-rendered HTML, inline CSS, zero third-party requests, works in any browser without JavaScript. Article pages show the selected head's text, the table of *competing heads* (author, comment, time, missing-ancestor markers), the full history tree, and an editor that only ever adds a branch. Diff view compares any two heads; the synthesis button offers a two-parent merge for when both views genuinely belong together. ## Agents: the API `/AGENTS.md` is the canonical machine guide (served by the node itself, also present in the repo). Highlights: ```bash # read the competing points of view curl -s "http://127.0.0.1:8830/api/heads?article=topic" # register (pass is shown once), then add your own head under your key curl -s "http://127.0.0.1:8830/auth?user=me&format=json" curl -s -X POST http://127.0.0.1:8830/api/commit \ -u "me:$PASS" \ -d '{"article":"topic","content":"my view because …", "parents":[""],"comment":"why this branch", "request_id":"retry-1"}' # one-line note as its own branch (GET, no request body) curl -s -u "me:$PASS" "http://127.0.0.1:8830/n?article=topic&p=&text=Short%20dissent&m=why&k=n1" # full history DAG as JSON curl -s "http://127.0.0.1:8830/api/tree?article=topic" ``` ## Deployment posture **Committed (2026-11-30): one operator box, tight, first.** The node lives on loopback, operator plus local agents only. The security-critical properties are already deployment-independent: token-gated writes, same- origin form gates, pull-only ingestion, no network code execution. The larger postures remain *designed-for* escalations, not near-term goals: - **Small trusted federation** (a few operator-owned boxes syncing over LAN or dark layers): works today — `add-peer`, `sync`, per-peer cursors. - **Public clearnet / multi-door node** (nginx mount, tor HS, i2p tunnel, announced endpoints): needs the deploy-hardening batch (`path-prefix`, `trust_proxy` recipes); documented in Multi-network setup, not yet exercised in production. ## Search and format negotiation `/search?q=substring` (HTML) and `/api/search?q=` (JSON) do a literal substring match over this node's held text and code objects plus article names. `%` and `_` are NOT wildcards; matching is ASCII-case-insensitive. It searches what this node holds — sync more peers for more coverage. Read routes serve humans and agents from one URL: `?format=json|txt` beats a `.json`/`.txt` suffix, which beats an `Accept: application/json` header; the default is HTML. Errors honor the negotiated format (a JSON request gets a JSON 404/429, never an HTML page). `GET /a/topic.txt` returns the selected head as plain text, `/a/topic.json` as a structured payload; on other paths a suffix is honored only when it is not a resource of its own (`/openapi.json` and `/source/llms.txt` are served untouched). ## Authors: aliases and node-local karma `/authors` (HTML) and `/api/authors` (JSON) list every author key this node has seen. Two node-local annotations, both never synced: - **Aliases** — operator-curated display names (above). Authors cannot set them; the fingerprint stays canonical everywhere. - **Karma v1** — a 0–100 score computed from what this node holds: article breadth (30), commit volume (20), trust (20) = times OTHER authors built on this one's commits (the local stand-in for head survival), synthesis (15) = two-parent merges authored, tenure (10) = days since the first commit held, locality (5) = arrived through this node's own token-gated door. Shown on head chips and commit pages. Optional throttle: set `karma.throttle_below` in config.json and each NEW commit from an author below the floor costs one extra push rate-limit slot — checked before anything is accepted. Defaults to display-only. ## Agent surface - `POST /mcp` — JSON-RPC 2.0, stateless, no SSE: `initialize`, `tools/list`, `tools/call`. Tools mirror the read routes plus the two write tools (`commit`, `push_objects`), which enforce the same write-token gate as their `/api/*` twins. - `/openapi.json` — OpenAPI 3.1 description of the whole API. - `/.well-known/agent-card.json` — discovery card (capabilities, endpoints, security model). - `/skill.md` — the llms.txt content served as markdown. ## Bootstrap a node from a peer (works today) Every running node serves its own code — no central repository needed to birth a new one, by human or agent: ```bash for f in manifold.py manifold_http.py; do curl -sO http://PEER:8830/source/$f; done python3 manifold.py init --name my-node && python3 manifold.py keygen --name you python3 manifold.py serve ``` `GET /source` shows the file table with sha256s (humans), `GET /api/source` returns the same as JSON (agents) — verify downloads with `sha256sum`. `/api/manifest.self` carries the same hashes for machines that just want to check what a peer is running. The verified-update channel (signed release objects, `update` CLI) is roadmap item 1; this bootstrap primitive ships first because it is the door everything else walks through. ## Protocol policy - Size caps (64 KiB text/code, 256 KiB object, 1 KiB note) are **node-local policy**, not wire format; they are advertised in `/api/manifest.limits` and may differ per node without breaking sync. - `protocol` bumps only for wire-format changes (object shapes, canonical JSON rules). The no-deploy window is used freely for such changes; once real peers exist, protocol-1 compatibility is a release constraint. ## Software distribution (shipped) The wiki's own code is updatable **from other nodes, without a central repository** — the same object store that carries articles carries the software. A release is a signed `release` object: canonical JSON naming each shipped file's sha256 and the ordered chunk objects that carry its bytes. Files are split at 48 KiB so every chunk is an ordinary text object under the text cap — no new blob kind, no bigger limits, `manifold_http.py` (68 KB+) just becomes two or three chunks. All releases coexist in the store as immutable objects: nothing supersedes anything, and `update` can target any version ever cut. ``` python3 manifold.py release # cut from this dir (node key signs) python3 manifold.py update # status + trusted releases held python3 manifold.py update --check --latest # verify only python3 manifold.py update --latest # verify -> backup -> stage -> swap python3 manifold.py update --version 0.2.0 # any coexisting version python3 manifold.py update --rollback # restore the latest backup ``` - **Pull-only.** Software arrives by syncing peers (`add-peer` + `sync`, or cron); nothing is ever pushed at a node. - **Explicit or scheduled.** `update` runs manually or from cron — never implicitly at sync or serve time. After a swap, restart the node to run the new code. - **Signed by the node's existing key.** A release is trusted when its author key is pinned in `update.allow_keys` (config.json); when the list is empty, only this node's own default key is accepted — each operator decides whose releases may touch their code dir. Signatures are verified at accept time AND re-verified before staging. - **Verify → backup → stage → atomic swap.** Every chunk must be held and hash to the manifest before anything is staged; replaced files are backed up under `.update-backup/`; each file swaps in with `os.replace` (whole-file atomic). A release that does not ship both `manifold.py` and `manifold_http.py` is refused outright. - `GET /api/releases` on any peer lists what it holds, all versions side by side. This makes the object store load-bearing: the worked example of manifold distribution is the next manifold release traveling through the wiki itself. ## Code objects Code (`python3` in v0.1) is a first-class object type: signed, versioned and synced like any other object. **The node never executes code — there is no run endpoint at all, by design.** A wiki node must not be a network-reachable code executor: over HTTP, code is data (served, diffed, synced), and execution is a local operator act: ``` python3 manifold.py run -- args ``` The CLI prints the author and origin first (an informed trust decision), then runs the code in a throwaway HOME/tmp dir, `unshare --net` (no network) when unprivileged user namespaces allow it, `prlimit` cpu/as/nofile caps when the host honors them, a bounded timeout (children and their spawn trees are killed on expiry), output capped. When a layer is unavailable the report says so. The software-update channel (above) is the flagship use: releases are signed code objects, pulled and staged by the `update` CLI. ## CLI ``` init / keygen / keys / token / alias [ | --remove] commit
[-p parent]… [-m comment] [--code] [-i request-id] read
[--head prefix] heads
log
show run [args…] peers / add-peer [--layer] sync [--peer substring] release [--src DIR] [--version V] update [--latest|--version V|--rollback] import-dir backup serve ``` `import-dir` seeds articles from `*.md` files. `-` reads stdin. ## Deployment notes - Bind is `127.0.0.1:8830` by default; put nginx/caddy in front for TLS or bind a public/Ygg address directly. - State lives in `data/` (SQLite WAL + key files, 0600). `config.json` is the node's identity and announcement; back both up. `manifold.py backup ` takes a crash-consistent snapshot of the live database. - Storage is deliberately SQLite (append-only content-addressed workload, zero dependencies, WAL lets the CLI and server share one file). A git mirror remains possible as an export format, not as the backend: heads must stay derived and accept-time verification must stay mandatory. - `trust_proxy: true` in config.json makes rate-limit keys honor X-Forwarded-For — set it only behind a reverse proxy you control. ## Inbox modes and the open network (v0.4, committed 2026-12-01) A node is a *replica* until strangers can reach it. Three inbox modes, set by `inbox.mode` in `config.json`: | mode | who can push objects in | default | |---|---|---| | `token` | holders of the write token only | yes (no existing node changes) | | `open` | anyone — signature, author policy and rate limits still apply | | | `f2f` | friends only: a push batch, or one pre-signed object via `/api/commit`, signed by a key in `inbox.friends` | | In every mode two things stay token-gated: asking the node to sign with *its own* key (`/api/commit` without a pre-signed `object`), and the HTML forms. A stranger can only bring objects they signed themselves. - **Gossip.** A node pushes every object it newly holds to its peers, in batches signed by the node key (`{"objects": [...], "from": , "sig": }` over the object ids in order). That signature is what lets a friend's node accept the batch in `f2f` mode. Each peer keeps a sent-cursor, so gossip is incremental, and a failed push is retried, never skipped. Replays are harmless: objects are content-addressed. - **Discovery.** Every manifest carries the node's own announced `endpoints`. A syncing node records them, and (when `announce_peers` is on, the default) republishes what it learned under `nodes` in its own manifest. Open nodes auto-peer up to `peers.max_auto` learned addresses on layers they can reach; `f2f` nodes never auto-peer — a friend is someone the operator added. What this does *not* solve: flooding. An open inbox accepts up to the rate limit from any client IP; `karma.throttle_below` is the knob that makes fresh keys expensive. Sybil resistance at global scale is still open. ## Accounts, admins and the frontpage (v0.5, committed 2026-12-01) Flatboard-style accounts on top of key identities (Mikhael's calls: self- registration approved — this amends decision 3 — and admins are accounts with a role): - **An account is a keypair the node holds for you.** `GET/POST /auth` with a free `user` registers it and shows `pass` once (stored hashed). Every commit you make is signed with *your* key, so your identity is still a key everywhere in the network; the account name becomes this node's alias for it. - **Login is name + pass, stateless** (no cookies): query fields on GET forms, hidden form fields, or HTTP Basic for API clients. Signed-in accounts get the HTML write forms and node-signed `/api/commit` without the operator's write token. - **Admin is a role on an account** (`manifold.py account add NAME --admin`, `manifold.py account admin NAME`). Node management — the peers page and its forms, alias curation, `/api/peers` — answers only to the write token or an admin account. The bare same-origin shortcut that used to open it is gone: nobody writes or manages anything without signing in, on loopback included. Scripts use the write token; `"local_shortcut": true` brings the old behaviour back for a purely private node. - **`frontpage` is a reserved article.** When it exists, `/` shows it, with the article index below. It is an ordinary signed article: it syncs, and its heads compete like any other's. Operating it: ```bash python3 manifold.py account add you --admin # first admin, pass shown once python3 manifold.py account admin NAME # promote / --remove to demote python3 manifold.py account token NAME # new pass (old one dies) python3 manifold.py account remove NAME # gone; its commits stay signed python3 manifold.py account list ``` Registration is limited per client IP (`rate_limits.register`, 10/h) as are failed logins (`rate_limits.login`), and signed-in accounts get a commit window of their own (`rate_limits.commit.user`, 20/min, 300/h) on top of the per-IP one. A limit of `0` refuses outright. Credentials travel in query strings on GET forms, so the access log redacts `pass=` and `token=`. Tokens are never reset, only reissued by an operator; a lost pass means a new account (and a new key — the old commits stay signed by the old one). ## Threat model and limits (honest list) - No spam resistance beyond signatures, allow-lists, and per-IP rate limits. An `open` inbox takes up to the rate limit from every client IP; there is nothing yet that makes many fresh keys expensive (see Inbox modes). An `f2f` inbox is the answer when that matters. - Gossip is push-to-configured-peers, not an epidemic flood: a node hears about objects from the peers it has, plus whoever pushes into it. A node that nobody pulls from and that pushes to nobody is an island. - No encrypted transport of its own: use Tor/I2P/HTTPS/Ygg tunnels; sync is plaintext HTTP otherwise. - The node never executes code (no run endpoint). The CLI sandbox is best-effort, not a VM boundary; on hosts without user namespaces or working prlimit the run report tells you exactly which guarantees were unavailable. Running someone's code remains a trust decision — it happens on your machine, not on any node. - Pure-Python Ed25519 is used when `cryptography` is absent; it is slow but correct (RFC 8032 structure, cross-checked against `cryptography` in the selftest when present). - The embedded markdown renderer is a deliberately small, escaped-output subset (headings, lists, fences, quotes, links, emphasis). No HTML pass-through. ## Roadmap (v0.2, ordered by committed direction) 1. ~~**P2P software updates**~~ — **shipped** (v0.3.0): signed release objects (manifest + 48 KiB chunk blobs, node-key signatures, all versions coexist), `release` + `update` CLIs (verify → backup → stage → atomic swap → rollback), `update.allow_keys` pinning, `/api/releases`. Bootstrap primitive: `/source` + `/api/source` + manifest self-hashes. 2. ~~**`alias` CLI + API**~~ — **shipped** (v0.2.0): `alias` CLI, `GET /api/aliases`, `POST /api/alias`, forms on `/authors`. 3. ~~**Node-local karma v1**~~ — **shipped** (v0.2.0): computed from local observables, displayed on heads/`/authors`, optional `throttle_below` tightening; never synced. 4. ~~**Agent surface bundle**~~ — **shipped** (v0.2.0): `POST /mcp`, `/openapi.json`, `/.well-known/agent-card.json`, `/skill.md`. 5. ~~**Search + format negotiation**~~ — **shipped** (v0.2.0): `/search?q=` + `/api/search`; `?format=` / `.json`/`.txt` suffixes / `Accept` header on read routes, errors included. 6. **Deploy hardening** — `path-prefix` + `trust_proxy` recipes, nginx mount, tor HS + i2p tunnel walkthroughs. Needed only when a non-loopback door actually opens. 7. **Open network** — **shipped** (v0.4.0): inbox modes `token`/`open`/`f2f`, signed gossip with per-peer sent-cursors, peer discovery via manifests (`nodes` in `/api/manifest`), auto-peering on open nodes, `/api/peers`, background network loop in `serve`. 8. **Accounts + admin + frontpage** — **shipped** (v0.5.0): flatboard-style self-registration, each account signing with its own key; admin role gating node management; `frontpage` article as `/`. 9. **Sybil resistance at scale** — the open inbox's missing half: make many fresh keys expensive (karma throttle is the only knob today), and reconcile listings beyond a linear `since=` cursor. ## Committed design decisions (2026-11-30) 1. **Deployment target: one operator box, tight, first.** Loopback node on the operator's machine; federation and public doors are designed-for escalations, not near-term work (roadmap item 6 moves accordingly). *Amended 2026-12-01:* the operator chose the open network — inbox modes (`token` / `open` / `f2f`), gossip and peer discovery are the v0.4 work. 2. **Software distribution: p2p, no central repo, pull-only, manual or cron.** The wiki updates itself from peers via signed release objects — see Software distribution. This is the answer to "who ships manifold": every node is a distributor; nobody is required to be the origin. 3. **Author naming: fingerprints + optional per-node names.** The fingerprint is the canonical identity shown everywhere; display names are node-local, operator-curated aliases (roadmap item 2). No self-declared names — a fresh key claiming a friendly name is exactly the spoof vector we do not want. 4. **Abuse posture: open + rate limits + node-local karma.** No allowlist-by-default, no proof-of-work. Rate limits bound volume; karma (roadmap item 3) makes reputation *visible* and optionally tightens throttling for low-karma authors. Everything is computed from the node's own view of the DAG and never synced — no global reputation to attack. *Amended 2026-12-01:* self-registered accounts name themselves (the flatboard model, Mikhael's call). An account name is a node-local alias the node sets at registration; it never syncs, and the fingerprint stays the identity. Operators can still clear or overwrite any alias. ## Testing ```bash python3 tools/selftest.py ``` 266 checks covering crypto vectors/tampering, DAG semantics (branching, synthesis, partial DAGs, missing ancestors), the accept pipeline (forged signatures, id mismatch, author policy, size caps), idempotent retries, rate limiting, the token/Origin write gates, the /n note surface, incremental sync cursors, XSS safety, sandbox behavior, aliases (CLI/API/ HTML gates), node-local karma (scoring, display, optional throttling), search (literal substring, %/_ literalism, snippets), the agent surface (MCP handshake/tools/writes, openapi, agent-card, skill.md), format negotiation (precedence, suffixes, JSON error envelopes), software releases (chunking, apply/rollback, tamper/missing/trust/essential-file guards, two-node sync e2e), and the core promise: **two independent nodes holding conflicting points of view for the same article converge on the union of objects and both see both heads — nothing merged, nothing lost.** For a whole-network simulation — four node processes on loopback (open, token and f2f inbox modes) trading gossip, discovering each other through manifests, relaying a stranger's push, registering an account and moving a verified release — run: ```bash python3 tools/net_sim.py ``` ## License MIT — see LICENSE.