Skip to content

Conversation

murisi
Copy link
Contributor

@murisi murisi commented Oct 3, 2025

The Merkle tree implementation based on the Zcash/MASP implementation (from a month ago). Some notes:

  • When --gas-report is used to measure gas usage, this implementation uses 30% less gas than the OpenZeppelin based implementation according to the benchmarks that were used to select the latter.
  • This PR passes the differential Merkle tree fuzz tests (i.e. it computes identical roots to the OpenZeppelin implementation on a 1000 different Merkle trees).
  • This PR only expands the Merkle tree when it is absolutely necessary. For this reason, a few of the tests had to be adjusted to expect trees with depths that are one less than the previous value.
  • test_execute_mint_transfer_burn is the only new failing test. Its failure is a NonExistingRoot failure and is probably due it using Merkle roots from eager Merkle tree expansions.

@murisi murisi force-pushed the murisi/masp-based-merkle-tree branch from 49df3e6 to e131d72 Compare October 3, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant