Onion-routed Ethereum RPC for Anon-RPC: no single relay sees both your IP and your query.
Every time a wallet checks a balance or calls a contract, the request goes to an RPC provider together with the user’s IP address. That provider can link a real person to the exact addresses and contracts they care about. Most wallet traffic flows through a handful of large providers, so this is one of the biggest privacy leaks in Ethereum today, and it also exposes the strategies of trading bots and AI agents.
The Ethereum Foundation’s Anon-RPC standard lets a wallet plug in an anonymizing network: the network’s code is pinned by hash on-chain and runs in a sandbox. But the standard deliberately leaves the network itself open. It does not require multiple hops or independent operators, so a plugged-in network could still be a single operator who sees both who you are and what you ask.
Relay Mesh fills that slot with a real multi-hop network. The client wraps each JSON-RPC request in three layers of encryption, one per relay. The entry hop sees your IP but only ciphertext. The middle hop sees neither your IP nor the content. The exit hop opens the query but only knows the middle hop, not you. The response comes back sealed with a one-time key that only the client holds, so the entry and middle hops never see the reply either.
Relay Mesh is live: four relay hops, each deployed under its own Railway account, a public demo that runs a real request through the mesh and shows what each hop actually observed, and an Anon-RPC worker pinned by its keccak256 hash in a specifier contract on Sepolia. Any Anon-RPC harness can load and verify it. The repo documents the privacy claim with sources from the Anon-RPC specification, a “who sees what” table, and an honest list of limitations (same-team operators, no constant-size Sphinx packets yet, random delay rather than batch mixing).
Relay Mesh is a TypeScript pnpm monorepo with five packages: crypto, relay-node, client, demo and anon-rpc-worker.
Crypto. Each onion layer is a sealed box: an ephemeral x25519 key exchange (@noble/curves), HKDF-SHA256 (@noble/hashes) and XChaCha20-Poly1305 (@noble/ciphers). We chose the @noble libraries because they are pure JavaScript with no native bindings, so the exact same code runs in Node on the relays and in the browser. The innermost layer carries the RPC request plus a fresh 32-byte reply key; the exit encrypts the response with it, so only the client can read the answer. Requests and replies are padded to fixed size buckets so their length does not reveal the RPC method.
Relays. Each hop is a small Express server with one route, POST /relay. It peels its own layer and either forwards the inner ciphertext to the next hop or, as the exit, calls the RPC. The design is a chained reverse proxy with one onion per request, not persistent Tor-style circuits, which kept it simple enough to build and deploy in a weekend. Hops are hardened: they forward only to allowlisted hops, the exit calls only allowlisted HTTPS RPC targets, every upstream call has a timeout, the entry is rate-limited, and nothing is logged in plaintext unless an opt-in demo mode is on. GET /health reports each hop’s role, key fingerprint and build commit, so anyone can check that all hops run the same code.
Deployment. The four live hops run from one Dockerfile, each under a separate Railway account, so no single login controls the whole circuit. A script uses Railway CLI tokens to redeploy all accounts. The demo is a Next.js app on Vercel, but Vercel never handles relay traffic: the browser builds the onion and talks to the entry hop directly.
Partner technology: Ethereum Foundation Anon-RPC. We implemented the Anon-RPC worker interface (acceptCall and respond), bundled the worker, computed its keccak256, and deployed a WorkerSpecifier contract (Solidity, Foundry) on Sepolia that publishes workerHash() and the resolver URL. Using Anon-RPC means any compatible wallet can use Relay Mesh without Relay Mesh-specific code, and the hash pin means a harness rejects any tampered bundle. The worker honors anonOptions.isolationKey by choosing a stable 3-hop circuit per key from the hop pool, so calls under different keys use different circuits.
Notable hacks. We host the worker bundle on an orphan git branch at a content-addressed path (keccak/<first byte>/<rest of hash>) and serve it through raw.githubusercontent.com. The pinned hash makes that resolver safe to use even though it is untrusted. For the demo, each hop records what it actually observed (peer IP, byte counts, whether it saw plaintext) and seals that record to a key only the browser holds. The dashboard therefore shows real per-hop evidence, but no hop can read another hop’s record.
Testing. Vitest covers onion and reply round-trips, allowlist and timeout rejections, demo-mode sealing, and local 3-hop and 4-hop chains against a mock JSON-RPC server. All 21 tests pass offline.

