HOME

TheInfoList



OR:

In the
BitTorrent BitTorrent is a Protocol (computing), communication protocol for peer-to-peer file sharing (P2P), which enables users to distribute data and electronic files over the Internet in a Decentralised system, decentralized manner. The protocol is d ...
file distribution system, a torrent file or meta-info file is a
computer file A computer file is a System resource, resource for recording Data (computing), data on a Computer data storage, computer storage device, primarily identified by its filename. Just as words can be written on paper, so too can data be written to a ...
that contains
metadata Metadata (or metainformation) is "data that provides information about other data", but not the content of the data itself, such as the text of a message or the image itself. There are many distinct types of metadata, including: * Descriptive ...
about files and folders to be distributed, and usually also a list of the network locations of trackers, which are computers that help participants in the system find each other and form efficient distribution groups called ''swarms''. Torrent files are normally named with the extension .torrent. A torrent file acts like a
table of contents A table of contents (or simply contents, abbreviated as TOC), is a list usually part of the Book design#Front matter, front matter preceding the main text of a book or other written work containing the titles of the text's sections, sometimes with ...
(index) that allows computers to find information through the use of a torrent client. With the help of a torrent file, one can download small parts of the original file from computers that have already downloaded it. These "peers" allow for downloading of the file in addition to, or in place of, the primary server. A torrent file does not contain the content to be distributed; it only contains information about those files, such as their names, folder structure, sizes, and cryptographic hash values for verifying file integrity. The torrent system has been created to ease the load on central servers, as instead of having individual clients fetch files from the server, torrent can crowd-source the bandwidth needed for the file transfer and reduce the time needed to download large files. Many free/freeware programs and operating systems, such as the various
Linux distribution A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s offer a torrent download option for users seeking the aforementioned benefits. Other large downloads, such as media files, are often torrented as well.


Background

Typically, Internet access is asymmetrical, supporting greater download speeds than upload speeds, limiting the bandwidth of each download, and sometimes enforcing bandwidth caps and periods where systems are not accessible. This creates inefficiency when many people want to obtain the same set of files from a single source; the source must always be online and must have massive outbound bandwidth. The torrent protocol addresses this by decentralizing the distribution, leveraging the ability of people to network "
peer-to-peer Peer-to-peer (P2P) computing or networking is a distributed application architecture that partitions tasks or workloads between peers. Peers are equally privileged, equipotent participants in the network, forming a peer-to-peer network of Node ...
", among themselves. Each file to be distributed is divided into small information chunks called ''pieces''. Downloading peers achieve high download speeds by requesting multiple pieces from different computers simultaneously in the swarm. Once obtained, these pieces are usually immediately made available for download by others in the swarm. In this way, the burden on the network is spread among the downloaders, rather than concentrating at a central distribution hub or cluster. As long as all the pieces are available, peers (downloaders and uploaders) can come and go; no one peer needs to have all the chunks or to even stay connected to the swarm in order for distribution to continue among the other peers. A small torrent file is created to represent a file or folder to be shared. The torrent file acts as the key to initiating downloading of the actual content. Someone interested in receiving the shared file or folder first obtains the corresponding torrent file, either by directly downloading it or by using a magnet link. The user then opens that file in a torrent client, which automates the rest of the process. In order to learn the internet locations of peers who may be sharing pieces, the client connects to the trackers named in the torrent file, and/or achieves a similar result through the use of
distributed hash table A distributed hash table (DHT) is a Distributed computing, distributed system that provides a lookup service similar to a hash table. Key–value pairs are stored in a DHT, and any participating node (networking), node can efficiently retrieve the ...
s. Then the client connects directly to the peers in order to request pieces and otherwise participate in a swarm. The client may also report progress to trackers, to help the tracker with its peer recommendations. When the client has all the pieces, the torrent client assembles them into a usable form. They may also continue sharing the pieces, elevating their status to that of ''seeder'' rather than an ordinary peer.


File Structure

