 When we were discussing peer-to-peer softwares, we just stopped short of discussing the most widely used peer-to-peer application for file sharing that is known as BitTorrent. In this module, we shall define what BitTorrents are, how does it work, what are the most important entities, and then we will appreciate how elegantly it is able to show improving efficiency as the number of users and the file share between them increases. BitTorrent by formal definition is a peer-to-peer file sharing software. This is an extension to the music sharing software such as Napster, Kaza and Nutella. However, it comes with so many variants and so many algorithmic enhancements that it has become the most widely used and the de facto standard for file sharing today. In BitTorrents, the most important entity is a peer that is known as a torrent. The torrent is essentially a collection of peers that interact together and do file sharing. The important thing here is that the number of users or the peers in a torrent can vary fluctuate over time, but the efficiency of the system over time always increases. There's a central entity that is known as a tracker that keeps a track and record of all the active peers and it also notices the chunks which are available with the peers. In BitTorrents community, the file which is shared between the peers is in the form of a piece of file also known as the chunk. So the tracker keeps record of each peer holding a certain chunk. There is a centralized file called the torrent file. It comes with dot torrent extension. It is mainly used to do the bookkeeping of all the hash functions. We'll shortly see what hash functions are. So the torrent file keeps track of the hash functions which are all associated with the chunks. So when the peers download or upload chunks, a cross validation or verification mechanism is required to see if all the chunks have been downloaded and these chunks are actually of the same source file. The verification mechanism which is based on the hash function is nothing but a simple algorithm that takes input in the name of the file, the size of the file, the user who is holding the file of all these different combinations, a certain hash function is created. Now this hash function is unique to the input parameters and consequently it is not reversible. So when a certain peer downloads a chunk, it compares the hash function obtained digest, we call it the message digest. So the peer compares the message digest that it receives with the chunk to the digest which is available in the torrent file. So through this mechanism it is verified if the chunk is original and it is part of the same file. This is the overall picture in which a user is shown to be connected to a torrent network such that it is able to download and upload resources or the chunks between different peers. As you can see that the activity of discovering other peers is always done through the tracker and the file size here is small known as a chunk. An interesting extension or we can say this the algorithmic enhancement that has been done to the torrents which have resulted into the success is the elegant mechanism through which a peer chooses another peer. It is called unjoking and incrementally determines which other peers are going to be the best pairs for it to exchange the files. This is going to be pretty complex and interesting but we'll stop it for now.