I have seen that nodes hold a storage trie and state trie. What are those tries and are there these two tries per a contract code (in every copy of the blockchain)?
1 Answers
There are 4 tries in total. See How many trie's does Ethereum have?
The state trie is globally scoped, and contains a mapping of all known accounts to their state. Each leaf node of the state trie represents an account. The data structure of each leaf node contains details about the account balance, nonce, the code associated with the account, as well as the hash of the root node of...
...the account's storage trie, which is a mapping of integer keys to other integer values.
...and are there these two tries per a contract code (in every copy of the blockchain)?
As above, the contract code is associated with a specific account in the state trie. This is represented by a single leaf node in the trie. Each account will have its own entire storage trie.
- 37,835
- 13
- 87
- 144
leafnode actually contains account details, while the others are used as intermediary steps to arriving at theleaf. – Eric Jan 03 '22 at 12:42