Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 9132

How to visually understand canopy depth in a Concurrent Merkle Tree

$
0
0

I've been trying for a while how to visually understand the canopy in a Concurrent Merkle Tree but I cannot fully understand it.

According to the docs, the canopy depth is the amount of upper nodes that we will cache/store onchain, so we can omit passing all proofs, because some will be already onchain.

enter image description here

I made this picture. So, my merkle tree has depth=3, which means 2³ = 16 nodes.If my canopy is 2, according to the docs, I should only pass 1 proof.(If canopy was 3, I should pass 0 proofs, If canopy was 0 I should pass 3 proofs)In my picture, the orange dots are the cached proofs (starting from the top and going left-right I suppose). The X is the node I wish to update, and the black dots are the proofs that I need to pass, that with the already cached hashes (orange) the Merkle Hash can be verified.Clearly, I need to pass 2 proofs (black dots) instead of 1. What am I doing wrong?

Can someone please illustrate this for me?Thanks!

Docs 1: https://solana.com/es/docs/advanced/state-compression#canopy-depth

Docs 2: https://spl.solana.com/account-compression/concepts#merkle-trees


Viewing all articles
Browse latest Browse all 9132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>