Magnet URI

Network Identifiers

A URI that references a resource by its content identifier rather than a fixed server address; in BitTorrent, it typically carries an information hash and may include a display name, tracker, and other discovery parameters.

Explanation

磁力链接 (Magnet URI) is a URI that references a resource by its content identifier, beginning with `magnet:?`. It does not necessarily point to a fixed webpage or server hosting a `.torrent` file; in BitTorrent usage, the link typically contains an info hash, which clients use to locate the same swarm, retrieve seed metadata, and begin requesting file pieces.

The most critical parameter is the exact topic, denoted as `xt`. In BitTorrent v1, this is typically written as `xt=urn:btih:<info-hash>`, where the hash can be represented in hexadecimal or Base32; in v2, `urn:btmh:` followed by the full info-hash with a multi-hash flag can be used. A Magnet URI may also include a `dn` (display name), `tr` (tracker address), `x.pe` (known nodes), and other extended parameters; the same keys may appear multiple times. Parameters must be percent-encoded according to URI conventions.

Links containing only a v1 info hash do not include a file list, chunk lengths, or chunk hashes. Clients that support BEP 9 first locate peers via DHT, trackers, or known nodes, then retrieve metadata from the peer connection in chunks, and verify the `info` content using the info hash. Only after obtaining the complete metadata does the download process resemble opening a traditional `.torrent` file. If no reachable nodes are available, the link cannot provide the resource even if the syntax is correct. A Magnet URI serves a different purpose than a web download link. An HTTP URL typically specifies a path on a server, while a 磁力链接 primarily carries an identifier that can be used by multiple discovery mechanisms; it does not store the file within the link, nor does it automatically provide anonymity, encryption, or malicious content checks. `dn` is merely a suggested name for interface display and cannot be used as evidence of content authenticity.

Modifying tracker parameters or display names does not necessarily change the BitTorrent metadata referenced by `xt`, but altering the `info` dictionary and recalculating the hash will generate a new link subject. Modern clients have varying levels of support for v1, v2, and hybrid torrents; therefore, links that provide both `btih` and `btmh` may only be partially recognized by older software.