rlibtorrent
The front door. Re-exports the engine so a consumer depends on ONE name instead of nineteen; holds no behaviour of its own (ADR-0031).
One crate covers the protocol, peers, trackers, DHT and storage. Inside rbittorrent, it finished first in all 20 races against qBittorrent, Deluge and rTorrent.
use rlibtorrent_daemon::{
ControlListen, Listen, Mechanisms, WebListen, start,
};
let started = start(
Listen::default(),
&checkpoints,
ControlListen::default(),
WebListen::default(),
None,
Mechanisms::default(),
)
.await?;
println!("engine embedded in-process:");
println!(" peer-wire listener: {}", started.local_addr());
println!(" control surface: {}", started.control_addr());
let report = started.stop().await?;Measured inside rbittorrent. Each number is the middle of 5 runs.
Seeders
One torrent
4 clients, started together
One race at real speedSSD · no tracker delay, run 1 of 5
1.3 sRaces won of 20
SSD · no tracker delay
SSD · 5 s tracker delay
HDD · no tracker delay
HDD · 5 s tracker delay
Time to download every piece and check it.
Races won of 20
SSD · no tracker delay
SSD · 5 s tracker delay
HDD · no tracker delay
HDD · 5 s tracker delay
Share of all the data the clients uploaded to each other in the first 60 s.
SSD · no tracker delay
SSD · 5 s tracker delay
HDD · 5 s tracker delay
Time from fetching the torrent until the tracker let the client in.
Adding a torrent took 4.87 ms, start to finish. The engine's own steps, in colour, took 2.38 ms. Median of 5 runs on the SSD.
30 crates in all. The rlibtorrent crate brings 19 of them.
What a caller touches7
The engine4
The protocol5
The network8
Labs and tools5
Beyond BitTorrent1
rlibtorrent
The front door. Re-exports the engine so a consumer depends on ONE name instead of nineteen; holds no behaviour of its own (ADR-0031).
rlibtorrent-types
Hashes, digests, Merkle arithmetic, and the parse budgets every other crate is held to.
rlibtorrent-bencode
The bencode parser and canonical encoder, with raw-span preservation so an info hash is taken over the bytes as received.
rlibtorrent-metainfo
.torrent files: v1, v2 (BEP 52), hybrid, path sanitisation, and torrent creation.
rlibtorrent-magnet
Magnet links, including hybrid btih plus btmh topics.
rlibtorrent-peer-wire
The peer protocol on the wire: handshake, framing, and the BEP 6/9/10/11 extensions.
rlibtorrent-peer-session
What a connection is allowed to do: the state machine, availability, and the request pipeline.
rlibtorrent-storage
Torrent offsets to file ranges, the storage backend contract, and the resume checkpoint.
rlibtorrent-session
The policy engine: piece picking, choking, queueing, share limits, and categories.
rlibtorrent-tracker
HTTP and BEP 15 UDP announces, BEP 12 tiers, and the SSRF policy an announce is held to.
rlibtorrent-dht
BEP 5 with BEP 32 IPv6, routing table and lookups, socketless so a caller owns the UDP.
rlibtorrent-discovery
Where candidate peers come from, and the policy deciding which sources a torrent may use.
rlibtorrent-transport
TCP, SOCKS5, and the dial path every outbound connection shares.
rlibtorrent-utp
uTP and LEDBAT congestion control.
rlibtorrent-mse
Message Stream Encryption.
rlibtorrent-portmap
UPnP and NAT-PMP port mapping.
rlibtorrent-http
The HTTP client, its TLS trust decisions, and the SSRF policy shared with the tracker.
rlibtorrent-driver
The coordinator: the one place sockets, storage, discovery and the session meet.
rlibtorrent-api
The native control and event surface, its wire codec, and the delta stream.
rlibtorrent-webapi
The qBittorrent-compatible Web API contract, sans-io: no framework, no socket.
rlibtorrent-daemon
The executable, and the only crate that binds the Web API to a real HTTP transport.
rlibtorrent-capi
The C ABI, and the generated header a C or C++ caller links against.
rlibtorrent-qbt
Reading a real qBittorrent profile, read-only.
lab/rlibtorrent-lab
The deterministic lab: virtual clock, seeded RNG, bounded runner, scripted peers.
lab/oracle-libtorrent
Two pinned libtorrent builds (2.0.14 and 1.2.20) driven as subprocess oracles.
lab/oracle-rqbit, lab/oracle-transmission
Two further independent implementations to differ against.
rlibtorrent-rss
RSS and Atom feeds, and the auto-download rules that turn articles into torrents.
LunarWerxs/rlibusenet
Usenet, its own repository since ENG-12 (2026-09-18): NZB reading, article fetching, yEnc, PAR2, unpack and the job pipeline; this engine consumes it pinned by rev.
xtask
The evidence machine: the ledger, the milestone state machine, and verify.
Each one runs with cargo run.
examples/embed-daemonThe daemon, embedded in your own binary.
examples/parse-and-build-torrentBuild a .torrent, parse it back, derive a magnet link.
examples/seed-and-downloadTwo engines in one process: one seeds, one downloads.
Building rlibtorrent into a product or service you sell needs a licence. See what it's worth and how the licence works.