I have been looking deep dive into Substrate and trying to understand things behind the hood, especially storage API.

I am really keen to explore more in the Merkle abstraction between Storage API and KV database.

For example:

pub(super) type SomeComplexValue<T: Config> = StorageValue<_, T::AccountId, ValueQuery>;

SomeComplexValue will have prefix in kv database when we query it through Storage RPC. But how Merkle transform block transaction into these kv and save to database. Does state proof of each block will save on kv database too?

Looking forward to some great insights and documentation that explains these concepts in depth so as Substrate Builder, I can fully understand these concepts to best use of storage.

2 Answers 2


You should check out the Storage Deep Dive here:


If you have more specific questions, feel free to open another post.

Some Highlights:

enter image description here enter image description here

  • Thanks Shawn. Very informative. May 14, 2022 at 5:17

One of the best in class resources for an overview IMHO is the Sub0 storage deep dive by Shawn Tabrizi and the presentation created here.

The primary advanced docs on storage are also good to get more context.

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.