🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #64827

Re: xBin library version 0.1

#64827
From: Curt Welch
Date: Thu, 10 Apr 2003 21:46
187 lines
11001 bytes
"Chris AtLee" <catlee@canada.com> wrote:
> On Wed, 09 Apr 2003 23:14:13 +0000, Curt Welch wrote:
> > "Chris AtLee" <catlee@canada.com> wrote:

> > ??? what are you talking about?  I haven't seen anything like that in
> > the definitions I've read.  Where does the extra byte come from?
>
> From the Tree Hash Exchange Format document section 2.1:
>
> http://www.open-content.net/specs/draft-jchapweske-thex-02.html#anchor3
>
> "In order to protect against collisions between leaf hashes and internal
> hashes, different hash constructs are used to hash the leaf nodes and the
> internal nodes.

Very odd.  I have no idea why they think 1) doing that will protect against
collisions, and 2) why that is useful.

I had scanned that web page before but didn't read it careful enough to
notice that.

Does anyone see _any_ point in doing that?

The section is under the description of Merkle Hash Trees so maybe this was
an idea that Merkle added in his original paper?

> I haven't checked the source to see if tigertree hashes actually use this
> or not, but this is where I got it from.

I've looked at some TigerTree code and didn't notice it doing anything like
that.  But, I might have missed it just like I did when I read the above
document because I didn't expect it to be there.

> The point they were claiming in the Tiger hash document was that even if
> you only used 160 bits of the Tiger hash, those 160 bits were a stronger
> hash than the 160 SHA1 bits, so if bandwidth was an issue, you could just
> send 160 bits.  Anyway, I'm not advocating Tiger over SHA1, I was just
> summarizing the differences.

Yeah, I wonder how they can justify that claim.

> Sorry, that is what I meant.  I didn't know what to call it, so I called
> it the complement.  Maybe minimal hash tree complement would be more
> accurate?

Yeah, I have no idea what to call it either.  When we put those hash values
in a header we couldn't figure out what to name the header either.

> Yes, the bitprint is a combination of the SHA1 hash with the TigerTree
> hash of a file (which is different from a tiger hash of a file - a tiger
> tree hashes combines tiger hashes of 1024 bytes into a merkle hash tree;
> the tiger hash itself knows nothing about trees, so it could be used on
> the entire file)

Your wording is a bit odd there.  You say "so it could be used on the
entire file".  What is your point?

A tiger tree hash is a hash just like a tiger hash is a hash and SHA-1 is a
hash.  They are all used on the entire file to produce a single file hash.
The SHA-1 hash of a file is a 120 bit value, an Tiger hash of a file is a
192 bit value, a Tiger Tree Hash of a file is also a 192 bit value.

The advantage of any tree hash is that you can veryify that any block (in
the hash block size) is in fact part of the file with hash X, without
having access to the rest of the file.  You only need access to a small set
of internal hash values (nodes from the tree) to recompute the file hash.
The non-tree hashes, like SHA-1 and Tiger, don't allow you to do that.  If
you have a single block of the file, the only way to know if it's truelly
part of the file with hash XYZ, is to get access to the entire file.

Another post on this thread said something like "the tiger hash of the
segment".  That's a totaly bogus statement.  Is someone confused here?

> If this makes sense to include into xBin, it would mean changing the
> block size to 1,024 bytes, using the TigerTree hash for verification of
> blocks, and also including the SHA1 hash in the headers somewhere.

A big part of what we are looking at with xBin is reducing the possibilty
for abuse.  We want to be able to look at a single article (the smallest
unit of information in usenet), and veryify it's both valid, and part of
the file it claimes to be part of.  Given 10,000 articles which all claim
to be part of a given file, we need a sure-fire way to sort out the
forgeries from the real data.  Using a tree hash as the unique identifier
for a file allows us to do that.

An SHA1 file hash is worthless.  It can (and will be) forged, with no way
knowing if the SHA1 hash listed in the article has anything to do with the
data in that article.

So, my question is, why is it needed for the P2P network?  If you can not
ask the P2P network to deliver a file segment to you using only the tree
hash, then this is just not going to work.

I wonder if an issue with the P2P network designs is that they haven't been
thinking about the problem of transporting file segments instead of entire
files?  If the only way to submit data for transport to the P2P network is
to submit the entire file, then the network will always be able to
calculate and veryify the full file SHA-1 hash.  So it can use that to
identify files.  But, if like usenet, it suports the concept of submitting
only a file segment for transport, then you would be forced to "trust" the
SHA-1 value provided by the person submitting the segment, which, like on
usenet, opens the door for data polution by people submitting false data
(either intentinally or accidentially).

