Install
The client is the same binary as the node, invoked withclient mode:
- Pre-built binaries for Linux (x86_64, aarch64), macOS, Windows
cargo installfrom the published crate- Embedded as a library via the published Rust crate
First-run initialization
- Generates an iroh keypair under
~/.decdn/iroh.key. - Configures the L2 network — Arbitrum One (chain ID 42161).
- Loads or generates an Ethereum key at the location you specify.
- Writes a config at
~/.decdn/config.toml.
- Platform keychain (default) —
--eth-key keychain:com.example.client. macOS Keychain, Windows Credential Manager, Gnome Keyring. - Hardware wallet —
--eth-key ledger:0. - Safe smart wallet —
--eth-safe 0xSAFEADDRESS(client signs via Safe’s ERC-1271 path; see account management). Recommended for high-frequency or high-value clients. - File-based — discouraged. Plaintext keys in the filesystem leak to any process that reads the user’s home directory.
Fund your account
Clients pay in any allowlisted ERC-20 (USDC is the reference token) and need a little native gas for on-chain operations.Fetch a blob
- Bootstrap and peer table population (if not already cached).
- DHT
FIND_VALUEplus probe fan-out to candidates. - Selection by the unified score.
- Channel open with the selected node (auto-sized to fit
--max-budget-usdc). - Streaming with BLAKE3 verification.
- Vouchers signed on the configured cadence.
- Channel close + unspent USDC refund.
Common flags
| Flag | Effect |
|---|---|
--max-budget-usdc | Cap the channel deposit. Unspent amount refunds on close. |
--voucher-cadence-mb | How often to sign vouchers (default 1 MB; raise to 10 MB for large files) |
--max-channels | Multi-node parallel download (up to 4) |
--prefer-region | Region hint for selection (DE, US, etc.) |
--resume | Resume from the last BLAKE3-verified byte if a previous fetch crashed |
Resume after crash
Crash recovery is built in. State is persisted atomically under~/.decdn/downloads/<hash>/state.json. On --resume, the client:
- Reads
state.jsonto find the last verified byte offset. - Re-probes candidates (the original node may have evicted the blob).
- Requests
StreamRequest { offset_bytes: N }. - Continues voucher signing from the persisted nonce.
Multi-node parallel download
For large files (>~10 GiB), open multiple channels in parallel:- One channel per node.
- Breaks the file into chunks by file manifest; assigns chunks round-robin.
- Verifies each chunk’s BLAKE3 independently.
- Net savings grow past ~10 GiB at N=4; below that, single-channel is faster.
File manifests
Large files use a manifest blob:- The file is split into 256 MiB chunks, each a separate content-addressed blob.
- A manifest (postcard-encoded) lists the chunk hashes in order.
- The manifest’s own BLAKE3 hash is the canonical file ID.
Next steps
- Bootstrap — what happens during registry query and peer table seeding
- Account management — key custody options and Safe integration
- Payment channels — channel mechanics and voucher semantics