3

I understand the Ethereum block header contains a Merkle Patricia Trie (MPT) root for the global state, one for receipts (which I don't understand but am not focussed on for now), and one for all the transactions in the block.

I also understand why an MPT might be more efficient to use for the state tree, namely because it makes it easier to secure data that is structured around accounts ids and referenced by account id.

However I don't understand why the transaction trie for the block needs to be an MPT instead of a plain Merkle Trie. Presumably you can just use the transactions list in a block to modify the state trie, and be assured that the transaction list is valid with a plain Merkle Trie root.

I can't see any benefit of structuring transactions as a Patricia Trie where transactions would presumably be organised by their hash which is unique and which points to data that will never change.

So why not just use a plain Merkle Trie for transactions? Is it just to keep consistency with the way Storage and State tries are structured (and in which the benefit of the MPT structure is clearer)?

3

First, it should be noted that there is no such thing as a "plain Merkle Trie". The Merkle tree found in Bitcoin is not a radix tree (trie).

The main reason Ethereum uses a Patricia Trie for transactions is simply uniformity. The current protocol specifies exactly one kind of tree-like data structure. Switching to a standard Merkle tree would require specifying an additional data structure, as well as implementing this data structure in every client. It is simpler to reuse the existing machinery.

  • Awesome thanks makes total sense and you're right re the Merkle Tree terminology. I'll wait to see if there are any other views that might be relevant but otherwise will mark this as the answer thank you! – martellalex Feb 7 at 2:33
1

Confirmed by the man himself ... Ethereum used MPT for transactions instead of standard Merkle Trie so that they wouldn’t have to code two different types of Merkle Tries https://twitter.com/vitalikbuterin/status/1093421195834187776?s=21

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.