In Ethereum, there's a hash of all of the 3 tries in each block.
Out of curiosity.
The docs state that the functionality is supposed to just provide a mapping between 160bit keys and values. I find this not clear.
If there's a hash for each trie, the hash depends on a particular order of data etc. So if we implement the trie as a Merkle-Patricia trie with 3 types of nodes then if each of these 3 node types contains a hash of itself (and in case of a Branch-node the hashes of all the nodes below then the hash IS implementation-dependant.
Would you shed some light?
Specific questions:
Which trie nodes contain a hash? In case of a leaf-node, it is clear. it contains a hash of the data it contains. In case of an extension node, it is the same. What about the branch node? does it contain a hash of all of its children located one level below?
Or do maybe the branch nodes just contain a hash of all the leaf nodes below. Even if so, the hash in the root of each of the 3 tries would depend on the order of leaves.
So even if we leave the implementation details omitted, all the implementations would need to come up with the very same hash for each of the 3 tries.
The entire question could be formulated as:
How exactly is the hash for each of the 3 tries computed?
For instance, from a cryptographic point of view, there would be no point for an extension node to contain a hash of itself or even to take such an abstract object under consideration when computing the higher-level (in the-trie) hash what would only matter in the end would be the data stored in the leaves below.