Magnet URI scheme

From Wikipedia, the free encyclopedia

The magnet: URI scheme is a draft open standard defining a URI scheme for magnet links, which are mainly used to reference resources available for download via peer-to-peer networks. Such a link typically identifies a file not by location or name, but by content, more precisely by the content's hash value.

Since it refers to a file based on content or metadata, rather than by location, a magnet link can be considered a kind of URN (as opposed to the more common URLs). Although it could be used for other applications, it is particularly useful in a peer-to-peer context, because it allows resources to be referenced without the need for a continuously available host.

The standard was developed in 2002, partly as a "vendor- and project-neutral generalization" of the ed2k: and freenet: URI schemes used by eDonkey2000 and Freenet, respectively, and attempts to follow official IETF URI standards as closely as possible. Applications supporting magnet links include Azureus, BearShare, DC++, gtk-gnutella, Kazaa, LimeWire, Morpheus, Shareaza, and TrustyFiles.

Contents

[edit] Use of content hashes

The most common use of magnet links is to link to a particular file based on a hash of its contents, producing a unique identifier for the file, similar to an ISBN or catalog number. Unlike traditional identifiers, however, content-based signatures can be generated by anyone who already has the file, and so do not need a central authority to issue them. This makes them popular for use as "guaranteed" search terms within the file sharing community where anyone can distribute a magnet link to ensure that the resource retrieved by that link is the one intended, regardless of how it is retrieved. (While it is technically possible that two files could have the same hash value, it is statistically very unlikely; see Cryptographic hash function).

Another advantage of magnet links is their open nature and platform independence: the same magnet link can be used to download a resource from one of any number of applications on almost any operating system. Because magnets are concise and plain-text, it is possible for users to simply copy-and-paste the links into emails or instant messages, a property not found in, for example, BitTorrent files.

[edit] Technical description

Magnet links consist of a series of one or more parameters, the order of which is not significant, formatted in the same way as the "query string" on the end of many HTTP URLs. The most common parameter is "xt", meaning "exact topic", which is generally a URN formed from the content hash of a particular file, e.g.

Image:Magnet-icon.gif magnet:?xt=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C

referring to the SHA-1 hash of the file in question. Note that although this refers to a particular file, a search must still be carried out by the client application to determine where, if anywhere, it can obtain that file.

Other parameters defined by the draft standard are:

  • "dn" ("display name"): a filename to display to the user, for convenience
  • "kt" ("keyword topic"): a more general search, specifying search terms rather than a particular file
  • "mt" ("manifest topic"): a URI pointing to a "manifest", e.g. a list of further items
  • application-specific experimental parameters, which must begin "x."

The standard also suggests that two parameters of the same type can be used by appending ".1", ".2", etc, e.g

Image:Magnet-icon.gif magnet:?xt.1=urn:sha1:YNCKHTQCWBTRNJIV4WNAE52SJUQCZO5C&xt.2=urn:sha1:TXGCZQTH26NL6OUQAJJPFALHG2LTGBC7


[edit] See also

[edit] External links