I'd like to calculate a Merkle tree on chain, and then only store the root.

The tree will track all balances for an ERC20 token. How many accounts would this be feasible for? If there are 1000 balances would it be possible to iterate over all the balances to create the Merkle root? What is the maximum number of balances for which this would be possible?

I intend to do some testing myself, but was wondering if anyone has already dealt with this and knows what sort of limits I can expect to encounter.

1 Answer 1


Though I am a few years late, figured I should address this since I know the answer. In order to calculate the Merkle Proof size, one must know the number of elements from the lowest-level of the Merkle Tree as explained in full detail in my post found here.

Let N = number of elements = 1,000 balances.

Merkle Proof Size = log2(N) = log2(1000) ≈ 9.966

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.