Loading...

Build your own BitTorrent

Learn about .torrent files, the BitTorrent Peer Protocol and more

Start Building
bittorrent
Go
bittorrent
Python
bittorrent
Rust
bittorrent
C
bittorrent
C++
bittorrent
C#
bittorrent
Elixir
bittorrent
Haskell
bittorrent
Java
bittorrent
JavaScript
bittorrent
Kotlin
bittorrent
Ruby
bittorrent
Zig
bittorrent
TypeScript

BitTorrent is a peer-to-peer file sharing protocol used for distributing large amounts of data. In this challenge, you'll build a BitTorrent client that's capable of downloading a publicly available file using the BitTorrent protocol.

Along the way, you'll learn about the BitTorrent protocol, .torrent files more.

Stages

Decode bencoded strings
Login via GitHub to view this stage
Decode bencoded integers
Login via GitHub to view this stage
Decode bencoded lists
Login via GitHub to view this stage
Decode bencoded dictionaries
Login via GitHub to view this stage
Parse torrent file
Login via GitHub to view this stage
Calculate info hash
Login via GitHub to view this stage
Piece hashes
Login via GitHub to view this stage
Discover peers
Login via GitHub to view this stage
Peer handshake
Login via GitHub to view this stage
Download a piece
Login via GitHub to view this stage
Download the whole file
Login via GitHub to view this stage