A tamper-evident audit log for your Java service in 10 minutes
Every serious system has an audit log. Almost none of them can prove anything.
The uncomfortable question an auditor — or a court, or your own incident-response team — will eventually ask about your audit trail is simple: how do you know nobody edited it? For most audit logs the honest answer is "you have our word." Database rows can be updated. Files can be rewritten. Even append-only object storage only proves what your cloud vendor says happened. Anyone with admin access to the log is someone the log cannot testify against — and that includes an attacker who has just become your admin.
There is a well-proven fix for this, and you already rely on it every day: transparency logs. Certificate Transparency uses one to catch mis-issued HTTPS certificates. Sigstore uses one to protect software signatures. Go's module checksum database uses one to make package tampering detectable. The pattern is a decade old, standardized in RFC 9162, and battle-tested at internet scale.
What it hasn't been, until now, is conveniently available to a Java service.
What a transparency log actually guarantees
A transparency log is a Merkle tree over your entries with two kinds of cryptographic proofs on top:
- Inclusion proofs — "this exact entry is in the log with this root hash." About
log2(n)hashes; a third party verifies it without trusting you. - Consistency proofs — "the log at size N₁ is a strict prefix of the log at size N₂." This is the append-only guarantee: verify it on every update, and rewriting, reordering, or deleting history becomes detectable by anyone, not just forbidden by policy.
The difference from an ordinary audit table is not that tampering is harder — it's that tampering cannot go unnoticed. The log periodically signs its (size, root hash) as a checkpoint; independent witnesses co-sign it; and any verifier who ever saw an older checkpoint can catch the log lying about its past. Your audit trail stops being a promise and becomes evidence.
Ten minutes, one dependency, no Scala
merklon is an open-source (Apache-2.0) transparency log built for the JVM. The core is a pure library — no framework, no I/O, no runtime dependencies beyond the Scala standard library jars your build tool treats like any other transitive dependency. The merklon-java facade exposes everything through plain java.util types, and a CI-enforced plain-Java smoke test guarantees no Scala type ever leaks into a public signature:
<dependency>
<groupId>eu.trustbeat</groupId>
<artifactId>merklon-java_3</artifactId>
<version>0.1.0</version>
</dependency>Hash your audit events, prove one is present, and prove the grown log still contains the old history unchanged:
import merklon.javadsl.Merkle;
import java.util.ArrayList;
import java.util.List;
List<byte[]> entries = new ArrayList<>(List.of(
"user=42 action=delete target=invoice-9".getBytes(),
"user=7 action=login".getBytes()));
byte[] root = Merkle.root(entries);
// A third party can now verify entry 0 is in the log — without trusting you.
List<byte[]> proof = Merkle.inclusionProof(0, entries);
boolean present = Merkle.verifyInclusion(
0, entries.size(), Merkle.leafHash(entries.get(0)), proof, root);
// Append, then prove nothing before it changed: the append-only guarantee.
int oldSize = entries.size();
entries.add("user=42 action=export target=all".getBytes());
byte[] newRoot = Merkle.root(entries);
boolean appendOnly = Merkle.verifyConsistency(
oldSize, entries.size(), root, newRoot,
Merkle.consistencyProof(oldSize, entries));Both verifications are pure functions over bytes. They run identically inside your service, in your auditor's tooling, or offline on a laptop — which is precisely the point: verification must share none of the server's trust assumptions.
When you outgrow the embedded library, the same repo ships the rest of the log: an HTTP log server with Ed25519-signed checkpoints and Postgres persistence, N-of-M witness co-signing to detect split views, offline-verifiable proof bundles, and a standalone verifier CLI that will happily tell you your own server is lying.
Want to see the whole thing running before you write a line of code? One command:
git clone https://github.com/TrustBeat/merklon.git && cd merklon
./scripts/quickstart.shIt starts Postgres, a log server and an independent witness in Docker, appends a few entries, and then has a separate verifier image check everything: the log's signature on the checkpoint, the witness's cosignature, an inclusion proof for every entry, and a consistency proof that the log only grew.
The complete walkthrough — including verifying a live log's signed checkpoints from Java — is in the repo: Getting started from Java.
Don't trust us either
A transparency log vendor asking for your trust would be missing its own point. So don't extend any: the artifacts on Maven Central can be checked against the canonical RFC 6962 test vectors — the same reference tree Certificate Transparency implementations are pinned to — with a dozen lines of Java and a checksum. The guide's last section shows exactly how, and merklon's own CI anchors every verifier build to an eIDAS-qualified timestamp issued by an EU QTSA, so even our release history is independently verifiable.
(There's more to say about verifying the vendor — we'll come back to it in a follow-up post.)
Why this matters more in Europe right now
If you operate under NIS2 or DORA, "we log everything" is no longer enough — you need audit trails whose integrity you can demonstrate to a regulator, and incident timelines that hold up when challenged. An append-only log with cryptographic proofs answers the integrity question by construction. And when you also need to show when something existed, merklon's checkpoints and proof bundles can be anchored to eIDAS-qualified timestamps issued by an EU QTSA — via Trustbeat, the same anchoring merklon uses for its own releases.
Your audit log already records what happened. Make it able to prove it.
Get started: github.com/TrustBeat/merklon · Maven Central: eu.trustbeat:merklon-java_3:0.1.0 · Getting started from Java