Block download merkle root addition (torrent-like)

Just spitting out an idea that just popped up.

Imagine we get blocks the size of 1GB. Miners will download this shallowly, since they have full mempools. I’m not focusing on that topic. The current solution we have is good enough (CompactBlock is good enough for quite some time yet).

But a node that has been offline for a while that catches up, they need to download full blocks. And the smallest verifyable unit of download is one entire block. So, again, if we get to 1GB blocks, this raises issues.
For instance you can make it really hard to make someone catch up by feeding them bad data. They can’t verify that the data you gave them is bad until they finished the entire 1GB block download…

A different issue is that maybe you want to download a block torrent style. From a bunch of nodes at the same time.

So, here is the idea.

The block of 1GB can be split into 1000 chunks of 1MB each, which (just like in torrents) get a checksum on them. These 1000 checksums can then be a separate download and you can afterwards safely download each 1MB chuck from any peer. Checking the validity every megabyte instead of once after you finished the 1000MB download.

This in itself would be a great upgrade already and would be completely permissionless.
A nice addition would be if the list of torrent checksums file is then hashed. And that hash can then be added to the transaction merkle-tree in some determenistic way to give you a merkle-root as it is today stored in the blockheader.

The benefit of this is that the torrent metadata with the checksums are easy to verify before the download of the whole block and protected by proof of work. This makes the download of each of those torrent-chunks likewise protected by proof of work and thus safe from spoofing. You download 1MB, check it and if fake you ban the IP. Big improvement over needing to download 1000 MB before you can verify and ban.

The neat thing is that the block download only has to add 1 hash if you’re not interested in the torrent. Namely the torrent-checksums file-hash. Add that one hash and the normal TXIDs together to validate the blocks transaction-hashes merkle-tree. Which is the entire data With that one extra hash you can avoid the entire torrent-checksums file if you have no need for it. For instance an SPV client using the merkle-block design would never notice the change.

Thoughts? Questions? Flames?

(edit; simplify)

4 Likes

Thanks, Tom I like this idea It looks like a solid improvement for nodes with slow connections, as chunked downloads could make block syncing faster and more resilient, For starters I think we should introduce torrent‑style chunking first as an optional extension protocol, similar to how Xthin or Graphene were deployed.

2 Likes