Torrent file

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
|subcat=File transfer
|subcat=File transfer

Revision as of 04:58, 12 December 2012

File Format
Name Torrent file
Extension(s) .torrent
MIME Type(s) application/x-bittorrent

A Torrent file is used by the BitTorrent protocol as a way of helping its users locate a file. BitTorrent is a peer-to-peer network with an ever-changing set of nodes that appear and disappear minute-to-minute as different users start and stop copies of the BitTorrent software. Special nodes called trackers are the point of contact to obtain files shared through the network, though the actual data of the file may be obtained in lots of little pieces spread over many nodes. A torrent file is the first thing you need to obtain before getting a file from BitTorrent; these can be found on many websites.

Torrent files are serialized using the Bencode system, and contain these keys:

  • announce - URL of tracker that knows where to find the file
  • info - Dictionary containing more info about the file:
    • name - Filename/suggested save path
    • piece length - bytes per piece; commonly 262,144 (256K)
    • pieces - Concatenation of SHA-1 hashes of pieces
    • length - File size in bytes, if only one file is being shared
    • files - List of file dictionaries if multiple files are being shared:
      • path - Subdirectory name list; last name is filename
      • length - File size in bytes.


Personal tools