A torrent file contains a list of files and integrity metadata about all the pieces, and optionally contains a large list of trackers. A torrent file is a bencoded
dictionary A dictionary is a listing of lexemes from the lexicon of one or more specific languages, often arranged Alphabetical order, alphabetically (or by Semitic root, consonantal root for Semitic languages or radical-and-stroke sorting, radical an ...
with the following keys (the keys in any bencoded dictionary are lexicographically ordered): * —the URL of the high tracker * —this maps to a dictionary whose keys are very dependent on whether one or more files are being shared: ** —a list of dictionaries each corresponding to a file (only when multiple files are being shared). Each dictionary has the following keys: *** —size of the file in bytes. *** —a list of strings corresponding to subdirectory names, the last of which is the actual file name ** —size of the file in bytes (only when one file is being shared though) ** —suggested filename where the file is to be saved (if one file)/suggested directory name where the files are to be saved (if multiple files) ** —number of bytes per piece. This is commonly 28 KiB = 256 KiB = 262,144 B. ** —a hash list, i.e., a concatenation of each piece's
SHA-1 In cryptography, SHA-1 (Secure Hash Algorithm 1) is a hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecimal digits. It was designed by the United States ...
hash. As SHA-1 returns a 160-bit hash, will be a string whose length is a multiple of 20 bytes. If the torrent contains multiple files, the pieces are formed by concatenating the files in the order they appear in the dictionary (i.e., all pieces in the torrent are the full piece length except for the last piece, which may be shorter). All strings must be
UTF-8 UTF-8 is a character encoding standard used for electronic communication. Defined by the Unicode Standard, the name is derived from ''Unicode Transformation Format 8-bit''. Almost every webpage is transmitted as UTF-8. UTF-8 supports all 1,112,0 ...
encoded, except for , which contains binary data. A torrent is uniquely identified by an ''infohash'', a
SHA-1 In cryptography, SHA-1 (Secure Hash Algorithm 1) is a hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecimal digits. It was designed by the United States ...
hash calculated over the contents of the dictionary in bencode form. Changes to other portions of the torrent do not affect the hash. This hash is used to identify the torrent to other peers via DHT and to the tracker. It is also used in magnet links.


BitTorrent v2

The BitTorrent v2 protocol (BEP-0052) introduces a new definition of the torrent file. The basic structure is: * —the URL of the tracker * —this maps to a dictionary whose keys are dependent on whether one or more files are being shared: ** —suggested directory name where the files are to be saved ** —number of bytes per piece. This is commonly 28 KiB = 256 KiB = 262,144 B. In v2, it must be a power of 2. ** —number, "2". ** —a tree of dictionaries. Each key represents a directory name or a file name. The file is *** —size of the file in bytes (only when one file is being shared though) *** —For non-empty files this is the root hash of a merkle tree with a branching factor of 2, constructed from 16KiB blocks of the file. *—A dictionary of strings, containing the new type of merkle root hashes for each piece. The new format uses
SHA-256 SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001. They are built using the Merkle–Damgård construction, from a one-way compressi ...
in both the piece-hashing and the ''infohash'', replacing the broken
SHA-1 In cryptography, SHA-1 (Secure Hash Algorithm 1) is a hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecimal digits. It was designed by the United States ...
hash. The "btmh" magnet link would contain the full 32-byte hash, while communication with trackers and on the DHT uses the 20-byte truncated version to fit into the old message structure. It is possible to construct a torrent file with only updated new fields for a "v2" torrent, or with both the old and new fields for a "hybrid" format. However, as a torrent would have different infohashes in v1 and v2 networks, two swarms would form, requiring special handling by the client to merge the two. A core feature of the new format is its application of merkle trees, allowing for 16KiB blocks of a piece to be individually verified and re-downloaded. Each file now always occupy whole piece sizes and have an independent merkle root hash, so that it's possible to find duplicate files across unrelated torrent files of any piece length. The file size is not reduced (assuming piece size stays the same; v2's tree structure allows larger pieces with fewer ill effects), but the dictionary required for magnet links are (only in v2-only torrents).


Extensions

A torrent file can also contain additional metadata defined in extensions to the BitTorrent specification. These are known as "BitTorrent Enhancement Proposals." Examples of such proposals include metadata for stating who created the torrent, and when.


Accepted extensions

These
extensions Extension, extend or extended may refer to: Mathematics Logic or set theory * Axiom of extensionality * Extensible cardinal * Extension (model theory) * Extension (proof theory) * Extension (predicate logic), the set of tuples of values t ...
have been deployed in one or more implementations as well as having been proven useful through consistent and widespread use. While they may require minor revisions, they are largely considered to be complete, only awaiting the blessing of
Bram Cohen Bram Cohen is an American computer programmer, best known as the author of the peer-to-peer (P2P) BitTorrent protocol in 2001, as well as the first file sharing program to use the protocol, also known as BitTorrent. He is also the co-founder of ...
in order to be elevated to the status of Final/Active Process.


Distributed hash tables

