FAQ
Q: What does Max Depth mean in the context of a tree?
A: The Max Depth is the maximum number of hops it takes to get from any leaf to the root of the tree. This determines the maximum number of nodes (or pieces of data) the tree can store. 2^Max Depth = Max Number of Nodes.
Q: How is the cost of creating a tree calculated?
A: The cost depends on three factors: maxDepth, maxBufferSize, and canopyDepth. These factors determine the amount of on-chain storage required, and therefore the cost in lamports.
Q: Why does canopy depth matter?
A: Transaction Efficiency: A larger canopy depth means fewer proof nodes need to be included in each update transaction, keeping the overall transaction size below the limit.
Cost: While a larger canopy depth increases the upfront cost of tree creation, it can reduce the transaction costs in the long run.
Composability: A smaller canopy depth limits the composability of the tree with other Solana programs or dApps, as more proof nodes will need to be included in each transaction.
Verification Speed: A larger canopy helps speed up the verification process since fewer nodes need to be checked.
Q: Why is a higher canopy level for depth X not possible?
A: Accounts have a maximum size of 10 MB. If the canopy level is too high, the account will exceed this limit.