This one's swarm, a small BitTorrent client in Rust with no torrent libraries. I wanted to actually understand the protocol end to end.
What it does:
• parses .torrent files with its own bencode parser
• announces to the tracker over HTTP and reads the compact peer list
• speaks the peer wire protocol — handshake, bitfield, request/piece, over raw TCP
• pulls pieces block by block and verifies each against its SHA-1 before writing it to disk
• shows the swarm in a TUI: the piece grid filling in, per-peer have-bars, live speed
The SHA-1 is hand-rolled (it's what the spec uses for integrity), so the core has zero dependencies.
Hardest bit: the info-hash. You can't re-encode the parsed info dict and hash that key order/formatting can differ from the original because you have to SHA-1 the exact bytes as they sit in the file. Took me a while to spot why my hash didn't match.