The merkle proof contains a list of the hashes along the branches of the merkle tree that we need to get to the merkle root. With a merkle root, we only need to download 384 bytes (12 x 32 byte branches along the path of the merkle tree) to recreate the merkle root and verify that the TXID exists in the block.Without a merkle root (i.e. just a simple hash of all the txids in the block header), we would need to download 75,232 bytes (2,351 x 32 byte TXIDs) of data to recreate the fingerprint in the block header and verify that the TXID exists in the block.Let’s say we have only have a block header for a block with 2,352 transactions, and we want to check that a specific TXID is inside the block. However, if we later wanted to check that a TXID was a part of that hash, we would need to know all the other TXIDs too: You would need every other TXID to recreate the same hash.īut with a merkle tree, if we want to check that a TXID is part of the merkle root, we would only need to know some of the hashes along the path of the tree: You only need the right branches (the “merkle proof”) to reconstruct the merkle rootĪs a result, by using a merkle root as our fingerprint for the block header, we can later find out if a transaction exists in a block without having to know every other TXID in the block.Ī merkle tree is just an efficient way to prove that something is in a set, without having to know the full set. If we wanted to create a unique fingerprint for all the transactions in a block, we could just hash all the TXIDs together in one go. This merkle root is then used as a field in a block header, which means that every block header will have a short representation of every transaction inside the block. A fingerprint for all the transactions in a block.Ī merkle root is created by hashing together pairs of TXIDs, which gives you a short yet unique fingerprint for all the transactions in a block.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |