Parent-Hash DAG: A Cost Analysis of Constant-Time Append for On-Chain Registries
This paper introduces and formally analyzes the Parent-Hash DAG (PHDAG) as a constant-time, gas-efficient alternative to incremental Merkle trees for on-chain registries, demonstrating through theoretical modeling and empirical benchmarks that PHDAG maintains depth-invariant costs while Merkle tree costs grow linearly, making PHDAG superior for all practical production depths.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are running a digital library where people come to register new books. Every time someone adds a book, the library has to update its master list. The question this paper asks is: What is the most efficient way to update this list as the library grows from a few books to millions?
The authors compare two different ways of organizing this library: the Incremental Merkle Tree (IMT) and the Parent-Hash DAG (PHDAG).
Here is the breakdown of their findings using simple analogies.
1. The Two Approaches
The Incremental Merkle Tree (IMT): The "Tower of Blocks"
Think of the IMT as a giant, perfectly symmetrical tower of blocks.
- How it works: Every time you add a new book (a leaf), you have to climb up the tower, update the block directly above it, then the one above that, all the way to the very top (the root).
- The Cost: The taller the tower gets, the longer the climb. If the library has 1,000 books, you climb a short way. If it has 1 million books, you climb much higher.
- The Problem: The cost (in "gas," which is like the energy fee to perform the update) goes up as the library grows. It's like paying more for a taxi ride the further you go. Also, the cost varies: sometimes you have to climb a lot of stairs, sometimes fewer, depending on exactly where you place the new book.
The Parent-Hash DAG (PHDAG): The "Chain of Letters"
Think of the PHDAG as a chain of letters passed between friends.
- How it works: When you add a new book, you simply write down its details and write a note saying, "This book follows that specific previous book." You drop this note into a public mailbox (the blockchain event log). You don't need to climb a tower or update a central root. You just write your note and link it to the past.
- The Cost: It doesn't matter if the library has 10 books or 10 million. You always write the same amount of text and drop it in the same mailbox.
- The Benefit: The cost is constant. It never changes, no matter how big the library gets. It's like paying a flat fee to send a postcard, regardless of how many postcards have been sent before.
2. The Big Discovery: When Does the Switch Happen?
The authors did the math and ran real-world tests on a test network (Base Sepolia) to see exactly when the "Chain of Letters" (PHDAG) becomes cheaper than the "Tower of Blocks" (IMT).
- The Tipping Point: They found that the "Tower" is only cheaper when the library is tiny (less than about 7 levels deep).
- The Reality: Almost every real-world system that uses these registries (like privacy tools or identity systems) is much, much deeper than 7 levels. They are usually 20 to 40 levels deep.
- The Result: In the real world, the "Chain of Letters" (PHDAG) is always cheaper and always predictable.
3. Why Does This Matter? (The "Variance" Problem)
Imagine you are a delivery service charging a fixed fee to update the library.
- With the Tower (IMT): Sometimes the update is cheap, sometimes it's expensive. You have to guess the price. If you guess wrong, you might lose money on expensive updates. The cost "jitters" up and down.
- With the Chain (PHDAG): The price is always exactly the same. There is no guessing. The authors found the cost fluctuates by only about 6 units of gas (a tiny amount), which is practically zero. This makes it incredibly reliable for businesses.
4. The "Reconstruction" Superpower
There is one other major difference.
- The Tower (IMT): To prove a book exists, you need a specific "proof" (a receipt showing the path up the tower). If the central index breaks, you might lose the ability to verify the whole tower easily.
- The Chain (PHDAG): The entire history is written in the public mailbox (event logs). Even if the computer running the library crashes, anyone can walk through the mailbox, read the letters in order, and rebuild the entire library from scratch. It is "indestructible" because the history is scattered across the public record, not locked in one storage slot.
5. The Bottom Line
The paper concludes that for any large-scale, real-world system that needs to record a history of events (like proving who owns what digital art or tracking supply chains):
- Stop using the Tower (IMT) for this specific job. It gets too expensive and unpredictable as it grows.
- Start using the Chain (PHDAG). It is cheaper, the price never changes, and the data is safer because it can be rebuilt from public records at any time.
The authors suggest that the blockchain community should adopt this "Chain of Letters" method as a standard rule for all future provenance registries, because it is the most efficient and robust way to handle large amounts of data.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.