TreePIR: Efficient Private Retrieval of Merkle Proofs via Tree Colorings with Fast Indexing and Zero Storage Overhead

Quang Cao, Rinaldo Gagiano, Duy C. Huynh, Xun Yi, Son Hoang Dau, Phuc Lu Le, Quang-Hung Luu, Emanuele Viterbo, Yu-Chih Huang, Jingge Zhu, Mohammad M. Jalalzai, Feng Chen · DOI

Abstract

A Batch Private Information Retrieval (batch-PIR) scheme allows a client to retrieve multiple data items from a database without revealing them to the storage server(s). Most existing approaches for batch-PIR are based on batch codes, in particular, probabilistic batch codes (PBC), which incur large storage overheads. In this work, we show that zero storage overhead is achievable for tree-shaped databases. In particular, we develop TreePIR, a novel approach tailored for private retrieval of the set of nodes along an arbitrary root-to-leaf path in a Merkle tree with no storage redundancy. TreePIR, which employs a novel tree coloring, outperforms PBC, a fundamental component in state-of-the-art batch-PIR schemes, in all metrics, achieving 3x lower total storage and 1.5-2x lower computation and communication costs. Most notably, TreePIR has 8-160x lower setup time and its polylog-complexity indexing algorithm is 19-160x faster than PBC for trees of 2^10 to 2^24 leaves.

Introduction

Merkle trees are fundamental to modern data integrity, underpinning systems like Amazon DynamoDB, Google’s Certificate Transparency (CT), and various blockchains. To verify an item's inclusion, a client must fetch a "Merkle proof"—a sequence of hashes along the path from a leaf to the root. However, this process introduces a significant privacy vulnerability: by requesting a specific proof, the client reveals exactly which data item (e.g., a specific certificate or transaction) they are interested in to the server.

While Private Information Retrieval (PIR) can mitigate this by allowing clients to fetch data without revealing their queries, standard PIR is optimized for single-item retrieval. Merkle proofs require a "batch" of items. Existing batch-PIR solutions, such as Probabilistic Batch Codes (PBC), are general-purpose and often inefficient for tree structures, typically requiring 3x storage overhead and massive indexing maps that can rival the size of the database itself.

The TreePIR Approach

TreePIR addresses these inefficiencies by exploiting the inherent geometric structure of Merkle trees. Unlike general batch-PIR, which treats data as a flat list, TreePIR uses structured tree colorings to achieve zero storage redundancy.

Path Transformation via Swapping

The first step in the TreePIR pipeline is transforming the Merkle proof retrieval pattern. A standard proof consists of the sibling hashes of nodes on a root-to-leaf path. By "swapping" sibling nodes based on their position, TreePIR transforms the retrieval of a proof into the retrieval of a simple root-to-leaf path. This makes the access pattern highly predictable.

Transforming a Merkle proof into a root-to-leaf path via node swapping.

Balanced Ancestral Coloring

The core innovation of TreePIR is Balanced Ancestral Coloring. The authors prove that a binary tree of height $h$ can be colored with $h$ colors such that every root-to-leaf path contains exactly one node of each color. This property allows the database to be partitioned into $h$ sub-databases, each containing only nodes of a specific color.

TreePIR architecture: Partitioning a colored Merkle tree into sub-databases for batch retrieval.

Because every path is guaranteed to have exactly one node per color, a client can retrieve a full Merkle proof by sending one PIR query to each sub-database. This ensures that no single sub-database is queried twice for the same path, avoiding collisions and eliminating the need for the data replication (redundancy) required by PBC.

Fast Indexing and Zero Storage Overhead

In traditional batch-PIR, clients must download a large "map" to locate items. For a tree with 2^24 leaves, a PBC index can reach 4.7 GB. TreePIR eliminates this overhead entirely. By running a miniature version of the coloring algorithm (the Color-Splitting Algorithm or CSA), the client can calculate the exact location of any node in $O(h^3)$ time. This computation is essentially instantaneous, even for massive trees with billions of nodes.

Evaluation and Results

The researchers evaluated TreePIR using real-world data from Google Certificate Transparency logs (Xenon2024) and synthetic tests on trees with up to 2^36 leaves (64 billion nodes). TreePIR was compared against state-of-the-art PBC implementations used in systems like SealPIR and Spiral.

The results demonstrate that TreePIR outperforms PBC across all key metrics:

  • Storage: Achieves 3x lower total storage by eliminating the 200% redundancy required by PBC.
  • Computation: Offers 1.5-2x faster server-side computation and query generation.
  • Setup and Indexing: Setup is 8-160x faster, and indexing speed is 19-160x faster. For a tree with 64 billion leaves, TreePIR calculates indices in under one millisecond.
  • Communication: Reduces communication costs by approximately 1.5x.

Conclusion and Future Work

TreePIR demonstrates that by treating data structure as a feature rather than a constraint, it is possible to build highly specialized PIR schemes that far exceed the performance of general-purpose solutions. By achieving zero storage overhead and near-instant indexing, TreePIR provides a practical path for privacy-preserving verification in large-scale systems. Future work includes extending ancestral coloring to $q$-ary structures like Verkle trees and optimizing the scheme for dynamic, frequently updated databases.

Summary updated

Abstract

A Batch Private Information Retrieval (batch-PIR) scheme allows a client to retrieve multiple data items from a database without revealing them to the storage server(s). Most existing approaches for batch-PIR are based on batch codes, in particular, probabilistic batch codes (PBC) (Angel et al. S&P'18), which incur large storage overheads. In this work, we show that \textit{zero} storage overhead is achievable for tree-shaped databases. In particular, we develop TreePIR, a novel approach tailored made for private retrieval of the set of nodes along an arbitrary root-to-leaf path in a Merkle tree with no storage redundancy. This type of trees has been widely implemented in many real-world systems such as Amazon DynamoDB, Google's Certificate Transparency, and blockchains. Tree nodes along a root-to-leaf path forms the well-known Merkle proof. TreePIR, which employs a novel tree coloring, outperforms PBC, a fundamental component in state-of-the-art batch-PIR schemes (Angel et al. S&P'18, Mughees-Ren S&P'23, Liu et al. S&P'24), in all metrics, achieving $3\times$ lower total storage and $1.5$-$2\times$ lower computation and communication costs. Most notably, TreePIR has $8$-$160\times$ lower setup time and its polylog-complexity indexing algorithm is $19$-$160\times$ faster than PBC for trees of $2^{10}$-$2^{24}$ leaves.
BibTeX
@misc{cao2022treepir,
  author = {Quang Cao and Rinaldo Gagiano and Duy C. Huynh and Xun Yi and Son Hoang Dau and Phuc Lu Le and Quang-Hung Luu and Emanuele Viterbo and Yu-Chih Huang and Jingge Zhu and Mohammad M. Jalalzai and Feng Chen},
  title = {{TreePIR: Efficient Private Retrieval of Merkle Proofs via Tree Colorings with Fast Indexing and Zero Storage Overhead}},
  year = {2022},
  eprint = {2205.05211},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.05211},
}
Figure