Magnet URI scheme explained

Magnet is a URI scheme that defines the format of magnet links, a de facto standard for identifying files (URN) by their content, via cryptographic hash value rather than by their location.

Although magnet links can be used in a number of contexts, they are particularly useful in peer-to-peer file sharing networks because they allow resources to be referred to without the need for a continuously available host, and can be generated by anyone who already has the file, without the need for 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.

History

The standard for Magnet URIs was developed by Bitzi 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. BitTorrent introduced the btmh: protocol in 2020 as part of its BitTorrent v2 changes.[1]

Format

Magnet URIs consist of a series of one or more parameters, the order of which is not significant, formatted in the same way as query strings that ordinarily terminate HTTP URLs.

The following parameters are supported:

Notes and References

  1. Web site: BitTorrent v2. BitTorrent. 7 September 2020. 30 October 2020. https://web.archive.org/web/20201030011550/https://blog.libtorrent.org/2020/09/bittorrent-v2/. live.
  2. Web site: 2022-10-23 . libtorrent/magnet_uri.cpp at 64817e0e8793d0875fc10245de52ffb2540a223d ยท arvidn/libtorrent . live . https://web.archive.org/web/20221104095247/https://github.com/arvidn/libtorrent/blob/64817e0e8793d0875fc10245de52ffb2540a223d/src/magnet_uri.cpp#L302-L501 . 2022-11-04 . 2022-11-04 . . GitHub.
  3. Web site: 2017-06-06 . BitTorrent Enhancement Proposal 53: Magnet URI extension - Select specific file indices for download . live . https://web.archive.org/web/20221010161216/https://www.bittorrent.org/beps/bep_0053.html . 2022-10-10 . 2022-11-04 . BitTorrent.org.
  4. Web site: bep_0005.rst_post . 2022-05-12 . bittorrent.org.
  5. Web site: 2017-03-26 . BitTorrent Enhancement Proposal 9: Extension for Peers to Send Metadata Files . live . https://web.archive.org/web/20221010161216/https://www.bittorrent.org/beps/bep_0009.html#magnet-uri-format . 2022-10-10 . 2022-11-04 . bittorrent.org . 2008-01-31.
  6. Web site: 2020-09-07 . BitTorrent v2 . live . https://web.archive.org/web/20221022200751/https://blog.libtorrent.org/2020/09/bittorrent-v2/ . 2022-10-22 . 2022-11-05 . libbittorrent.org . libbittorrent . en-US.
  7. Web site: HTTP Extensions for a Content-Addressable Web . www-talk . W3C . Justin . Chapweske . November 29, 2001 . November 7, 2010 . July 28, 2011 . https://web.archive.org/web/20110728165323/http://lists.w3.org/Archives/Public/www-talk/2001NovDec/0090.html . live .
  8. dchub://[hubaddress]:[hubport]
  9. Web site: v1.74 Core Improve: support ws parameter in Magnet URI, to add web seed . bitcomet . 2021-04-07 . 2021-04-10 . https://web.archive.org/web/20210410081721/http://www.bitcomet.com/en/downloads . live .
  10. Passes link to external software
  11. adc://[hubaddress]:[hubport]
  12. adcs://[hubaddress]:[hubport]
  13. Since v2.5.1.0
  14. Web site: magnet-test.c in trunk/libtransmission; Revision 9531 . Transmission . 2012-02-04 . 2012-02-17 . https://web.archive.org/web/20120217152203/https://trac.transmissionbt.com/browser/trunk/libtransmission/magnet-test.c?rev=9531 . live .
  15. Web site: magnet.c in trunk/libtransmission; Revision 9979 . Transmission . 2012-02-04 . 2012-02-17 . https://web.archive.org/web/20120217232524/https://trac.transmissionbt.com/browser/trunk/libtransmission/magnet.c?rev=9979 . live .
  16. Web site: magnet.c in libtransmission: Commit 5c3fd1b5ccc3a8c4ab68e2c56861df31dd1c720a . Transmission . 2021-09-04 . 2021-09-04 . https://web.archive.org/web/20210904042539/https://github.com/transmission/transmission/commit/5c3fd1b5ccc3a8c4ab68e2c56861df31dd1c720a#diff-05c4e2919dd53eccc714f113e12f821685c9140c9e40491f2a069a2970912396 . live .