2012-11-11 05:27:03 +00:00
|
|
|
{% extends "global/layout.html" %}
|
2013-01-30 23:19:19 +00:00
|
|
|
{% block title %}{% trans %}Bittorrent over I2P{% endtrans %}{% endblock %}
|
|
|
|
{% block lastupdated %}{% trans %}September 2012{% endtrans %}{% endblock %}
|
2012-12-14 03:41:29 +00:00
|
|
|
{% block accuratefor %}0.9.2{% endblock %}
|
2011-02-20 18:47:34 +00:00
|
|
|
{% block content %}
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<p>{% trans -%}
|
|
|
|
There are several bittorrent clients and trackers on I2P.
|
2011-02-20 18:47:34 +00:00
|
|
|
As I2P addressing uses a Destination instead of an IP and port, minor
|
|
|
|
changes are required to tracker and client software for operation on I2P.
|
|
|
|
These changes are specified below.
|
2011-07-07 12:16:50 +00:00
|
|
|
Note carefully the guidelines for compatibility with older I2P clients and trackers.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
This page specifies protocol details common to all clients and trackers.
|
2011-02-20 18:47:34 +00:00
|
|
|
Specific clients and trackers may implement other unique features or protocols.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
We welcome additional ports of client and tracker software to I2P.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Announces{% endtrans %}</h2>
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Clients generally include a fake port=6881 parameter in the announce, for compatibility with older trackers.
|
|
|
|
Trackers may ignore the port parameter, and should not require it.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The ip parameter is the base 64 of the client's
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destination</a>,
|
2011-02-20 18:47:34 +00:00
|
|
|
using the I2P Base 64 alphabet [A-Z][a-z][0-9]-~.
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destinations</a>
|
2011-02-20 18:47:34 +00:00
|
|
|
are 387+ bytes, so the Base 64 is 516+ bytes.
|
|
|
|
Clients generally append ".i2p" to the Base 64 Destination for compatibility with older trackers.
|
|
|
|
Trackers should not require an appended ".i2p".
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Other parameters are the same as in standard bittorrent.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
While all current Destinations for clients are exactly 387 bytes, a tracker should not
|
|
|
|
presume that will always be so. A reasonable maximum to assume, for now, is 475 bytes.
|
|
|
|
As the tracker must decode the Base64 to deliver compact responses (see below),
|
|
|
|
the tracker should probably decode and reject bad Base64 when announced.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The default response type is non-compact. Clients may request a compact response with
|
|
|
|
the parameter compact=1. A tracker may, but is not required to, return
|
|
|
|
a compact response when requested.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
Developers of new I2P clients
|
|
|
|
are strongly encouraged to implemenent announces over their own tunnel rather than
|
|
|
|
the HTTP client proxy at port 4444. Doing so is both more efficient and it allows
|
|
|
|
destination enforcement by the tracker (see below).
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2012-05-28 15:56:53 +00:00
|
|
|
There are no known I2P clients or trackers that currently support UDP announce/responses.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Non-Compact Tracker Responses{% endtrans %}</h2>
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The non-compact response is just as in standard bittorrent, with an I2P "ip".
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Trackers generally include a fake port key, or use the port from the announce, for compatibility with older clients.
|
|
|
|
Clients must ignore the port parameter, and should not require it.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The value of the ip key is the base 64 of the client's
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destination</a>, as described above.
|
2011-02-20 18:47:34 +00:00
|
|
|
Trackers generally append ".i2p" to the Base 64 Destination if it wasn't in the announce ip, for compatibility with older clients.
|
2011-05-28 23:55:35 +00:00
|
|
|
Clients should not require an appended ".i2p" in the responses.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Other response keys and values are the same as in standard bittorrent.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Compact Tracker Responses{% endtrans %}</h2>
|
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
In the compact response, the value of the "peers" dictionary key is a single byte string,
|
|
|
|
whose length is a multiple of 32 bytes.
|
|
|
|
This string contains the concatenated
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#type_Hash">32-byte SHA-256 Hashes</a>
|
2011-02-20 18:47:34 +00:00
|
|
|
of the binary
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destinations</a>
|
2011-02-20 18:47:34 +00:00
|
|
|
of the peers.
|
2011-05-28 23:55:35 +00:00
|
|
|
This hash must be computed by the tracker, unless destination enforcement
|
|
|
|
(see below) is used, in which case the hash delivered in the X-I2P-DestHash
|
|
|
|
or X-I2P-DestB32 HTTP headers may be converted to binary and stored.
|
2011-02-20 18:47:34 +00:00
|
|
|
The peers key may be absent, or the peers value may be zero-length.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-30 16:32:44 +00:00
|
|
|
While compact response support is optional for both clients and trackers, it is highly
|
2013-08-15 21:27:54 +00:00
|
|
|
recommended as it reduces the nominal response size by over 90%.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Destination Enforcement{% endtrans %}</h2>
|
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Some, but not all, I2P bittorrent clients announce over their own tunnels.
|
|
|
|
Trackers may choose to prevent spoofing by requiring this, and verifying the
|
|
|
|
client's
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destination</a>
|
2011-02-20 18:47:34 +00:00
|
|
|
using HTTP headers added by the I2PTunnel HTTP Server tunnel.
|
|
|
|
The headers are X-I2P-DestHash, X-I2P-DestB64, and X-I2P-DestB32, which are
|
|
|
|
different formats for the same information.
|
|
|
|
These headers cannot be spoofed by the client.
|
|
|
|
A tracker enforcing destinations need not require the ip announce parameter at all.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
As several clients use the HTTP proxy instead of their own tunnel for announces,
|
2011-05-28 23:55:35 +00:00
|
|
|
destination enforcement will prevent usage by those clients unless or until
|
|
|
|
those clients are converted to announcing over their own tunnel.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
Unfortunately, as the network grows, so will the amount of maliciousness,
|
|
|
|
so we expect that all trackers will eventually enforce destinations.
|
|
|
|
Both tracker and client developers should anticipate it.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Announce Host Names{% endtrans %}</h2>
|
|
|
|
<p>{% trans naming=site_url('docs/naming') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Announce URL host names in torrent files generally follow the
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ naming }}">I2P naming standards</a>.
|
2011-02-20 18:47:34 +00:00
|
|
|
In addition to host names from address books and ".b32.i2p" Base 32 hostnames,
|
|
|
|
the full Base 64 Destination (with [or without?] ".i2p" appended) should be supported.
|
|
|
|
Non-open trackers should recognize their own host name in any of these formats.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
To preserve anonymity,
|
|
|
|
clients should generally ignore non-I2P announce URLs in torrent files.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Client Connections{% endtrans %}</h2>
|
|
|
|
<p>{% trans -%}
|
2012-05-28 15:56:53 +00:00
|
|
|
Client-to-client connections use the standard protocol over TCP.
|
|
|
|
There are no known I2P clients that currently support uTP communication.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
|
|
|
I2P uses 387+ byte <a href="{{ commonstructures }}#struct_Destination">Destinations</a>
|
|
|
|
for addresses, as explained above.
|
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
If the client has only the hash of the destination (such as from a compact response or PEX), it must perform a lookup
|
|
|
|
by encoding it with Base 32, appending ".b32.i2p", and querying the Naming Service,
|
|
|
|
which will return the full Destination if available.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-05-28 23:55:35 +00:00
|
|
|
If the client has a peer's full Destination it received in a non-compact response, it should use it
|
|
|
|
directly in the connection setup.
|
|
|
|
Do not convert a Destination back to a Base 32 hash for lookup, this is quite inefficient.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-05-28 23:55:35 +00:00
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Cross-Network Prevention{% endtrans %}</h2>
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
To preserve anonymity,
|
|
|
|
I2P bittorrent clients generally do not support non-I2P announces or peer connections.
|
|
|
|
I2P HTTP outproxies often block announces.
|
|
|
|
There are no known SOCKS outproxies supporting bittorrent traffic.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
To prevent usage by non-I2P clients via an HTTP inproxy, I2P trackers often
|
|
|
|
block accesses or announces that contain an X-Forwarded-For HTTP header.
|
2011-07-07 14:56:56 +00:00
|
|
|
Trackers should reject standard network announces with IPv4 or IPv6 IPs, and not deliver them in responses.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>PEX</h2>
|
2013-01-30 23:19:19 +00:00
|
|
|
<p>{% trans commonstructures=site_url('docs/spec/common-structures') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
I2P PEX is based on ut_pex.
|
|
|
|
As there does not appear to be a formal specification of ut_pex available,
|
|
|
|
it may be necessary to review the libtorrent source for assistance.
|
|
|
|
It is an extension message, identified as "i2p_pex" in
|
|
|
|
<a href="http://www.bittorrent.org/beps/bep_0010.html">the extension handshake</a>.
|
|
|
|
It contains a bencoded dictionary with up to 3 keys, "added", "added.f", and "dropped".
|
|
|
|
The added and dropped values are each a single byte string, whose length is a multiple of 32 bytes.
|
|
|
|
These byte strings are the concatenated SHA-256 Hashes of the binary
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="{{ commonstructures }}#struct_Destination">Destinations</a>
|
2011-02-20 18:47:34 +00:00
|
|
|
of the peers.
|
|
|
|
This is the same format as the peers dictionary value in the i2p compact response format specified above.
|
|
|
|
The added.f value, if present, is the same as in ut_pex.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h2>DHT</h2>
|
2013-01-30 23:19:19 +00:00
|
|
|
<p>{% trans -%}
|
2012-09-21 15:16:23 +00:00
|
|
|
DHT support is included in the i2psnark client as of version 0.9.2.
|
2011-02-20 18:47:34 +00:00
|
|
|
Preliminary differences from
|
|
|
|
<a href="http://www.bittorrent.org/beps/bep_0005.html">BEP 5</a>
|
2011-05-28 23:55:35 +00:00
|
|
|
are described below, and are subject to change.
|
|
|
|
Contact the I2P developers if you wish to develop a client supporting DHT.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2012-06-02 21:42:44 +00:00
|
|
|
Unlike standard DHT, I2P DHT does not use a bit in the options handshake, or the PORT message.
|
|
|
|
It is advertised with an extension message, identified as "i2p_dht" in
|
|
|
|
<a href="http://www.bittorrent.org/beps/bep_0010.html">the extension handshake</a>.
|
|
|
|
It contains a bencoded dictionary with two keys, "port" and "rport", both integers.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The UDP (datagram) port listed in the compact node info is used
|
|
|
|
to receive repliable (signed) datagrams.
|
|
|
|
This is used for queries, except for announces.
|
|
|
|
We call this the "query port".
|
2012-06-02 21:42:44 +00:00
|
|
|
This is the "port" value from the extension message.
|
|
|
|
Queries use I2CP protocol number 17.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
In addition to that UDP port, we use a second datagram
|
2012-06-02 21:42:44 +00:00
|
|
|
port equal to the query port + 1. This is used to receive
|
|
|
|
unsigned (raw) datagrams for replies, errors, and announces.
|
2012-08-05 16:57:59 +00:00
|
|
|
This port provides increased efficiency since replies
|
2012-06-02 21:42:44 +00:00
|
|
|
contain tokens sent in the query, and need not be signed.
|
2011-02-20 18:47:34 +00:00
|
|
|
We call this the "response port".
|
2012-06-02 21:42:44 +00:00
|
|
|
This is the "rport" value from the extension message.
|
|
|
|
It must be 1 + the query port.
|
|
|
|
Responses and announces use I2CP protocol number 18.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Compact peer info is 32 bytes (32 byte SHA256 Hash)
|
|
|
|
instead of 4 byte IP + 2 byte port. There is no peer port.
|
2012-06-02 21:42:44 +00:00
|
|
|
In a response, the "values" key is a list of strings, each containing a single compact peer info.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
Compact node info is 54 bytes (20 byte SHA1 Hash + 32 byte SHA256 Hash + 2 byte port)
|
|
|
|
instead of 20 byte SHA1 Hash + 4 byte IP + 2 byte port.
|
2012-06-02 21:42:44 +00:00
|
|
|
In a response, the "nodes" key is a
|
|
|
|
single byte string with concatenated compact node info.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2012-08-05 16:57:59 +00:00
|
|
|
Secure node ID requirement: To make various DHT attacks more difficult,
|
|
|
|
the first 4 bytes of the Node ID must match the first 4 bytes of the destination Hash,
|
|
|
|
and the next two bytes of the Node ID must match the next two bytes of the
|
|
|
|
destination hash exclusive-ORed with the port.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
|
|
|
|
|
|
|
<p>{% trans -%}
|
2012-06-02 21:42:44 +00:00
|
|
|
In a torrent file,
|
|
|
|
the trackerless torrent dictionary "nodes" key is TBD.
|
|
|
|
It could be a list of
|
2011-02-20 18:47:34 +00:00
|
|
|
32 byte binary strings (SHA256 Hashes) instead of a list of lists
|
|
|
|
containing a host string and a port integer.
|
2012-06-02 21:42:44 +00:00
|
|
|
Alternatives: A single byte string with concatenated hashes,
|
|
|
|
or a list of strings alone.
|
2013-01-30 23:19:19 +00:00
|
|
|
{%- endtrans %}</p>
|
2011-02-20 18:47:34 +00:00
|
|
|
|
|
|
|
|
2013-01-30 23:19:19 +00:00
|
|
|
<h2>{% trans %}Additional Information{% endtrans %}</h2>
|
2011-02-20 18:47:34 +00:00
|
|
|
<ul>
|
2013-01-30 23:19:19 +00:00
|
|
|
<li>{% trans zzz=i2pconv('zzz.i2p') -%}
|
|
|
|
I2P bittorrent standards are generally discussed on <a href="http://{{ zzz }}/">{{ zzz }}</a>.
|
|
|
|
{%- endtrans %}</li>
|
|
|
|
<li>{% trans zzz=i2pconv('zzz.i2p') -%}
|
|
|
|
A chart of current tracker software capabilities is <a href="http://{{ zzz }}/files/trackers.html">also available there</a>.
|
|
|
|
{%- endtrans %}</li>
|
|
|
|
<li>{% trans forum=i2pconv('forum.i2p') -%}
|
2011-02-20 18:47:34 +00:00
|
|
|
The
|
2013-01-30 23:19:19 +00:00
|
|
|
<a href="http://{{ forum }}/viewtopic.php?t=2068">I2P bittorrent FAQ</a>
|
|
|
|
{%- endtrans %}</li>
|
|
|
|
<li>{% trans zzz=i2pconv('zzz.i2p') -%}
|
|
|
|
<a href="http://{{ zzz }}/topics/812">DHT on I2P discussion</a>
|
|
|
|
{%- endtrans %}</li>
|
2011-02-20 18:47:34 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
{% endblock %}
|