Post
Topic
Board Development & Technical Discussion
Re: Using a DHT to reduce the resource requirements of full nodes.
by
DeathAndTaxes
on 23/06/2014, 17:37:22 UTC
The tx hash is a large proportion of the size of the tx itself, and many tx must be gathered from far and wide to assemble a single block for initial verification. Why not split up storage by block hashes?

That is an alternative however a single verified block is of little use.  A bootstrapping node will need to verify all txns before it is synced with the network.  Optimally the node would download all block headers & txn hashes.  It would then request entire sets of txns from DHT peers (i.e. request from a particular DHT peer all txn hashes with the prefix 0x00e0 to 0x00ef).  This would allow the node to use multiple peers (potentially dozens or hundreds if the bootstrapping peer has sufficient resources) to simultaneously download the txn cache in parallel.

I do agree that txn hashes do add some overhead.   If we look at the full blockchain the average txn is 461 bytes.  This means a txn hash set is ~7% of the full blockchain but it does mean ~7% additional overhead.  It isn't necessary for txn hashes and block hashes to have the same hash length.  A hash collision for bitcoin txns is not useful, an attacker would need a preimage attack.  This means even 160 bit or 128 bit hashes would provide sufficient security and that would reduce the overhead to 3% to 4%.  I doubt Bitcoin will be changing to support smaller txns hashes but it could be done in a backwards compatible manner.  Still this is something for altcoins to keep in mind.