a70e68c7bd
* Smolmix documentation * Add smolmix docs: landing page, tutorials, and developer page links * Add Exit Gateway services page (NR vs IPR) and link from existing docs * Update auto-generated command and API outputs * Reorg of tutorials and architecture pages * License information + remove TODO from docs.rs visibile comment + reorg readme * Add versions file for doc-wide versioning * Relative -> absolute links * Relative -> absolute links * Update license + add old tutorial code as examples * Streamline smolmix docs * Clippy * Clean up doc comments * Last pass * Add larger file download to list * set new versions * Clippy * Remove blake pin from docs + add version range to root Cargo.toml * Format example logging * Remove crate blocked component * Loose whitespace * Add doc verification script for inline mdx * Formatting * Components regen * Reorg + tighten text * Voicing cohesion pass + remove bloated examples * Voicing cont. * Reduce max download size * Small suggested clarifications * Max/docs voicing consistency (#6769) * Reduce max download size * voicing consistency across docs * New landing order w smolmix * Tweaks * Final tweaks
54 lines
3.0 KiB
Plaintext
54 lines
3.0 KiB
Plaintext
---
|
|
title: "nym-sdk: Rust SDK for the Nym Mixnet"
|
|
description: "Rust SDK reference for building privacy applications on the Nym mixnet. Covers the Mixnet client, Stream multiplexing, Client Pool, FFI bindings, and code examples."
|
|
schemaType: "TechArticle"
|
|
section: "Developers"
|
|
lastUpdated: "2026-05-12"
|
|
---
|
|
|
|
# nym-sdk
|
|
|
|
import { Callout } from 'nextra/components'
|
|
|
|
`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.
|
|
|
|
```text
|
|
┌──────────────────────────────────────────────────────────────┐
|
|
│ 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.
|
|
|
|
<Callout type="info">
|
|
Full API reference: [**docs.rs/nym-sdk**](https://docs.rs/nym-sdk/latest/nym_sdk/)
|
|
</Callout>
|
|
|
|
For an overview of what the SDK can do, see the **[Tour](./rust/tour)**. For setup instructions, see [Installation](./rust/importing).
|
|
|
|
## Modules
|
|
|
|
| Module | What it does | Status |
|
|
|---|---|---|
|
|
| [**Stream**](./rust/stream) | Multiplexed `AsyncRead + AsyncWrite` byte streams over the Mixnet, the closest analogue to TCP sockets. | Recommended |
|
|
| [**Mixnet**](./rust/mixnet) | Raw message payloads, independently routed, no connections or ordering. Full control over the communication model. | Stable |
|
|
| [**Client Pool**](./rust/client-pool) | Keeps ready-to-use `MixnetClient` instances warm for bursty workloads. | Stable |
|
|
| [**TcpProxy**](./rust/tcpproxy) | TCP socket proxying with session management and message ordering. | Deprecated |
|
|
| [**FFI**](./rust/ffi) | Go and C/C++ bindings. | Stable |
|
|
|
|
<Callout type="error">
|
|
**TcpProxy is deprecated.** Use the [Stream module](./rust/stream) for new projects.
|
|
</Callout>
|
|
|
|
## Proxy-mode crates
|
|
|
|
For proxy-mode integrations (reaching third-party services through an Exit Gateway), see also:
|
|
|
|
- [**`smolmix`**](/developers/smolmix): `TcpStream` and `UdpSocket` over the Mixnet via a userspace IP stack. Compatible with `tokio-rustls`, `hyper`, `tokio-tungstenite`, and the rest of the async Rust ecosystem.
|
|
- [**SOCKS Client**](./rust/mixnet): SOCKS4/4a/5 proxy via the Exit Gateway's Network Requester. Works with any SOCKS-capable application without code changes.
|