[bittorrent] DHT - Clarifying the spec

arvid at cs.umu.se arvid at cs.umu.se
Fri Mar 2 18:57:24 EST 2007

Quoting Adrian Ulrich <torrent at blinkenlights.ch>:
> > 7) Transaction IDs
> > Under no circumstances should the transaction id be truncated or
> > expanded or converted from a bencoded number to bencoded string or vice
> > versa.
> My implementation creates singe-char transaction IDs but also accepts
> longer IDs (and never touches them)

But does it allow any bencoded value? such as lists and dictionaries?
This goes for write tokens as well. I guess it's a matter of implementation
quality, accepting transaction ids and tokens that violate the spec but only
generate transaction ids and tokens that conform to it.

> > 8) Token's
> > Tokens are similar to transaction id's. They should be treated as a value
> > that should be returned exactly as is to the original sender. They should
> > not be truncated, expanded or converted to a different bencoded type. You
> > should assume that a token can be any of the bencoded types.
> I think a token should always be a string.
> Using the sha1-hash-method (as mainline does) makes sense.

Arvid Norberg

More information about the BitTorrent mailing list