Back to the blog
Your own AITechnical detail

What turns a log into evidence

Corpilus TeamNovember 18, 20269 min read

The difference is the reader

Your application log is written by you, stored by you, and rotated by you. For debugging, that is exactly right. For an auditor, a regulator, an insurer or the other side of a dispute, it establishes nothing at all — not because anybody suspects you of forgery, but because the record offers no way to tell a forgery from the truth. Evidence is a log plus a reason for somebody else to believe it.

Three properties, in order of cost

Append-only comes first and is mostly a matter of discipline: rows are inserted, never updated, and nothing in the application has a reason to delete one. This is cheap and it is where most teams stop.

Chaining is the first real step. Each record carries a hash that covers both its own content and the hash of the record before it. Alter one row and every subsequent hash stops matching — so an alteration is no longer a local edit, it is a rewrite of everything after it. The cost is one hash per record and a strict ordering.

Anchoring in time is what defeats the rewrite. A chain you control can be rebuilt from scratch, consistently, at any time — unless some fixed point in it was witnessed by somebody who is not you. A timestamp authority signs a digest of the chain's current head at intervals; from then on, rebuilding history means also forging that signature. An hourly anchor bounds how far back a plausible rewrite could reach.

What to sign, and the mistake that makes it unaffordable

The natural instinct is to sign each record. For a system recording one decision per request, that instinct is fatal: you have bought one asymmetric signature per request, on the hottest path you own, forever.

The alternative is to sign a batch. Records accumulate, a job outside the request path computes one canonical hash over the whole set, and that single value is signed and chained. One signature covers thousands of decisions. Verification recomputes the set hash from the stored records and compares it with the signed value.

Two details decide whether this works. The set hash must not depend on the order a database happened to return rows in — canonicalise each record, sort the canonical forms, hash the result — or verification fails on untouched data and nobody trusts the verifier again. And the signed payload must include the number of records in the batch, so that a verifier can tell “retention deleted old rows” apart from “someone removed a row”. Those two look like the same event to a set hash, and treating a routine retention run as tampering is how an alarm gets ignored.

Why this matters more now than it did

Signature schemes designed to resist quantum computers produce signatures that are, in round numbers, two orders of magnitude larger than the ones in use today. A design that signs every record is not merely slower under those schemes — it becomes impractical. A design that signs one batch an hour barely notices the change.

This is the useful way to think about post-quantum readiness, and it is less exciting than the marketing version. It is not a feature you switch on. It is a set of choices made early — what gets signed, how often, with the algorithm named in the record rather than assumed — that determine whether the migration is a configuration change or a rebuild. We treat the schemes themselves as research; no current function of ours depends on them. What we do not treat as research is the shape of the design, because that is the part you cannot retrofit.

Verify the right thing

One last trap, and it is the one we walked into ourselves. A verifier that recomputes the record hash and compares it with the value stored alongside the records proves only that the records agree with that stored value. If an attacker can alter both, the verifier reports success. The comparison has to be against a value whose signature has been checked — otherwise you have built something that verifies itself and reports “valid” either way.