Torrent file

From Wikipedia, the free encyclopedia

Not to be confused withTor (anonymity network).

(Learn how and when to remove these template messages)

relies too much onreferencestoprimary sources

Please improve this by addingsecondary or tertiary sources.

(Learn how and when to remove this template message)

may be tootechnicalfor most readers to understand

Pleasehelp improve ittomake it understandable to non-experts, without removing the technical details. Thetalk pagemay contain suggestions.

(Learn how and when to remove this template message)

(Learn how and when to remove this template message)

In theBitTorrentfile distribution system, atorrent fileis acomputer filethat containsmetadataabout files and folders to be distributed, and usually also a list of the network locations oftrackers, which are computers that help participants in the system find each other and form efficient distribution groups calledswarms.[1]A torrent file does not contain the content to be distributed; it only contains information about those files, such as their names, sizes, folder structure, andcryptographic hash valuesfor verifying file integrity. Depending on context, atorrentmay be the torrent file or the referenced content.

Torrent files are normally named with theextension.torrent.

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 BitTorrent protocol addresses this by decentralizing the distribution, leveraging the ability of people to networkpeer-to-peer, among themselves.

Each file to be distributed is divided into smallinformation chunkscalledpieces. Downloading peers achieve rapid 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 amagnet link. The user then opens that file in a BitTorrent client, which automates the rest of the process. In order to learn the Internet locations of peers which may be sharing pieces, the client connects to the trackers named in the torrent file, and/or achieves a similar result through the use ofdistributed hash tables. 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, it assembles them into a usable form. It may also continue sharing the pieces, elevating its status to that ofseederrather than ordinary peer.

A torrent file contains a list of files and integrity metadata about all the pieces, and optionally contains a list of trackers.

A torrent file is awith the following keys (the keys in any bencoded dictionary arelexicographically ordered):

this maps to a dictionary whose keys are 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:

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)

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 2

KiB = 256KiB = 262,144B.

ahash list, i.e., a concatenation of each piecesSHA-1hash. As SHA-1 returns a 160-bit hash,

will be a string whose length is a multiple of 160-bits. 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).

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

Theseextensionsare under consideration for standardization.

BEP-0005[3]extends BitTorrent to supportdistributed hash tables.

A trackerless torrent dictionary does not have anannouncekey. Instead, a trackerless torrent has anodeskey:

The specification recommends thatnodesshould be set to the K closest nodes in the torrent generating clients routing table. Alternatively, the key could be set to a known good node such as one operated by the person generating the torrent.

BEP-0012[4]extends BitTorrent to support multiple trackers.

A new key,announce-list, is placed in the top-most dictionary (i.e. withannounceandinfo)

BEP-0017[5]extends BitTorrent to support HTTP seeds.

A new key,httpseeds, is placed in the top-most list (i.e. withannounceandinfo). This keys value is a list of web addresses where torrent data can be retrieved:

BEP-0027[6]extends BitTorrent to support private torrents.

A new key,private, is placed in theinfodictionary. This keys value is 1 if the torrent is private:

BEP-0030[7]extends BitTorrent to supportMerkle trees. The purpose is to reduce thefile sizeof torrent files, which reduces the burden on those that serve torrent files.

A torrent file using Merkle trees does not have apieceskey in theinfolist. Instead, such a torrent file has aroot hashkey in theinfolist. This keys value is the root hash of the Merkle hash:

Here is what a de-bencoded torrent file (withpiece length256 KiB = 262144 bytes) for a filedebian-503-amd64-CD-1.iso(whose size is 678 301 696 bytes) might look like:

Note:pieceshere would be a 51 KiB value (lengthpiecelength160=414080bits\displaystyle \color Blue\left\lceil \color Black\frac \mathtt length\mathtt piece\ length\right\rceil \times 160=414080\ \mathrm bits ).

Here is what a de-bencoded torrent file (withpiece length256 KiB = 262144 B) for two files,111.txtand222.txt, might look like:

6a8af7eda90ba9f851831073c48ea6b7b7e9feeb…8a43d9d965a47f75488d3fb47d2c586337a20b9f

BEP-0003: The BitTorrent Protocol Specification.

BEP-0000: Index of BitTorrent Enhancement Proposals. Bittorrent.org

BEP-0005: DHT Protocol. Bittorrent.org

BEP-0012: Multitracker Metadata Extension. Bittorrent.org

BEP-0017: HTTP Seeding. Bittorrent.org

BEP-0027: Private Torrents. Bittorrent.org

BEP-0030: Merkle hash torrent extension. Bittorrent.org

Articles lacking reliable references from April 2010

All articles lacking reliable references

Wikipedia articles that are too technical from March 2017

All articles that are too technical

Articles needing expert attention from March 2017

All articles needing expert attention

This page was last edited on 6 October 2017, at 04:00.

Text is available under the; additional terms may apply. By using this site, you agree to theTerms of UseandPrivacy Policy. Wikipedia® is a registered trademark of theWikimedia Foundation, Inc., a non-profit organization.