Net
High-performance encrypted mesh runtime — the engine crate.
Most people should depend on a SDK, not on this crate directly:
Docs: https://ai2070.net/docs · Concepts · API reference · Design philosophy and benchmarks
Architecture
The protocol-level docs live alongside this crate, in docs/. They
describe what the wire actually does — the level below the user-facing guides
on the docs site.
| Doc | Covers |
|---|---|
TRANSPORT.md |
Wire format, the 64-byte header, encryption, packet pools, sessions, fair scheduling, multi-hop forwarding, routing, reliability, adaptive batching, failure detection, NAT traversal, swarm discovery |
IDENTITY.md |
Entity identity, origin binding, permission tokens and delegation |
CHANNELS.md |
Named hierarchical channels and capability-based authorization |
ORGANIZATIONS.md |
Org identity, admission modes, private discovery, revocation floors |
BEHAVIOR.md |
Capability announcements and indexing, diffs, node metadata, schema registry, autonomy rules, context fabric, load balancing, proximity graph, safety envelopes |
SUBNETS.md |
The four-level subnet hierarchy and gateway visibility |
SUBPROTOCOLS.md |
The subprotocol registry, ID space, version negotiation, opaque forwarding |
STORAGE_AND_CORTEX.md |
RedEX logs, CortEX folds, NetDB, durability |
COMPUTE.md |
Daemons, capability-based placement, six-phase migration |
DATAFORTS.md |
Greedy caching, data gravity, content-addressed blobs, directory transfer |
STATE.md |
Distributed state |
SENSING.md |
Capability sensing and interest coalescing |
CONTINUITY.md |
Observational continuity |
CONTESTED.md |
Contested environments |
CONFIG_REPLICATION.md |
RedEX replication configuration |
CAPABILITIES_SCHEMA.md |
The canonical capability axis schema — CI fails on drift |
AGENT_TOOLS.md |
AI tool calling |
cli/ |
net transfer, net-mesh typegen |
Design plans, code reviews and audits are in
docs/internal/ at the repo root — working history,
not documentation.
Features
No features are enabled by default. Opt in explicitly.
| Feature | Flag | Dependencies |
|---|---|---|
| Redis Streams | redis |
redis |
| NATS JetStream | jetstream |
async-nats |
| Net transport | net |
chacha20poly1305, snow, blake2, dashmap, socket2, ed25519-dalek |
NAT traversal (classifier + rendezvous + connect_direct) |
nat-traversal |
net |
| Port mapping (NAT-PMP inlined + UPnP-IGD) | port-mapping |
nat-traversal, igd-next |
| Regex filters | regex |
regex |
| C FFI | ffi |
— |
| RedEX (local append-only log) | redex |
net, tokio-stream, postcard |
| RedEX disk durability | redex-disk |
redex |
| CortEX (adapter core + tasks + memories) | cortex |
redex |
| NetDB (unified query façade) | netdb |
cortex |
| Dataforts (greedy + gravity + blob + RYW) | dataforts |
cortex, blake3, xxhash-rust |
| MeshDB (federated query AST + planner + executor) | meshdb |
cortex |
| MeshOS (cluster-behavior engine + behavior snapshot) | meshos |
cortex |
Building
Tests
Integration suites are per-feature — --test three_node_integration --features net,
--test integration_redex --features "redex redex-disk",
--test integration_netdb --features netdb, and so on. See
tests/ for the full set, and .github/workflows/ci.yml for the
matrix CI actually runs.
Benchmarks
See BENCHMARKS.md for published numbers and methodology.
Claude Code Skill
Net looks like Kafka or NATS from the outside, and the model underneath is different enough that an agent working from surface familiarity will write integration code that runs and is quietly wrong. Install the skills first:
Drop -g to install into the current project only. To update to the latest
version:
Restart Claude Code and run /skills — net-event-bus and net-payments
should be listed. Full install options in
Claude Skills.
Give the agent the source too
opensrc is a small tool that fetches a package's real source into a local cache for exactly this purpose:
Links
Docs · Concepts · API reference · GitHub
License
MIT OR Apache-2.0
Third-party license notice
The default net feature links ring for the
packet-path ChaCha20-Poly1305 AEAD. ring is distributed under an ISC-style
license together with notices for portions derived from BoringSSL and
OpenSSL/SSLeay; see the
ring LICENSE for the
full text. Binary distributions that bundle the compiled library (the published
Python wheels, npm prebuilds, Go FFI static libraries, and release binaries)
include ring's object code and should retain that notice alongside their own
license files.