While calculating merkle proof, where are the other hashes being stored?
Consider that I have a merkle root made up of transactions A,B,C,D,E,F,G,H.
The root is H( H(H(A)+H(B)) + H(H(C)+H(D)) ) + H( H(H(E)+H(F)) + H(H(G)+H(H)) ).
Now, I have to verify whether transaction C is part of this root (which it is).
I am supposed to get hash of C H(C), which I can using the one-way hash function.
But then, after that I must get hash of other values also: H(D), H(H(H(A)+(B))) and so on in order to verify that C is a part of the Merkle tree.... Where do these hash values come from? Are they stored somewhere? If not, how are they dynamically generated?
And if all hashes are stored, how do I know that my hash H(C) has to be paired with H(D) and not H(A). Similarly for other levels also. Doesn't storing all hashes defeat the purpose of optimizing space?
https://ift.tt/2mW9K03
Comments
Post a Comment