Table of Contents
Fetching ...

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.

Cartesian Merkle Tree

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 is derived from the key via a hash, enabling 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 those of SMT and practical gas costs across datasets up to 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 time, requires 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.

Paper Structure

This paper contains 12 sections, 5 equations, 4 figures, 8 tables, 7 algorithms.

Figures (4)

  • Figure 1: Example of CMT
  • Figure 2: CMT after insertion
  • Figure 3: CMT after removal
  • Figure 4: CMT proof example