[BitTorrent] XML Torrents?

Kenneth Porter shiva at sewingwitch.com
Fri Mar 11 13:00:12 EST 2005

--On Friday, March 11, 2005 10:18 AM +0000 Justin Cormack 
<justin at street-vision.com> wrote:

> Actually the character encoding and space reasons are relatively minor.

Yeah, I don't see the point of saving 20 bytes when we're dealing with a 
protocol designed to transfer hundreds of megabytes. 
Penny-wise/pound-foolish. For larger XML files, the "bloat" can easily be 
dealt with using commonplace compression like deflate. For example, 
OpenOffice documents are stored in zipped XML collections. Much of the 
bloat is caused by the large in-line descriptive tags, and those are 
natural candidates for leveraging dictionary-based compression.

The encoding issue is somewhat orthogonal. The XML advantage there is that 
it has a well-defined mechanism for specifying encodings, but it's not the 
"selling point".

> For many purposes it would be very useful to have a text format (eg to
> send a torrent by email). However it is required that there is a unique
> representation of the info portion of the torrent file so that the info
> hash can be generated (hence the rules about ordering of fields in
> bencoding). XML doesnt give you a fixed representation, so you still need
> some canonical form.

I see what you mean. It looks like the hash is used as a short-hand way of 
representing a given metadata file, to be used as a key into the tracker 
and peer state machines to identify a given swarm. Does the hash serve a 
security purpose, or just an identification function? If the latter, the 
authoring application could hash the initial contents of the XML 
representation that it's written and append it as a final element. This 
would provide the required uniqueness without requiring that a particular 
representation be maintained by those communicating the content.

To me, the advantages of XML are extensibility, self-documentation, and 
easy validation. Plus the wide availability of tools to manipulate the 
format. This makes it easy to implement the tracker part of new clients in 
any language that has an XML parser, and makes it easy to extend the 
protocol. Since the tracker acts as a web server, and XML has web origins, 
it also makes it natural to adapt existing web machinery to do the job.

Is bencoding so special? If the original BT protocol had been written in 
Perl, would everyone be raving about Data::Dumper format? (And I recall 
that PHP has its own data structure dump format.)

(BTW, note that I'm not proposing XML for the peer protocol, which is much 
more performance-sensitive. For now I'm just talking about the metadata 
file (ie. the .torrent).)

Yahoo! Groups Links

<*> To visit your group on the web, go to:

<*> To unsubscribe from this group, send an email to:
    BitTorrent-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

More information about the BitTorrent mailing list