Skip to content
Back to the catalog
Project bittorrentNetworkingAdvancedComing soon

Build your own BitTorrent client

Build a BitTorrent client from scratch. Decode bencode, contact trackers and download a real file through the peer-to-peer protocol.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

BitTorrent is a complete distributed system you can build on your own: peer discovery, a binary protocol with a handshake, block transfer and integrity verification. And you check the result by opening the downloaded file.

You'll start by decoding a .torrent and finish downloading a real file from several peers at once, in parallel, checking every piece against its hash before writing it to disk.

Roadmap

12 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 13 stages

    Understanding the .torrent

    A bencode decoder, file metadata and the infohash.

  2. Phase 22 stages

    Finding peers

    Tracker queries and the list of available peers.

  3. Phase 34 stages

    Talking to a peer

    Handshake, protocol messages, and downloading one verified piece.

  4. Phase 43 stages

    Downloading the file

    Several peers in parallel, retries, and final assembly on disk.

Before you start

A working BitTorrent client: a bencode decoder, .torrent parsing and infohash computation, tracker communication, peer handshakes, the protocol messages (bitfield, interested, request, piece), parallel block downloads and SHA-1 verification of every piece.

  • mcp-server
    Beta

    Build your own MCP server

    Build an MCP server from scratch. Implement Model Context Protocol with JSON-RPC, tools and resources to connect AI clients to your programs.

    Intermediate5 stages~12 hNetworking
    MCPJSON-RPCagents+1

    TypeScript · Python · Go

  • dns-resolver
    Coming soon

    Build your own DNS resolver

    Build a DNS resolver from scratch. Encode and parse UDP packets, then resolve domain names by walking the hierarchy from root servers.

    Intermediate8 stages~9 hNetworking
    UDPbinaryprotocols

    Go · Rust · Python

  • http-server
    Coming soon

    Build your own HTTP server

    Build an HTTP server from scratch. Parse requests from socket bytes, manage connections and serve concurrent traffic with real HTTP responses.

    Intermediate10 stages~12 hNetworking
    socketsTCPHTTP+1

    Go · Python · C · Rust