# Rings Network > Rings is a decentralized, browser-native structured peer-to-peer (P2P) and Sphinx onion network. Browser tabs and native daemons join one Chord DHT overlay, address each other by DID, exchange messages over direct WebRTC datachannels with zero central data servers, and route anonymous HTTPS/TCP traffic through multi-hop Sphinx/AEZ onion circuits—serving as an embeddable, browser-native alternative to Tor, I2P, and server-relayed overlays. Rust workspace, AGPL-3.0-only (commercial licensing available), https://github.com/RingsNetwork/rings. This file follows https://llmstxt.org/. It is for agents that evaluate Rings, build on it, or change it: which document is authoritative for what, how the crates are layered, how each target is built and tested, and which conventions a change must keep. Where this file and the code disagree, the code wins; correct this file in the same change. ## What Rings is - Overlay (communication layer): a Chord DHT (successor list, finger table, stabilization) keyed by DID with `network_id` overlay isolation. It provides authenticated O(log N) routing, replicated CRDT and relay-inbox storage, and end-to-end ElGamal stream encryption after a peer handshake. - Privacy layer: onion loops in `crates/node/src/onion`, client-sealed loops of fixed-width Sphinx cells over direct edges through pinned entry guards, with constant-rate link emission that substitutes real cells for cover, paid per-hop admission, fixed cell size classes, and route selection from the signed onion-relay and onion-exit directories. Each relay learns only its immediate predecessor and successor, while exits process payloads without learning the client identity. The layer contracts are defined in SECURITY.md under Layer Contracts. - Transport: WebRTC datachannels, native and browser (web_sys), with STUN/ICE/SDP and optional stateless signature+ECDH TURN relay (`rings-turn`, over UDP and TCP `?transport=tcp`) for NAT and UDP-blocked firewall traversal. Data flows directly peer to peer; seed nodes assist initial bootstrap discovery. - Identity: a DID derived from a public key. Signature schemes: secp256k1 (EIP-191, bip137), secp256r1 (P-256), ed25519, BLS; the browser console signs with WebCrypto P-256, MetaMask, or Phantom. DIDs pair short-lived session delegations with slot-isolated admission, with epoch-randomized ring placement (#780) and DRanking trust algebra (#748) on the 2.0 track. SECURITY.md is authoritative for security architecture claims. - Protocol runtime: `Protocol::step` is pure (state, event -> state, effects); an `Interpret` shell performs the effects through a namespace-scoped capability. Built-in protocols: relay (TCP/UDP tunnels over the overlay) and echo. Applications register their own by namespace: `provider.register_protocol(..)` in Rust, `provider.on(namespace, initialState, handler)` in JavaScript. - Targets: the native daemon (`rings` CLI with a JSON-RPC API over HTTP), the browser/Wasm node (npm `@ringsnetwork/rings-node`; the rings.rs frontend and its Chrome extension), and a C FFI (`crates/node/include/rings.h`). ## Status - Shipped in 1.0: the Chord overlay with range-proved finger convergence and non-transitive reachability healing, native and browser nodes, wire-versioned framing (`WIRE_VERSION = 4`), the onion privacy layer with client-sealed Sphinx/AEZ Kleisli pipelines (#834, TCP/HTTPS exits, TUN gateway, onion WebView), group-committed replay protection, slot-isolated resource accounting, per-origin rate quotas, clock-bounded CRDT removal stability, chain-replicated relay custody, DRanking service-receipt evidence collection, a public seed (https://node.rings.rs), and the hosted console (https://rings.rs/#node). - Roadmap: adaptive churn telemetry and tuning (#773-#779), followed by 2.0 epoch-randomized ring positions (#780) and DRanking decentralized trust ranking (#748). See ROADMAP.md. - To evaluate Rings, read README.md, SECURITY.md, and ROADMAP.md, in that order. ## Documentation - [Documentation book](https://rings.rs/docs/): the reference, including the comparison of Rings with Tor, I2P, Nym, libp2p, Nostr, and WebTorrent; source in `docs/src`, built with mdBook and published from master. - [Guide](https://rings.rs/#guide): the abridged version: one card per runtime and the first commands; the book is authoritative. - [README](https://github.com/RingsNetwork/rings/blob/master/README.md): overview, architecture table, examples, whitepaper citation. - [UPGRADING.md](https://github.com/RingsNetwork/rings/blob/master/UPGRADING.md): 1.0 frozen contracts (`WIRE_VERSION = 4`, delegation verification, C FFI ABI, control API) and operator upgrade checklist. - [SECURITY.md](https://github.com/RingsNetwork/rings/blob/master/SECURITY.md): security architecture, layer contracts, feature guarantees, deployment models, and vulnerability reporting. - [ROADMAP.md](https://github.com/RingsNetwork/rings/blob/master/ROADMAP.md): shipped foundations and the network-layer and privacy-layer tracks. - [Whitepaper](https://github.com/RingsNetwork/rings/blob/master/papers/rings.pdf): the unified protocol paper (`papers/rings.tex`), alongside the 2.0 DRanking paper (`papers/dranking.pdf`). - [JSON-RPC API](https://rings.rs/docs/jsonrpc.html): every method of the node API with curl examples. - [config.yaml](https://rings.rs/docs/advanced-topic/config.yaml.html): the complete generated node configuration, section by section. - [Operate a Node from the CLI](https://rings.rs/docs/cli.html): every `rings` subcommand and delegation rotation mode. - [Operator Observability](https://rings.rs/docs/operator-observability.html): bounded telemetry via `GET /status?view=observability`. - [Native Gateway](https://rings.rs/docs/native-gateway.html): selective IPv4/TCP TUN routing over onion loops and the `gateway-config-unix` helper. - [DNS Relay](https://rings.rs/docs/dns-relay.html): authoritative `.` DNS and IPv6 TCP ingress relay (`rings-dns-relay`). - [TURN Server](https://rings.rs/docs/turn-server.html): stateless signature+ECDH RFC 5766 TURN server over UDP and TCP (`rings-turn`). - [Mail Gateway](https://rings.rs/docs/mail-gateway.html): zero-custody `did@domain` SMTP receiver and encrypted DHT mailbox polling (`rings-mail-gateway`). - [Embed via C FFI](https://rings.rs/docs/ffi.html): the C ABI, its lifecycle and ownership rules, and the Python, Swift, and Kotlin wrappers. - [Browser Node and Extension](https://rings.rs/docs/browser-node.html): the hosted console, running the frontend locally, and packaging the extension. ## Source map - `crates/core`: Chord DHT, swarm, DID and elliptic-curve identity, message types, DHT storage bounds. Protocol only: application registries and descriptors live in `node`. - `crates/transport`: the WebRTC transports (`native-webrtc`, `web-sys-webrtc`), TURN-over-TCP client bridge, ICE candidate tier settling, and the `dummy` transport that topology tests run on. - `crates/runtime`: runtime contracts (`sleep`, `Spawner`, `TaskSet`, `run_blocking`, `MaybeSend`) shared across native Tokio and the browser JavaScript event loop, sitting below `rings-transport`. - `crates/node`: the node. Native daemon and CLI (`bin/rings.rs`, `src/native`), browser provider (`src/provider/browser`), FFI provider (`src/provider/ffi.rs`, feature `ffi`), extension runtime and built-in protocols (`src/extension`), mail gateway and recipient (`src/mail`), the privacy layer: onion loops, constant-rate link emission, paid admission, exit registry (`src/onion`), JSON-RPC handlers (`src/rpc_impl.rs`), seeds, peer quotas, registries. - `crates/rpc`: RPC types and the JSON-RPC client. Its protos are plain data mirrors of node types. - `crates/codec`: the postcard/serde wire codec. `crates/derive`: proc macros, including `wasm_export`. `crates/aez`: AEZ v5 wide-block tweakable enciphering and authenticated encryption used by Sphinx onion body carry (`native` and `wasm32`). - `crates/measure`: pure local peer credit, reliability, and DRanking provisional service-receipt evidence algorithms. `crates/network-policy`: the public-network admission policy for egress targets. `crates/dns-relay`: authoritative `.` DNS and IPv6 TCP ingress relay. `crates/gateway`: the native TUN gateway that carries selected TCP destinations over onion loops (vendored netlink under `vendor/`). `crates/webview`: onion-backed WebView gateway primitives. `crates/turn`: the stateless RFC 5766 TURN server (`rings-turn`) over UDP and TCP (`?transport=tcp`) for Symmetric NAT / CGNAT and UDP-blocked firewall traversal using `DelegateeKey`, `Did`, or `Account` signatures paired with secp256k1 ECDH-derived credentials. `crates/tui`: the interactive terminal UI (`rings-tui`) for node monitoring, status inspection, and button command execution. `crates/logo`: dependency-free mathematical geometry and OKLCH color solver that deterministically generates all canonical Rings SVG and JSON logo assets. `crates/test-support`: shared deterministic test utilities. - `frontend/`: the Yew/Wasm web app and Chrome MV3 extension, its own Cargo workspace; TypeScript glue in `extension-assets/` and `scripts/` is compiled from source. - `examples/`: `mailbox` (SMTP in, IMAP out, through a DNS relay or a mail gateway, and the mail gateway `rings-mail-gateway`), `native` and `relay` (workspace members), `dweb` (its own Yew workspace), `ffi` (Python, Swift, Kotlin wrappers and tests), `proof-demo`. - `docs/`: the mdBook (`book.toml`, `src/`, `theme/`). `papers/`: the whitepaper and formal companion papers. ## Build and test - Toolchain: `rust-toolchain.toml` pins the stable compiler (`cargo + install --locked rings-node`); a pin bump updates README.md, `crates/node/README.md`, `docs/src/install-a-native-node.md`, and `frontend/src/guide.rs`; formatting uses the pinned nightly rustfmt (`cargo +nightly-2026-07-02 fmt --all -- --check`). TOML is formatted with taplo; spelling is checked with typos. - Native: `cargo build`; `cargo test --profile ci --all --all-targets` (or `--release`; `--profile ci` preserves release overflow/assertion semantics and optimizes dependencies, `rings-core`, and `rings-aez` at `opt-level = 3` without full LTO, see `.github/CI.md`); install the CLI with `cargo install --path crates/node`, then `rings init` and `rings run`. - Wasm: `cargo clippy -p rings-node --features browser --no-default-features --target wasm32-unknown-unknown`; the npm package is built by `wasm-pack build crates/node --release --scope ringsnetwork -t web --no-default-features --features browser_default` (`npm run wasm_pack`); browser tests use wasm-bindgen-test in headless Chrome. - Frontend (from `frontend/`): `cargo check --target wasm32-unknown-unknown`; `cargo clippy --target wasm32-unknown-unknown --all-targets -- -D warnings`; `cargo test --release --target wasm32-unknown-unknown`; `trunk serve --release true` to run it. Extension: `npm ci --ignore-scripts && npm run package:frontend-extension` from the root. - FFI: `cargo build -p rings-node --features ffi`; `RINGS_FFI_REQUIRE_LIBRARY=1 pytest examples/ffi/tests`. - Docs: `mdbook build docs`; `mdbook serve docs` to preview. - Decode-boundary smoke: set `RINGS_DECODE_BOUNDARY_SEED` and `RINGS_DECODE_BOUNDARY_CASES`, then run the `decode_boundary` test filters for `rings-core`, `rings-transport`, and `rings-node`. - Gates a change must pass (`.github/workflows/qaci.yml`): clippy with `-D warnings` on the native, wasm, and ffi feature sets; `cargo +nightly fmt --check`; rustdoc with `-D warnings`; `taplo format --check`; typos; cargo-deny; Miri on core invariants; the native, wasm, frontend, dweb, gateway, and generated decode-boundary test suites; the docs build. ## Conventions - Layering: `core` is protocol only; application registries and descriptors live in `node`; `rpc` protos are plain DTO mirrors. Check every new type's vocabulary against the crate it lands in. - Pure core, imperative shell: keep state transitions pure and explicit, represent effects as data, and confine IO to the interpreter that runs them. - Lints are declared in the workspace `[lints]`: `unwrap_used`, `expect_used`, `panic`, `todo`, `unimplemented`, and `indexing_slicing` are denied on production paths. Fix the underlying structure (a struct for many arguments, `Box` for a large enum variant) rather than suppressing lints. - Imports: one item per `use` line, no glob imports. Prefer method forms (`deref()`, `as_ref()`, `as_slice()`, `clone()`) to `&` and `*` in expressions. - Tests are deterministic: wait for a concrete event (a generation counter, a channel message, a state predicate) and run topology tests on the `dummy` transport. - Comments and docs explain why, not what. When a behaviour or boundary changes, update every comment and document that states it in the same commit. - Commit messages, pull requests, and reviews are written in English. The workspace version in `Cargo.toml` is bumped with user-visible changes. - License: AGPL-3.0-only for every crate, the frontend, and the npm package (`LICENSE`, the `license` fields, `deny.toml`). Derived works and network services built on Rings publish their source under the AGPL; a commercial license is available from Rings Network on request. ## Optional - [crates.io: rings-node](https://crates.io/crates/rings-node), [docs.rs](https://docs.rs/rings-node), [npm: @ringsnetwork/rings-node](https://www.npmjs.com/package/@ringsnetwork/rings-node). - [Releases](https://github.com/RingsNetwork/rings/releases): prebuilt `rings` for macOS (x86_64, aarch64) and Linux (x86_64 musl, aarch64 gnu), and the wasm package; one-line installer at `install.sh` (https://rings.rs/install.sh) and static service templates under `contrib/`. - Public seed node: https://node.rings.rs. Its external handshake (`nodeDid`, `answerOffer`) is public; status and control methods use its Bearer token. - Official X (Twitter) account: https://x.com/RingsNetworkio. --- # Rings Network **Rings is a peer-to-peer network for the sovereign age.** Browser tabs and native daemons join a unified Chord DHT overlay, address each other by DIDs, and communicate over direct WebRTC datachannels with no application server in the data path. Bootstrap and signaling establish the initial peer links, with optional TURN relay support when configured. The overlay layer provides authenticated DID routing and end-to-end ElGamal stream encryption after a peer handshake, while the privacy layer provides anonymous Sphinx onion circuits that bound what each relay can learn to its immediate predecessor and successor; see the [security model](https://github.com/RingsNetwork/rings/blob/master/SECURITY.md#layer-contracts). On top of the overlay, Rings gives applications a namespace-scoped protocol runtime. A protocol is a pure state machine; its interpreter shell performs the side effects, and only within its own namespace. Built-in protocols cover peer service relay and echo; yours are registered under a namespace of their own. Rings is written in Rust and compiles to native binaries and to WebAssembly, so the same node runs in a terminal, in a browser tab, and inside a host that speaks C. This book is the reference for all three; the [Guide](https://rings.rs/#guide) on the site is its short form. ## Where Rings fits ✅ supported · ❌ not provided. Qualifications are listed below the table. | Network | Browser P2P | Structured P2P | Privacy layer | E2E encryption | |---|:---:|:---:|:---:|:---:| | **Rings** | ✅ | ✅ Chord | ✅ Separate layer | ✅¹ | | **libp2p** | ✅ | ✅ Kademlia² | ❌ | ✅³ | | **aMule / Kad** | ❌ | ✅ Kademlia | ❌ | ❌⁴ | | **Nostr** | ❌ | ❌ | ❌ | ✅⁵ | | **Nym mixnet** | ❌ | ❌ | ✅ Full mixnet path | ✅⁶ | | **Tor** | ❌ | ❌ Relay network | ✅ Onion circuits | ✅⁷ | | **I2P** | ❌ | ✅ netDb² | ✅ Tunnel network | ✅⁶ | | **WebTorrent (browser)** | ✅ | ❌ | ❌ | ✅³ | Browser P2P means the browser itself connects as a peer; a browser UI or gateway client does not qualify. Structured P2P includes DHT-based discovery; it does not imply that application traffic is routed through the DHT. Privacy means network metadata protection, separate from payload encryption. 1. Rings authenticates every overlay message by DID signature and provides E2E ElGamal stream encryption after a peer handshake. 2. libp2p offers an optional Kademlia DHT. I2P uses a Kademlia-based netDb for discovery; messages travel through tunnels. 3. Encrypted peer connections: libp2p includes circuit-relayed connections; browser WebTorrent uses WebRTC/DTLS. 4. aMule protocol obfuscation is transport-level only. This row covers Kad; eD2k uses indexing servers. 5. Nostr supports encrypted direct messages, such as NIP-44 payloads, alongside public signed events. 6. Between Nym clients or I2P destinations; traffic to external services uses application-layer TLS/HTTPS. 7. Tor provides end-to-end encryption for onion services and pairs with HTTPS for external websites. ### Primary sources
Sources for the comparison - **Rings:** [security model](https://github.com/RingsNetwork/rings/blob/master/SECURITY.md#layer-contracts). - **libp2p:** [WebRTC](https://libp2p.io/docs/webrtc/), [Kademlia DHT specification](https://github.com/libp2p/specs/blob/master/kad-dht/README.md), [encrypted circuit-relay connections](https://libp2p.io/docs/circuit-relay/). - **aMule:** [eD2k/Kad](https://wiki.amule.org/wiki/FAQ_eD2k-Kademlia), [browser remote control](https://wiki.amule.org/wiki/AMuleWeb), [protocol obfuscation](https://wiki.amule.org/wiki/AMule_is_slow). Obfuscation targets protocol classification rather than a secure E2E messaging contract. - **Nostr:** [NIP-01 client/relay protocol](https://github.com/nostr-protocol/nips/blob/master/01.md), [NIP-44 encrypted payloads](https://github.com/nostr-protocol/nips/blob/master/44.md). - **Nym:** [mixnet design](https://nym.com/nym-whitepaper.pdf), [browser SDK](https://nym.com/blog/introducing-the-nym-sdk-powerful-privacy-served-directly-to-your-browser), [client-to-client encryption](https://nym.com/blog/nym-gateways-gateways-to-privacy). - **Tor:** [relay network](https://community.torproject.org/relay/types-of-relays/), [onion-service E2E encryption](https://community.torproject.org/onion-services/overview/), [HTTPS and exit traffic](https://support.torproject.org/about-tor/security/https-encryption-and-tor/). - **I2P:** [Kademlia-based network database](https://i2p.net/en/docs/overview/network-database/), [tunnels and destination-to-destination encryption](https://i2p.net/en/docs/overview/intro/). - **WebRTC standards:** [ICE, RFC 8445](https://www.rfc-editor.org/rfc/rfc8445), [IP address handling, RFC 8828](https://www.rfc-editor.org/rfc/rfc8828), [data channels, RFC 8831](https://www.rfc-editor.org/rfc/rfc8831), [DCEP, RFC 8832](https://www.rfc-editor.org/rfc/rfc8832). - **WebTorrent (browser):** [browser-to-browser WebRTC and tracker discovery](https://webtorrent.io/faq), [WebRTC data-channel encryption](https://www.rfc-editor.org/rfc/rfc8831). The row covers browser peers, not the native client's DHT support. Sources checked September 22, 2026.
## Choose a runtime | Runtime | Start with | |---|---| | Native node | [Install](install-a-native-node.md), then [Host a Native Node](host-a-native-node.md) and [Operate a Node from the CLI](cli.md) | | Browser (Wasm) node | [Build for Wasm](build-for-wasm.md) and [Browser Node and Extension](browser-node.md) | | Another language | [Embed via C FFI](ffi.md) | | An AI coding agent | [llms.txt](llms.md) | If you are new to Rings, start with a native node: it is the shortest path to a running peer and to the JSON-RPC [API](jsonrpc.md) every runtime shares. ## How it works - [Architecture](advanced-topic/architecture.md): the layers, from transport to application. - [How handshake works](advanced-topic/handshake.md) and [Exchange SDP](advanced-topic/exchange-sdp.md): how two peers open a datachannel. - [DHT - Network Layer](advanced-topic/chord.md): routing and lookup on the Chord ring. - [Account Abstraction](advanced-topic/account-abstraction.md): DIDs and the signature schemes behind them. - [config.yaml](advanced-topic/config.yaml.md): every section of a native node's configuration. ## Beyond the book - [Rings whitepaper](https://github.com/RingsNetwork/rings/blob/master/papers/rings.pdf): the unified protocol specification. - [Security model](https://github.com/RingsNetwork/rings/blob/master/SECURITY.md): cryptographic identity and delegation, deployment models, and the contracts of the communication and privacy layers. - [Roadmap](https://github.com/RingsNetwork/rings/blob/master/ROADMAP.md): where the network layer and the privacy layer are heading. - [Source on GitHub](https://github.com/RingsNetwork/rings): the code, examples, and issues. - [License](https://github.com/RingsNetwork/rings/blob/master/LICENSE): AGPL-3.0-only, so a product or hosted service built on Rings publishes its source; a commercial license for use outside those terms is available on request.