Transparency logs, explained

A transparency log is a tamper-evident record. Its operator can add entries but cannot remove, reorder or rewrite them unnoticed, because every reader can check two things alone: that an entry is in the log, and that today’s log extends yesterday’s. Certificate Transparency, the Go checksum database and Sigstore’s signature log all work this way.

The figures on this page are not drawings. webtessera made them while this site was built, from a log of 22 entries: the names of the package’s entry points.

Entries become leaves

Each entry is hashed into a leaf of a Merkle tree, and each pair of hashes into the node above them, up to a single root hash. A leaf and a node are hashed with different prefixes, so one cannot pass for the other. Change one byte of any entry and its leaf hash changes, then every hash on the way to the root.

rfc6962.DefaultHasher entry 5, then one byte changed
hashLeaf("webtessera/ctonly")  = 477e2a072f1891d93c61b85a…hashLeaf("webtessera/ctonlz")  = d436f2b22bc7bb77ba1e2267…

Leaves fill tiles

The tree is stored as tiles: each tile holds 256 hashes of one level of the tree. A full tile never changes, and the tile at the log’s right edge is published as a partial tile, which is replaced by a longer one as entries arrive. The entries themselves are stored in bundles of 256 beside the tiles. Every tile and bundle has a fixed path, so a log is a directory of static files that any web server, bucket or CDN can serve, and caches can keep forever.

tile/0/000.p/2222 of 256

This partial tile holds the 22 leaf hashes of the log, one cell per hash, toned by the hash; entry 5 is outlined.

Checkpoints commit

The log regularly signs its size and root hash. That signed checkpoint is a short text: the log’s name (its origin), the number of entries, the root hash, then one signature line per signer. Because the root depends on every entry, the signature commits the log to all of them, in order, for good.

GET /checkpoint signed while this page was built
origin webtessera.diagnos.healthtree size 22root hash ZSz8wsngkMgSw0QM93ZeKmU6+byX7C7Epna4q/xe96I=signature — webtessera.diagnos.health ZRxw2pzqVI3aHvMr3LYMtvDRcaYBzDDp+PQJOvqIrBrz2Hfp1scLalNNQrrFVbm+IN1khBjUU0nYkfVkzq7dZnyU2wg=

Anyone holding the log’s public key, its verifier key, can check that signature:

vkey the log’s public key
webtessera.diagnos.health+651c70da+AeuC5pEJJuQqdsnZZCqPGkq/x8sfL+E4d5QNYABEV0ge

Proofs replace trust

A reader does not need the whole log to check it. An inclusion proof shows that an entry is in the tree under a checkpoint: it is the hashes of the subtrees beside the entry’s path to the root, and hashing them in order with the entry must give the checkpoint’s root.

PATH(5, D[8])RFC 6962, a tree of eight entries
A Merkle tree of eight entries, with the inclusion proof of entry 5 Entry 5 is proven by three sibling hashes: entry 4, the pair 6 and 7, and the half of the tree holding entries 0 to 3. Hashing them in order with the entry recomputes the root. 012348533549ff537567dd0379ff0e329799f31a167fb69732 the root a checkpoint signs

In the figure, entry 5 needs three hashes, not eight entries. In the log this site built, proving that entry 5 is in the tree of 22 takes five hashes; a log of a billion entries needs about 30.

inclusionProof(5) tree of 22
  1. root652cfcc2= the root the checkpoint signs
  2. entries 16–219a39a835
  3. entries 8–15dfcf38bd
  4. entries 0–3dfc490d9
  5. entries 6–77ffccb44
  6. entry 4ddee4e10
  7. entry 5477e2a07webtessera/ctonly
Recomputed root
ZSz8wsngkMgSw0QM93ZeKmU6+byX7C7Epna4q/xe96I=
Signed root
ZSz8wsngkMgSw0QM93ZeKmU6+byX7C7Epna4q/xe96I=

A consistency proof shows that a newer checkpoint extends an older one, with nothing removed or changed. A client that keeps the last checkpoint it saw, and checks each new one this way, knows the log has only grown.

Receipts travel

A receipt bundles an entry’s index, its inclusion proof and the checkpoint the proof is relative to. Whoever holds the receipt, the entry and the log’s public key can check it offline, without asking the log anything. webtessera’s append() returns one, verified, in the C2SP tlog-proof format.

log.append(entry) a receipt, as returned
c2sp.org/tlog-proof@v1index 53e5OEKzR71EEC826t+/duVgiEmQzGsXoZnmyKDSs0V0=f/zLRMAABkldTNcL/DvLOoGqhK4zCIlcZe76Nn8zdmQ=38SQ2QlLe8DcWgXTUWBXEoZU6kWu+3cSbMr/XqDWyPs=3884vSW80bd89Jg1GxipKot2sfq7PN1asZTW3a6X7M4=mjmoNQ05JISxfYcZqqLNA3OHmykwKYnhrf7/MRNld44=webtessera.diagnos.health22ZSz8wsngkMgSw0QM93ZeKmU6+byX7C7Epna4q/xe96I=— webtessera.diagnos.health ZRxw2pzqVI3aHvMr3LYMtvDRcaYBzDDp+PQJOvqIrBrz2Hfp1scLalNNQrrFVbm+IN1khBjUU0nYkfVkzq7dZnyU2wg=

verifyReceipt: entry 5 is in the tree of 22.

Witnesses keep it honest

A log could still show one history to some readers and another to the rest. Witnesses prevent that: they are independent services that check each new checkpoint is consistent with the last one they saw, and cosign it. A reader who requires cosignatures from enough witnesses knows that everyone sees the same log. A monitor goes further, and reads every entry.

Specifications

To see these pieces in a running log, append to the log on the home page, then change an entry and watch its proof fail. To build one, start with the safe API.