#18 The beauty of BitTorrent
Eleven years before Travis Kalanick co-founded Uber, he started a company called Scour that did peer-to-peer file sharing. It was just before the dot-com bubble. As with most P2P services, the company was subjected to a 250 billion dollars lawsuit, forcing it to file for bankruptcy. Though Kalanick in his own words managed to use the remnants to start another P2P sharing company called Red Swoosh, which was acquired by Akamai in 2007.
Lawsuits against P2P sharing or facilitating companies are nothing new (Napster, BitTorrent, etc.) In fact, in recent years content producing companies have even started employing companies remotely to do dirty work for them. One such example is Aiplex based out of India, which claims to be an ‘anti-piracy’ company but confessed to having launched cyberattacks on torrent websites on the behalf of Bollywood companies. (Aiplex was then subjected to a DDoS attack in retaliation by one of the groups originally referred by ‘Anonymous’.)
Then came BitTorrent
One of the most simple and beautiful applications on the Internet is the BitTorrent protocol. It is also the most successful P2P protocol right now with more than 200 million monthly users, and by some accounts consumes more than 40 percent of the internet traffic.
The simple idea about BitTorrent is that a file is divided into small chunks, and then put on for download by an original user (a seeder). Files and chunks are identified by a special unique string (or hash value). Other users who want the file can use a special software that requests a portion of the file from users that have that portion. There is a special server called a tracker (sometimes not required, more on this later) that helps peers discover each other. A file with an extension of ‘.torrent’ or a special web link called a magnet link contains the metadata of a torrent (including the location of the tracker). This .torrent file or magnet link is hosted on torrent search websites (the most popular example of these being The Pirate Bay.) The major advantages with BitTorrent are that this distributes the burden of downloads to multiple peers rather than a single one, the downloads are resumable as all file chunks are independently fetched, and a security check for the integrity of file chunks to prevent malicious chunks from being injected.
Like most P2P systems, BitTorrent relies on users allowing upload requests from other users for free in exchange for them receiving their files. This requires some clever incentive engineering to work. BitTorrent tries to achieve a pareto efficiency by using a set of algorithms for file pieces and peer selection to allow downloads (since it is not possible to upload or download from all of hundreds or thousands of peers for a file). Peers generally upload to peers that allow downloads to them at the highest rate (and in that proportion) with a random peer added optimistically with the hope that they would help the current peer in the required upload (this is also called an optimistic unchoke). File pieces to be downloaded next are selected using the rarest available piece first strategy, except for the first random piece. In the case with peers done with their downloads, such peers where no one else is uploading from are given priority.
The use of a centralized tracker introduces a single point of failure and in some cases is easily subject to being shut down by law enforcement agencies. In 2009, The Pirate Bay shutdown its centralized tracker and replaced it with a Distributed Hash Table (DHT). A DHT using peers as nodes to store information about some of the other peers. For example with N peers, the number of peers being tracked by each node can be two, resulting in a circular network, requiring N/2 messages per query on an average or each peer can keep track of all other peers, and just a single message per query is required. Theoretically, it is possible to create a balanced design where the number of messages that need to be exchanged and the number of peers that need to be tracked by each node are both of the order of logarithmic in N (For a million nodes log N would be less than 20.)
Torrent uses, piracy, and privacy
Torrents have been frequently used in academia to distribute large files and datasets without bogging down a single university server. Though the most common use case has been downloads of pirated movies, books, and music. BitTorrent by design is not anonymous. In a research paper from 2010 (with a somewhat clickbaity title ‘Spying the World from your Laptop’ ), it is shown that it is simple to gather information about a majority of the users of BitTorrent.
The Pirate Bay has been the poster child of the debate over the legality of torrents, content distribution, and IP laws. There have been multiple court cases, raids, and a conviction resulting in a one-year jail term for its founders. As of 2020, the main domain and related proxies remain blocked by ISPs in several countries as mandated by the respective governments.
BitTorrent is the name of the protocol that is behind the P2P file sharing. It is also the name of the official client that allows people to use and download torrent files. It is also the name of the company started by the creator of BitTorrent, Bram Cohen. The company behind BitTorrent was recently acquired by a crypto startup. BitTorrent, the company has struggled for more than a decade to find paths of revenue. It tried to become an entertainment company rivaling Netflix, but could not. It tried to create a file-sharing app to compete with Dropbox but failed. The most recent plan before their acquisition was to be a medium of distribution for Hollywood movies to a wider audience (if it makes sense). It also created a live broadcast app and acquired one (though unclear if the release was the former or later.) BitTorrent is one of the rare startups which returned 17 million dollars of investor money in 2008 after it could not figure out what to do with it. There were layoffs at the company almost all the time.
One of the major disadvantages of torrents has been the wait time before you could use the content. In the case of pirated media content, a change in attitude with a new generation of users and new streaming services with affordability (in the case of music, some even free with ad support like Spotify) has essentially killed a lot of piracy. Platforms like Steam have been providing cheaper games for a long time now. PopcornTime was a product that allowed streaming of pirated movies like Netflix, using BitTorrent as the backend. BitTorrent is one of those rare technological breakthroughs that have been simple yet very effective at what they are trying to achieve. While the company could not find its way, the protocol created by Bram Cohen will continue to serve internet users.