> All
> of this means that the xBin headers will be slightly larger since the
> TigerTree hash is longer and minimal hash tree complement will be larger
> since the merkle hash tree is larger.

Yeah, there are issues.

Because of how uuencoded multipart files are split (on uuencoded line
boundries), the current posting conventions creates segements which are a
multiple of 45 bytes (the number of bytes encoded in each uuencoded line).
To be compatible with this limitation, we (I mostly) argued that it would
be best to pick a block size for xBin which was a multiple of 45.  The
current front-runner for this is 22500 byte blocks. (500 uuencoded lines).

Picking a block size which wasn't a multiple of 45 means you either 1),
don't post any multipart files in uuencode anymore (not a huge problem
because yEnc is so wide spread for multipart posting), 2), allow the last
line for each multipart article to be shorter than the 45 byte standard
which should work (every uuencoded line has a character at the beginning
which specifies the number of bytes on the line where M means 45).

Being more compatible with current usenet practice makes the standard more
likely to suceed, but making it compatible with other standards (like P2P)
might help more than the compatibility with uuencode.

I've also had second thoughts about using a non power-of-two block size for
other future reasons and thought that maybe a 32K block size would be
better.

The next issue is that the larger the block size, the smaller the tree is,
and the less hash values you need to include with each post.  With 1K
blocks, you add 5 more levels to the hash tree than with 32K blocks, which
means you can add up to 10 more hash values to every post.

For usenet, we really need to put these hash values in the header, not in
the body.  We need to add this hash data to the posts in a way that won't
break current decoders.  With yEnc, because there's a begin and end marker
in every article, it would be straight forward to define a text format for
the hash data which was placed in the body, but outside the yEnc data in
the article.  Current yEnc decoders would just ignore it.  With uuencode
however, there are no begin and end markers on each article, so adding any
extra text in the body is likely to break some decoders.  You might be able
to make it work because most decoders already have logic to ignore
signatures added by some servers to all posts, so maybe hiding the hash
data in a signature at the end of the body would work.

But, putting the hash data in the headers would work for sure in terms of
not breaking current usenet decoders.  And, on top of that, having it in
the header allows clients to fetch the hash tree data with HEAD commands
without having forceing them to fetch the entire body.  There are various
applications were this would be useful.

However, with SHA1 hashes, and 22500 byte blocks, the amount of hash data
is already approaching the limits of how much data you can safely put into
the header without running into line length or header length limits which
exist on some current servers.

For a 1GB file, with 512KB per aritcle, and a 32KB hash block size, you are
talking about needing around 19 hash values per article.  With 1KB hash
block sizes, you add about 10 hashes to that bringinging it to 29 hash
values.

If you make it a tigertree hash as well with 24 bytes per hash instead of
20, you are talking about 696 bytes of hash data instead of 19*20 or 380
bytes so swtiching from the type of system we are looking at for the
current xBin to TigherTree would come close to doubling the amount of hash
data we are trying to stuff into the headers for a typical "large" file of
today.  So that's yet another issue to weigh when looking at this
decission.  There are options for butting that much data into the header,
but it causes problems which could make the standard harder for usenet as a
whole to accept.

The hash block size also sets the minimum size of a multipart post.  People
sometimes flood groups with 1000 part multipart posts which only have 2
lines of uuencoded data per article.  Having a large minimum size (32K vs
1K) is also seen as an advantage to make some types of abuse like this easy
and natural to filter at the source.  This however I don't see as important
at the other issues.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20030410174600.804$YN@newsreader.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <pan.2003.04.08.05.21.36.142899@canada.com> <l_Cka.19193$iy5.537691@twister2.libero.it> <pan.2003.04.08.17.40.39.978437@canada.com> <pan.2003.04.08.18.19.33.288947@canada.com> <20030409191413.445$rS@newsreader.com> <pan.2003.04.10.18.15.24.309042@canada.com>

Show Full Headers
Complete Article Headers
Message-ID: <20030410174600.804$YN@newsreader.com>
Subject: Re: xBin library version 0.1
Date: Thu, 10 Apr 2003 21:46:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <pan.2003.04.08.05.21.36.142899@canada.com> <l_Cka.19193$iy5.537691@twister2.libero.it> <pan.2003.04.08.17.40.39.978437@canada.com> <pan.2003.04.08.18.19.33.288947@canada.com> <20030409191413.445$rS@newsreader.com> <pan.2003.04.10.18.15.24.309042@canada.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed1.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com fUbDHW4el7N1OA+dxR_xt3AiVwDA9zmXHHw_XO5DCFTz15oC8=
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 186