Herodotus Docs

Facts registry

This is the last contract in the basic Herodotus stack, that optimises the process of accessing account properties such as:
  • Nonces (If available)
  • Balances (If available)
  • Storage hash
  • Code hash
The first level of storage in account based blockchains are the actual accounts.
Proving those requires having access to the stateRoot which correctness is verified by the HeadersStore contract. With such state root a MPT proof can be verified proving the mentioned properties of an account.
These properties similarly to the HeadersStore can be saved in the state in order to reduce the amount of computation needed each time to access the smart contract storage.

Accessing contract storage

As mentioned above the first level of the storage are accounts. The second one is actual contract storage.
Such storage is committed in a Merkle Patricia Tree where it's root is the account's StorageHash.
As it is a Merkle Patricia Tree anything included inside it, can be proven.
This allows Herodotus to enable access to smart contracts storage.
Smart contracts' storage is a key value database where each key corresponds to 32 bytes of data.
To know more how to map a variable name to it's storage key please check out this section of the solidity documentation. We highly recommend using this tool when dealing with solidity smart contracts storage layout.