Skip to content

Learn

Verifying delivered traffic with Merkle roots and inclusion proofs

How do you check a single visit without seeing anyone else's traffic? A Merkle inclusion proof lets you reconstruct a published hash from one record and a short set of neighboring hashes. Here's what that comparison tells you about the record, the screenshots and the limits of a delivery report.

Published by AvandaBoostFirst published

What is a Merkle proof?

Short answer

A Merkle proof lets someone test a claim about records by comparing hashes. RFC 9162 describes an inclusion proof for checking that one record belongs to a tree. A consistency proof checks whether a growing tree preserves its earlier records unchanged.

RFC 9162, published in December 2021, defines Certificate Transparency version 2.0 for logging TLS server certificates and supersedes RFC 6962. AvandaBoost uses the same tree construction to group delivery records by UTC day. A Signal Stack campaign spanning three dates can therefore have records in three daily trees.

The 2 Merkle proofs in RFC 9162
ProofWhat it showsRFC 9162 section
Inclusion proof1 record is in the tree behind a given root2.1.3
Consistency proofA larger tree keeps the first records of a smaller tree unchanged: the append-only property2.1.4

How does a Merkle tree reduce delivery records to 1 hash?

Short answer

First hash each record into a leaf. Next combine neighboring hashes and hash the pairs, repeating the process until a single value remains. That value is the root. RFC 9162 assigns different byte prefixes to leaves and internal nodes, 0x00 and 0x01 respectively, to distinguish the two operations.

The Merkle Tree Hash in RFC 9162, section 2.1.1
InputHash
1 record, d[0]HASH(0x00 || d[0]), the leaf hash
n records, more than 1HASH(0x01 || MTH(D[0:k]) || MTH(D[k:n])), where k is the largest power of 2 smaller than n

In RFC 9162 section 2.1.5, a tree with 7 records splits into groups of 4 and 3. Four is the largest power of 2 below 7. Under SHA-256 each hash, including the root, occupies 32 bytes. NIST's 2015 FIPS 180-4 standard describes using digests to detect changes to messages.

What is an inclusion proof?

Short answer

An inclusion proof supplies the neighboring hashes missing from your path through the tree. Hash your record, then combine it with those neighbors in the order determined by its index and the tree size. If the computed value matches the published root, the record belongs to that tree.

To check the first of those 7 records you need just 3 more hashes. One covers record 2, another records 3 and 4, and the third records 5 through 7. The leaf index and tree size determine which side each hash goes on. The other six records can remain private.

Inclusion proof size with SHA-256, computed from the RFC 9162 split rule
Records in the treeHashes in 1 proofProof size
7, the RFC 9162 example2 or 364 or 96 bytes
1,0008 to 10256 to 320 bytes
1,000,00012 to 20384 to 640 bytes
The longest proof grows by 1 hash each time the number of records doubles.

Why does a published daily root make records tamper-evident?

Short answer

Keeping a copy of the published root gives you a reference outside the operator's current website. Altering a record changes the root you compute from it. RFC 9162 explains that readers who receive different views of the log need a way to compare what each saw.

If the operator replaces a root on its own website, a reader visiting for the first time may see only the replacement. RFC 9162 explains why readers need a way to share log responses. Conflicting responses can supply evidence of inconsistent behavior.

Save the root for each UTC date you plan to audit. Comparing an old visit with today's root would test the wrong tree. The public ledger starts with the first day of delivery.

Keep your own copy

The ledger is also published as JSON at /proof/ledger/data.json. Save a copy on the day a root appears, and compare it later with the live file and with copies other readers saved.

What can a Merkle proof prove about a delivered visit, and what can it not?

Short answer

A successful check establishes that the submitted bytes belong to the tree identified by that root. If you kept the original root, you can detect a later alteration. The contents still need independent interpretation. A correctly included record cannot establish why someone visited or whether a ranking changed.

What a valid inclusion proof shows about 1 AvandaBoost visit record
ClaimShownCondition or reason
The record is in the tree behind the rootYesYou hold the exact leaf bytes, the proof, the leaf index, and the tree size
The record has not changed since publicationYesYour copy of the root dates from the day it was published
The 2 screenshot files match the recordYes, by hashThe leaf holds the SHA-256 of each screenshot, so an edited image no longer matches
The visit took place as recordedNoHashing does not check what a record describes
A search position changedNoA leaf has no position field, and AvandaBoost sells verified visits, not guaranteed positions

Use the sample visit report to see which details describe the visit itself. The cryptographic check then establishes whether the record submitted for verification matches the published tree.

How do you check an AvandaBoost visit against its root?

Short answer

Find the visit's UTC date and the root published for that date. The dashboard rebuilds the visit leaf, follows its inclusion proof and compares the resulting root locally in your browser. A day must have a published root before you can complete that comparison.

A leaf is the canonical JSON of 1 visit record, hashed as RFC 9162 specifies with SHA-256. No customer name, email, URL, or query is in a leaf.

Fields of an AvandaBoost leaf
Leaf fieldWhat it lets you match
Visit IDThe visit in your visit log, for example AVB-7F3C-2291
Campaign, kind, and statusThe campaign, the visit type, and the recorded status
SearchesThe searches billed under the search rules, such as 0 for a visit that fails before landing
Start time and dayThe UTC day, and so the root that covers the visit
SHA-256 of each screenshotThe 2 screenshot files of the visit
  1. Rebuild the leaf from the visit record and hash it with the 0x00 prefix.
  2. Combine the leaf hash with each hash in the inclusion proof, using the leaf index and the tree size.
  3. Compare the result with the root for that UTC day on the Merkle ledger. If the 2 differ, RFC 9162 says the proof verification fails.

For each screenshot, compute SHA-256 over the original file and compare it with the stored digest. This answers whether the image matches the record. The daily root check is separate and runs in the browser for members signed into an AvandaBoost account.

The record proves what was delivered; the article on human and automated traffic covers what a record can and cannot say about the visitor.

When a campaign spreads visits across days, the organic traffic curve covers the shape.