I am trying to understand how to retrieve the complete storage of a contract based on chaindata (e.g. geth) of a full node.

I have already found how to programmatically access the chaindata (which is basically a levelDB) and the special trie structure:


Is this the way to go to get the contract storage?

  • What exactly are you trying to achieve? Dump the complete storage or lookup single slots?
    – ivicaa
    Mar 29, 2018 at 10:44
  • Thanks for the reply. I would like to dump the "used" storage :) And therefore to access mappings and struct values (of contracts), which are not stored linearly in the storage space (but keccak is involved to identify the memory location)
    – mateuszk87
    Mar 29, 2018 at 12:59

1 Answer 1


Dumping storage is possible

Refer to the functionality of geth dump

a) https://github.com/ethereum/go-ethereum/blob/9e5f03b6c487175cc5aa1224e5e12fd573f483a7/core/state/dump.go

b) https://github.com/Arachnid/uscc/tree/master/submissions-2017/doughoyte

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.