← Lab /Systems

PHDAG appends cost a constant ~76,276 gas regardless of tree depth, outpacing IMT

PHDAG append operations have O(1) gas cost independent of registry size and are cheaper than incremental Merkle trees for all practical depths

Systems arXiv 8 Jun 2026 Measurement Real-world evidence

Published as “Parent-Hash DAG: A Cost Analysis of Constant-Time Append for On-Chain Registries”

Why it matters

Constant-cost, low-variance appends make PHDAG a cheaper and more predictable choice for on-chain provenance registries than IMT.

Summary

The paper shows that appending to a Parent-Hash DAG (PHDAG) costs a constant ~76,276 gas per transaction, independent of tree depth, while an incremental Merkle tree (IMT) costs grow linearly with depth. They formalize PHDAG append as O(1) with explicit gas constants, derive a stochastic model for IMT per-insert cost (mean = c0 + d/2·(cL + cR), variance = d/4·(cL-cR)2), and validate both analyses on Base Sepolia across depths 1-25 with over 500 transactions. Empirically, PHDAG’s gas variance is about 6 gas, and the depth at which IMT becomes cheaper lies far below any production registry depth, making PHDAG strictly cheaper for real deployments. The evidence combines formal proofs, a closed-form cost model, and on-chain measurements, though the measurement sample is biased toward early inserts. The paper also proves that a PHDAG registry can be reconstructed from event logs in linear time without off-chain services.

What they found 2

  1. PHDAG append gas cost is depth-invariant at roughly 76,276 gas with negligible variance, while IMT cost grows linearly with depth.

    “PHDAG is observed to be depth-invariant at 76,276 gas (standard deviation about 6 gas), while IMT cost grows linearly with depth.”

  2. The depth at which IMT becomes cheaper than PHDAG is far below the depths of all production registries surveyed.

    “The crossover below which IMT is cheaper falls far beneath the depths of every production registry surveyed.”

Caveats 1

  • The depth sweep (Section 5) measures only the first max(d, 2) appends at each depth, i.e. the small indices i = 1, 2, 3, . . ., which have low Hamming weight and hence an above-average write-level count W = d -pop(i). The sweep is thus a write-heavy sub-sample of the lifetime distribution, not a uniform draw from it.

What’s new here 4

  • Isolates the parent-hash DAG as a standalone primitive with an explicit O(1) gas bound and constant term.
  • Develops a stochastic gas-cost model for incremental Merkle tree inserts, giving closed-form mean and variance.
  • Provides on-chain empirical measurements on Base Sepolia showing depth-invariant gas for PHDAG and linear growth for IMT.
  • Identifies the crossover depth where IMT becomes cheaper and shows it is below all surveyed production registries.