0
$\begingroup$

Here author seems to give overview of merkle trees.

However, I have one problem.

As in the article author claims you can use merkle trees to verify authenticity of data, e.g. if piece of data is authentic.

But I could use a simple hash of the file (signed), for authenticating/checking integrity of file too, right?

Why employ merkle trees for this purpose? So it seems I am clearly missing something. Can someone enlighten me on this?

$\endgroup$
1
$\begingroup$

Usually you'd use one hash per file yes, but often torrents consist of multiple files. So you'd have a hash per file and possibly a top level hash to make sure that all the files are present. This way you can validate each file after it is downloaded; downloading and hashing can be performed in any order and in parallel - e.g. from within their own threads.

In principle you could also split the file in sections and hash those separately / in parallel. But with the speed of most hash algorithms this doesn't make much sense. And for integrity you're probably better off using e.g. PAR2 which provides error correction on top of error detection.

As for the authenticity: either the Merkle tree can be loaded from a secure location or the root may be signed, to name two common methods. So yes, you can use a Merkle tree to authenticate data, but you must be able to trust the tree itself first.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.