I'm trying to find out how exactly transactions are confirmed in a block. I understand that to confirm a transaction, you hash it with its associated transaction and then the associated hashes until you get the Merkle root, and if the Merkle root is the same as that which is in the block, the transaction is legitimate.

But how would someone know which associated transaction is required to hash with your transaction to confirm its validity? And where would you get it from?

Also, i'm a little confused about Segregated Witness. As I understand it, the signatures are separated from the transactions and the signatures are hashed in the same manner as transactions. This final signature hashed is either hashed with the final transaction hash to form a Merkle root, or it is contained as another Merkle root in a separate field in the block. But if the Merkle root is always the same size (I assume) how does this save space? If the Merkle root is always 256 bits, why does it matter if the signatures are hashed with the transactions or hashed separately?

I can't find clear answers to my questions so any help will be appreciated.


I had the same question. In the graph below, suppose I'd like to validate the transaction 2, I understand the hashes of 3, 01, 4567 and the root are needed, however, I'm wondering how this Merkel path is generated at the first place.

When the transaction 2 is given to the server/node, how does the server/node know which path to return for validating 2? If the server already knew this path, why doesn't the server validate it and why bother to return this path?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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