TorJS — Tor in the Browser
An npm module that wraps the Arti Tor implementation into WebAssembly, providing
a fetch()-compatible API for network-level anonymization in any
JavaScript environment.
What is TorJS?
TorJS is an npm module that compiles
Arti — the
Tor Project's next-generation Rust
implementation of Tor — into WebAssembly. It exposes a standard
fetch()-compatible API, making it trivial for wallet SDKs, frontends,
and dApps to route requests through the Tor network with a simple toggle.
Why TorJS?
Even if you use PIR to hide what you are reading, the server still sees your IP address — and can correlate that with your identity. TorJS closes this gap by ensuring servers cannot learn who is making the request. Together, PIR + TorJS provide both dimensions of read privacy.
For the broader Ethereum ecosystem, TorJS means:
- Wallet SDKs can offer a "private mode" toggle that routes RPC calls through Tor — no external proxy needed.
- Frontends and dApps can protect users in censorship-heavy environments, accessing Ethereum RPC endpoints without revealing their location.
- Light clients can fetch state proofs anonymously, preventing servers from profiling which accounts a user tracks.
Features
Fast Bootstrap
A Brotli-compressed ~3 MB bundle replaces fetching thousands of micro-descriptors, fundamentally improving cold-start times compared to the standard Tor bootstrap method.
Censorship Resistance
Built-in Snowflake pluggable transport support. WebRTC-based bridges allow connectivity even under heavy network filtering. Native WebRTC transport is a Q2 priority.
Multi-Runtime
Works in browsers (WASM) and Node.js (with native socket access matching raw Rust performance). Pluggable storage backends (IndexedDB, localStorage) reduce bootstrap latency on repeat visits.
Current Status
TorJS has achieved end-to-end WASM functionality — a working prototype is live at tor-js-gateway.voltrevo.com with documentation at voltrevo.github.io/arti. The team is working with the Tor Project on reviewing and merging the WASM compatibility changes into upstream Arti.
What's Next: WebRTC Transport
TorJS currently relies on Snowflake WebSocket bridges to reach the Tor network from the browser. This works, but WebSocket bridges are centralized infrastructure — a small number of bridge operators carry all the traffic, creating a bottleneck and a single point of failure. Replacing WebSocket with WebRTC as the default transport would allow peer-to-peer connections between browsers, removing this centralizing effect. Domain fronting for peer discovery still applies, and the anti-censorship properties carry over. This is a Q2 priority for both the team and the Tor Project.