BEP-0005 extends BitTorrent to support
distributed hash table A distributed hash table (DHT) is a Distributed computing, distributed system that provides a lookup service similar to a hash table. Key–value pairs are stored in a DHT, and any participating node (networking), node can efficiently retrieve the ...
s, specifically
Mainline DHT Mainline DHT is the name given to the Kademlia-based distributed hash table (DHT) used by Comparison of BitTorrent clients, BitTorrent clients to find peers via the BitTorrent protocol. The idea of using a DHT for distributed tracking in BitTorrent ...
. A trackerless torrent dictionary does not have an key. Instead, a trackerless torrent has a key: For example, 'nodes': "127.0.0.1", 6881 your.router.node", 4804, The specification recommends that "should be set to the K closest nodes in the torrent generating client's routing table. Alternatively, the key could be set to a known good node such as one operated by the person generating the torrent."


Multiple trackers

BEP-0012 extends BitTorrent to support multiple trackers. A new key, , is placed in the top-most dictionary (i.e., with and )


HTTP seeds

BEP-0019 is one of two extensions allowing HTTP seeds to be used in BitTorrent. In BEP-0019, a new key , is placed in the top-most list. The client uses the links to assemble ordinary HTTP URLs – no server-side support is required. This feature is very commonly used by
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
projects offering software downloads. Web seeds allow smart selection and simultaneous use of
mirror site Mirror sites or mirrors are replicas of other websites. The concept of mirroring applies to network services accessible through any protocol, such as HTTP or FTP. Such sites have different URLs than the original site, but host identical or near-i ...
s, P2P or HTTP(S), by the client. Doing so reducing the load on the project's servers while maximizing download speed. automatically generates torrents with web seeds.


Private torrents

BEP-0027 extends BitTorrent to support private torrents. A new key, , is placed in the dictionary. This key's value is 1 if the torrent is private: Private torrents are to be used with a ''private tracker''. Such a tracker restricts access to torrents it tracks by checking the peer's IP, refusing to provide a peer list if the IP is unknown. The peer itself is usually registered to the tracker via a gated online community; the private tracker typically also keep statistics of data transfer for use in the community. Decentralized methods like DHT, PeX, are disabled to maintain the centralized control. A private torrent can be manually edited to remove the private flag, but doing so will change the info-hash (deterministically), forming a separate "swarm" of peers. On the other hand, changing the tracker list will not change the hash. The flag does not offer true privacy, instead operating as a
gentlemen's agreement A gentlemen's agreement, or gentleman's agreement, is an informal and legally non-binding wikt:agreement, agreement between two or more parties. It is typically Oral contract, oral, but it may be written or simply understood as part of an unspok ...
.


Draft extensions

These extensions are under consideration for standardization. Most are already widely adopted as ''de facto'' standards.


HTTP seeds

BEP-0017 extends BitTorrent to support HTTP seeds, later more commonly termed "web seeds" to be inclusive of
HTTPS Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). It uses encryption for secure communication over a computer network, and is widely used on the Internet. In HTTPS, the communication protoc ...
. In BEP-0017, a new key, , is placed in the top-most list (i.e., with and ). This key's value is a list of web addresses where torrent data can be retrieved. Special server support is required. It remains at Draft status.


Merkle trees

BEP-0030 extends BitTorrent to support Merkle trees (originally implemented in
Tribler Tribler is an open source decentralized BitTorrent client which allows anonymous peer-to-peer by default. Tribler is based on the BitTorrent protocol and uses an overlay network for content searching. Due to this overlay network, Tribler do ...
). The purpose is to reduce the
file size File size is a measure of how much data a computer file contains or how much storage space it is allocated. Typically, file size is expressed in units based on byte. A large value is often expressed with a metric prefix (as in megabyte and giga ...
of torrent files, which reduces the burden on those that serve torrent files. A torrent file using Merkle trees does not have a key in the list. Instead, such a torrent file has a key in the list. This key's value is the root hash of the Merkle hash: BitTorrent v2 uses a different type of Merkle tree.


Examples


Single file

A de-bencoded torrent file (with 256 KiB = 262,144 bytes) for a file (whose size is 678 301 696 bytes) might look like: Note: here would be a 51 KiB value ( \times 160 = 414080\ \mathrm).


Multiple files

A de-bencoded torrent file (with 256 KiB = 262144 B) for two files, and , might look like:


Hybrid, multiple files


See also

*
Glossary of BitTorrent terms This is a glossary of jargon related to peer-to-peer file sharing via the BitTorrent (protocol), BitTorrent protocol. Terms Availability :(Also known as distributed copies.) The availability of each piece in the torrent is defined as the numb ...
* Magnet links


References


External links


Official BitTorrent Specification

BitTorrent Definition
{{DEFAULTSORT:Torrent File BitTorrent Computer file formats