← work
[networking]2024-05-01

bittorrent-rust

Full BitTorrent client from the BEP-3 spec — bencoding, tracker protocol, peer handshake, concurrent piece downloading across multiple peers, SHA-1 integrity. A 20-year-old protocol that still gets efficient decentralized distribution right.

RustBitTorrentasync

Overview

A complete BitTorrent client implementing BEP-3: bencoding/decoding, torrent file parsing, HTTP tracker communication, peer handshake, and concurrent piece downloading with integrity verification.

Built as a CodeCrafters challenge. The interesting engineering is in the download pipeline: pieces are split into 16KiB blocks, requested in parallel across multiple peers using round-robin selection, and verified with SHA-1 before being written to disk.

Nothing novel here — this is a faithful protocol implementation. The value is in understanding how a 20-year-old protocol achieves efficient decentralized file distribution with a surprisingly minimal spec.