DEV Community

Discussion on: Blockchain: what is in a block?

Collapse
 
damcosset profile image
Damien Cosset

In this example, by having the path J, KL, MNOP and ABCDEFGH, you can re-created the hash of each pair.

You have the I hash and J hash, so you can create a hash IJ. Because you also have the hash KL, you can create the hash IJKL.... If one hash doesn't match the original, you know the I hash is corrupt.

Collapse
 
chamarapw profile image
ChamaraPW

thank you very much

Collapse
 
arvindpdmn profile image
Arvind Padmanabhan

Do we have I hash, J hash and so on? I thought a block contains only the Merkle root? When you say I hash and J hash, do you mean the transaction IDs that are included in the block? If so, they we can compute IJ hash, etc. until we arrive at the Merkle root? Does the block include IJ hash for validation purpose? Or it is just the Merkle root that can be used for validation? Thx

Thread Thread
 
damcosset profile image
Damien Cosset

Yes, I J K ... are transactions hashes that are included in the block here.

Whenever a transaction ( in this case I ) claims to be a part of a block, we can control if the hashes we get are the same.

Thread Thread
 
arvindpdmn profile image
Arvind Padmanabhan

One more doubt. Are intermediate hashes (eg. IJ hash) included in the block or is it only the Merkle root that is included?

Thread Thread
 
damcosset profile image
Damien Cosset

Intermediate hashes are included. If I understood this part correctly, the client wants to verify a transaction is part of a block. The client gets a bloom filter that will give him the necessary hashes to verify whether or not this transaction is part of the block.

This saves a lot of resources, because you only need a few "leaves" in the tree, and not the entire merkle tree. With the path you get, you can control if you get the same hashes.