Cartesian Merkle Tree
Artem Chystiakov, Oleh Komendant, Kyrylo Riabov
TL;DR
Addresses the need for efficient, verifiable data structures on-chain and in zero-knowledge systems. Proposes Cartesian Merkle Tree (CMT), a deterministic Cartesian tree with Merkleized nodes where priority $p$ is derived from the key via a hash, enabling $O(\log n)$ insertions, updates, removals, and Merkle-path proofs. Provides detailed insertion/removal procedures and a formal CMT proof framework (membership and non-membership) plus reference Solidity and Circom implementations and cross-compatibility. Benchmarks show favorable trade-offs in memory and proof size, with proof sizes up to $2\times$ those of SMT and practical gas costs across datasets up to $10^4$ elements.
Abstract
This paper introduces the Cartesian Merkle Tree, a deterministic data structure that combines the properties of a Binary Search Tree, a Heap, and a Merkle tree. The Cartesian Merkle Tree supports insertions, updates, and removals of elements in $O(\log n)$ time, requires $n$ space, and enables membership and non-membership proofs via Merkle-based authentication paths. This structure is particularly suitable for zero-knowledge applications, blockchain systems, and other protocols that require efficient and verifiable data structures.
