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 (now Hyphanet), 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
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:23
The standard also allows for application-specific experimental parameters, which must begin with "x".
The xt parameter specifies the URN for a given p2p protocol. Its purpose is to provide a search parameter for finding the metadata to the torrent. This effectively acts as a replacement to a .torrent file, which itself contains the torrent metadata, by instead searching the p2p network (using the URN) for that metadata. Each protocol handles a URN uniquely; for example, xt=urn:btih:FFC7E738EAA4CD4ECF51EC6FD669C6CDE2C281A8 uses the btih (BitTorrent v1 protocol), so a BitTorrent client can take the hash and lookup the torrent's metadata in the BitTorrent DHT.9 In the case of DHT the client searches through a set of pre-known nodes and requests the metadata for an infohash; those nodes will make the same request to other known nodes until eventually a swarm is found and returned.
xt also allows for a group setting. Multiple files can be included by adding a count number preceded by a dot (".") to each link parameter.
There are two types of download links that a Magnet link can include as a direct or backup source.
For experimental and self-complementing informal options, the prefix x. followed by a chosen suffix letter can be used. These names are guaranteed to never be standardized.
"BitTorrent v2". BitTorrent. 7 September 2020. Archived from the original on 30 October 2020. Retrieved 21 September 2020. https://blog.libtorrent.org/2020/09/bittorrent-v2/ ↩
"magnet-test.c in trunk/libtransmission; Revision 9531". Transmission. Archived from the original on 17 February 2012. Retrieved 4 February 2012. https://trac.transmissionbt.com/browser/trunk/libtransmission/magnet-test.c?rev=9531 ↩
"BitTorrent Enhancement Proposal 9: Extension for Peers to Send Metadata Files". bittorrent.org (published 31 January 2008). 26 March 2017. Archived from the original on 10 October 2022. Retrieved 4 November 2022. http://bittorrent.org/beps/bep_0009.html ↩
Houlihan, Tyler (24 May 2017). "Magnet URI extension - Select specific file indices for download". BitTorrent.org. Retrieved 30 December 2024. http://bittorrent.org/beps/bep_0053.html ↩
"libtorrent/magnet_uri.cpp at 64817e0e8793d0875fc10245de52ffb2540a223d · arvidn/libtorrent". libtorrent. Archived from the original on 4 November 2022. Retrieved 4 November 2022 – via GitHub. https://github.com/arvidn/libtorrent/blob/64817e0e8793d0875fc10245de52ffb2540a223d/src/magnet_uri.cpp#L302-L501 ↩
"BitTorrent Enhancement Proposal 53: Magnet URI extension - Select specific file indices for download". BitTorrent.org. 6 June 2017. Archived from the original on 10 October 2022. Retrieved 4 November 2022. https://www.bittorrent.org/beps/bep_0053.html ↩
"bep_0005.rst_post". bittorrent.org. Retrieved 12 May 2022. http://bittorrent.org/beps/bep_0005.html ↩
Chapweske, Justin (29 November 2001). "HTTP Extensions for a Content-Addressable Web". www-talk. W3C. Archived from the original on 28 July 2011. Retrieved 7 November 2010. http://lists.w3.org/Archives/Public/www-talk/2001NovDec/0090.html ↩
dchub://[hubaddress]:[hubport] ↩
"v1.74 Core Improve: support ws parameter in Magnet URI, to add web seed". bitcomet. Archived from the original on 10 April 2021. Retrieved 7 April 2021. https://www.bitcomet.com/en/downloads ↩
Passes link to external software ↩
adc://[hubaddress]:[hubport] ↩
adcs://[hubaddress]:[hubport] ↩
"Add eXact Length parameter when creating magnet URI". GitHub. Retrieved 29 December 2024. https://github.com/qbittorrent/qBittorrent/commit/27451469fa73fecfb93d7c98334f4a40c79b4c19 ↩
Since v2.5.1.0 ↩
"magnet.c in trunk/libtransmission; Revision 9979". Transmission. Archived from the original on 17 February 2012. Retrieved 4 February 2012. https://trac.transmissionbt.com/browser/trunk/libtransmission/magnet.c?rev=9979 ↩
"magnet.c in libtransmission: Commit 5c3fd1b5ccc3a8c4ab68e2c56861df31dd1c720a". Transmission. Archived from the original on 4 September 2021. Retrieved 4 September 2021. https://github.com/transmission/transmission/commit/5c3fd1b5ccc3a8c4ab68e2c56861df31dd1c720a#diff-05c4e2919dd53eccc714f113e12f821685c9140c9e40491f2a069a2970912396 ↩