Magnet URI scheme

From Shareaza Wiki
Revision as of 12:46, 17 January 2014 by Han (talk | contribs)
Jump to navigation Jump to search

For information regarding how to use magnet links, see Magnet link.

  Translation

Do not translate this page into other languages. It is either low priority, too specific or incomplete.

e
  Updated:

This page has been updated on 2010-07-20 for the release of Shareaza v2.5.x.x.

e
  Stable Content

The information on this page should apply to all Shareaza versions provided there are no major changes.

e


The magnet: URI scheme is an standard defining an  URI scheme for so called Magnet links. These links are mainly used by P2P applications to refer to files (normally by their hash value) located into their respective networks. As of today, Magnets are the second most used P2P link worldwide (after torrents).

Note that this page is thought to give an overview over the Magnet URI scheme. For further information, have a look at the  Magnet URI scheme page on Wikipedia, which contains very detailed information on the subject.

Supporting Clients and Networks

Magnet links are supported by lots of P2P applications, including for example the following:

  • aMule (eD2k)
  • DC++ (DC network)
  • FrostWire (gnutella)
  • gtk-gnutella (gnutella)
  • Kazaa (FastTrack)
  • Morpheus (gnutella, G2)
  • Phex (gnutella)
  • Shareaza (eD2k, gnutella, G2, BT)
  • Sharelin (G2)
  • uTorrent (BT)
  • Vuze (BT)

As can be easily seen, Magnet links are not limited to one or to an other network, as eD2k links or gnutella links for example.

Referring to Files by their Hashes

Magnet links mostly use file hash sums to refer to a specific file inside a P2P network. These hash sums are similar to an (almost) unique fingerprint of a file and can only hardly be spoofed. Once a compatible client gets the information contained in a Magnet link, it starts searching the network using the provided hashes. This returns exactly the file the link refers to which is/can be downloaded afterwards.

An additional advantage of Magnet links is their platform independence and plain text format: Almost on all operating systems exist applications that support these links which makes it possible to download the linked-to contents from almost everywhere. Also, it is possible to copy/paste these links into emails or instant messages, which makes it very easy to send them for example to friends or other people that might be interested. This gives these links an enormous advantage compared to .torrent files because these files are much harder to edit or transmit to others.

Technical Details

Magnet links are based on a series of parameters, which can be used in any combination and order including information about one or several files. These parameters (also called tokens) can specify almost everything, from hashes of one or several files to their names or fix sources. Each token starts with a question mark followed by a two letter token code and the value of the respective token. The most common parameter is "xt" (meaning "exact topic") which contains generally a content hash of the respective file the link points to. It can be used several times.

An (incomplete) list of available tokens can be seen here:

  • "as" (acceptable source): a source to be queried after not being able to find and download the file in the P2P networks in a defined amount of time. Most applications however treat this token exactly the same as the "xs" token.
  • "dn" (display name): a filename for the file to download
  • "kt" (keyword topic): specifys search terms instead of a particular file
  • "mt" (manifest topic): a URI pointing to a "manifest", e.g. a list of further items (rarely used because mostly obsolete)
  • "xl" (exact length): the size in bytes of the file
  • "xs" (exact source): a fixed source for the file. This is usuable an HTTP link
  • "xt" (exact topic): contains one or several hash values of a file. Can be used several times (hashes must be from the same file)
  • Each application can add specific experimental parameters, which must begin "x." to identify their experimental caracter

An example for a magnet URI is the following (it points to the installer of Shareaza v2.4.0.0):

magnet:?xt=urn:bitprint:XZBS763P4HBFYVEMU5OXQ44XK32OMLIN.HGX3CO3BVF5AG2G34MVO3OHQLRSUF4VJXQNLQ7A
&xt=urn:ed2khash:aa52fb210465bddd679d6853b491ccce&xl=6745696&dn=Shareaza_2.4.0.0.exe
&xs=http%3A//195.123.7.32%3A6344/uri-res/N2R%3Furn%3Asha1%3AXZBS763P4HBFYVEMU5OXQ44XK32OMLIN

Including fixed sources

Using the xs tag, sources can be appended to a Magnet link. This can include http, https and ftp links, as well as sources inside of file sharing networks.

To include a source inside a file sharing network, the following syntax can be used:

&xs=http%3A//IP%3Aport/uri-res/N2R%3Furn%3Asha1%3ASHA1-hash

Note that the parameter of the &xs tag needs to be URL encoded. With normal encoding, it would look like this:

http://IP:port/uri-res/N2R?urn:sha1:SHA1-hash

The included IP can be replaced by a dynamic domain service URL, such as an account on DynDNS, for example.

Using the freebase cache

The freebase.be cache is maintained by Jonne and acts like a tracker on BitTorrent, only for files on the gnutella and Gnutella2 network. By appending the following string to your Magnet link, clients checking it out as an alternate source will be known to others doing the same at a later time:

http%3A//cache.freebase.be/SHA1-hash

See also

External links

  •  Magnet URI scheme on Wikipedia
  • MAGNET-URI Project Web-site on SourceForge
  • Bitzi, a search engine / directory providing information about files according to their hash.
  • Freebase a website that uses magnet links to index freeware. its cache works like a tracker for magnet links making finding other sources for a file more easy.