NAME
Net::BitTorrent peer ID Specification
DESCRIPTION
This document describes and provides examples of the peer ID format used by the current release of the Net::BitTorrent module.
FORMAT
This non-standard format was developed to be URL-safe, unique to the implementation, and "human parsable."
There are three distinct sections to the peer IDs generated. Example peer ID:
NB004S-rogzGB1v--SVN
Where NB004S
is the header, -rogzGB1v
is the mid-section, and --SVN
is the signature.
Header
Two uppercase characters ('NB
') followed by three digits representing the SVN revision number with leading zeros, a single character potentially indicating stability and how the release was obtained, and a single hyphen (-
).
If the client is a CPAN build, the sixth byte is the capital letter 'C
'. If the client is running a version checked out from public SVN (considered unstable), the sixth byte is the capital letter 'S'. Any other characters in the sixth byte are unsupported and may indicate a bad client.
Mid-section
Following that are eight random characters in the following range:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~
That is, all uppercase and lowercase letters, decimal digits, as well as the hyphen, period, underscore, and tilde (66 total). These are all characters allowed in a URL without encoded (referred to as "Unreserved Characters in [rfc://3986]) to reduce weight on the tracker during announce. On a popular tracker, every bit (and byte) helps.
This section is inspired by the pseudo-base64 set used by SHADOW's BitTornado client.
Signature
The final five characters may be random or static and should not be used in identifying the version of the client software. Some early versions even have my name in this spot. .:shrugs:.
CPAN VERSION NUMBERS
Stable CPAN releases will have the sixth byte set to 'C
'.
Unstable (referred to as DEVELOPER releases on PAUSE) releases on CPAN will have this bit set as if the user checked the source out from SVN, that is, the sixth byte will be 'S
'. These will be released on CPAN with version numbers matching m[\d\.\d+_\d]
.
See the PAUSE FAQ section entitled "Developer Releases" ([http://www.cpan.org/modules/04pause.html])
Version numbers will be some value less than zero with the revision number in the three significant decimal places. For more, see the "EXAMPLES" section.
EXAMPLES
NB393C-04.9EraQ--SVN
-
This would be the stable CPAN release
v0.393
. The--SVN
signature should be ignored. NB003X-9E-ayR6b-BT<3
-
Improper peer ID; the sixth bit is neither 'C' nor 'S'. Possibly fake.
NB065S--09Egae69sy8W
-
Completely legal peer ID generated by SVN/Dev r65.
FUTURE IDEAS
Eventually, I would like to make a v1.0 release of Net::BitTorrent on CPAN. The information in this document and the means of generating the module's version number will need to reflect that. These changes will not affect peer ID parsing though.
DISCLAIMER AND LEGAL
This document and the specification behind it are subject to change. All modifications will be documented in the "HISTORY" section. All versions of this file can be found in the project's SVN repository.
This original documentation is covered by the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License (United States jurisdiction).
SEE ALSO
- RFC 3986 (URI: Generic Syntax)
-
Section 2.3. "Unreserved Characters" ([http://tools.ietf.org/html/rfc3986#section-2.3])
- PAUSE FAQ sub-section entitled "Developer Releases"
- CC ANSA 3.0
-
That is, the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License ([http://creativecommons.org/licenses/by-nc-sa/3.0/us/]).
- BitTornado's peer ID spec
-
This specification is inspired by the documentation found on the BitTornado forum ([http://forums.degreez.net/viewtopic.php?t=7070]).
CONTACT
Sanko Robinson
SANKO @ cpan.org
http://sankorobinson.com/
HISTORY
This is the list of changes to this file and the specification it describes:
First version