nym-sdk
nym-sdk is the Rust SDK for the Nym mixnet. All modules share a common MixnetClient that manages gateway connections, Sphinx encryption, and cover traffic.
┌──────────────────────────────────────────────────────────────┐
│ Your Rust app (alice) │
│ └─ MixnetClient (Sphinx layering, cover traffic) │
│ └─ WebSocket to entry gateway │
│ └─ Nym mixnet (entry → 3 mix layers → exit) │
│ └─ MixnetClient (bob) │
│ └─ Your Rust app (bob) │
└──────────────────────────────────────────────────────────────┘Both sides run a MixnetClient. Sphinx encryption protects every hop end-to-end; neither gateway nor any mix node can link sender to receiver.
Full API reference: docs.rs/nym-sdk (opens in a new tab)
For an overview of what the SDK can do, see the Tour. For setup instructions, see Installation.
Modules
| Module | What it does | Status |
|---|---|---|
| Stream | Multiplexed AsyncRead + AsyncWrite byte streams over the Mixnet, the closest analogue to TCP sockets. | Recommended |
| Mixnet | Raw message payloads, independently routed, no connections or ordering. Full control over the communication model. | Stable |
| Client Pool | Keeps ready-to-use MixnetClient instances warm for bursty workloads. | Stable |
| TcpProxy | TCP socket proxying with session management and message ordering. | Deprecated |
| FFI | Go and C/C++ bindings. | Stable |
🚫
TcpProxy is deprecated. Use the Stream module for new projects.
Proxy-mode crates
For proxy-mode integrations (reaching third-party services through an Exit Gateway), see also:
smolmix:TcpStreamandUdpSocketover the Mixnet via a userspace IP stack. Compatible withtokio-rustls,hyper,tokio-tungstenite, and the rest of the async Rust ecosystem.- SOCKS Client: SOCKS4/4a/5 proxy via the Exit Gateway's Network Requester. Works with any SOCKS-capable application without code changes.