
Records a stranger can verify · Technical gear
You will be able to: explain, from the Horizon judgments, why a system's output is not reliable evidence against a person merely because a computer produced it, and state the conditions under which it could be; specify a tamper-evident record (JCS canonicalisation, a hash chain or Merkle tree, an Ed25519-signed checkpoint) and state precisely what verification establishes relative to a pinned key and an expected checkpoint delivered out of band, and what it cannot establish; and specify an evidence bundle for an auditor with no prior access to the system, including what it must exclude.
As of November 2026 (sandbox details as of 19 November 2026). Reviewed and published, version 1.0.0. Big Widget Company and its systems are made up. Primary sources are in sources.yml. The verifier below is a teaching algorithm: no executable verifier ships with this module, and none has been tested against a deployed system. The course's offline sandbox has a runnable verifier with a different construction; section 2 maps one to the other.
1. Machine output as evidence: the Horizon judgments
The record
Horizon was the computerised accounting system in branch post offices. Post Office Limited (POL) prosecuted sub-postmasters and sub-postmistresses (SPMs) between 2003 and 2013 for offences of dishonesty.1
Bates v Post Office Ltd (No 6) "Horizon Issues" [2019] EWHC 3408 (QB), Fraser J, 16 December 2019, para 936: Legacy Horizon "was not robust"; Horizon Online (HNG-X) was better, but "its robustness was questionable, and did not justify the confidence placed in it by the Post Office in terms of its accuracy". The experts agreed the later HNG-A was "far more robust".2
Hamilton & Others v Post Office Ltd [2021] EWCA Crim 577, 23 April 2021, 42 appellants.1 The Court of Appeal adopted Fraser J's findings, and its judgment records the facts an engineer should care about:
| Finding | Paragraph (Hamilton) | What it means for a record designer |
|---|---|---|
| Bugs, errors and defects created "a material risk that an apparent shortfall in the branch accounts did not in fact reflect missing cash or stock" | 121 | The output could report the very event it was used to prove when it had not happened; the court found a material risk, not a measured rate |
| Fujitsu could "insert, inject, edit or delete transaction data or data in branch accounts" ... "all without the knowledge or consent of the SPM in question"; an injected transaction "would look as though the SPM had done it" (citing Bates at [1001], [1004]) | 49 | Privileged write access existed outside the subject's view, and attribution in the record could not distinguish it |
| Fujitsu's audit (ARQ) data was "a complete and accurate record of all keystrokes" | 15 | A higher-fidelity record existed |
| POL "did not use audit or ARQ data", relying on management data; Fraser J called the audit data "the best evidence available of what has occurred on Horizon" | 45 | The evidence relied on was not the best available |
| No evidence that PEAKs or KELs (Fujitsu's bug records) were disclosed in any prosecution before the High Court proceedings | 18 | Known-defect records were withheld from the party challenging the output |
| "If the Horizon data was not reliable, there was no basis for the prosecution." | 123 | No independent corroboration |
| POL "effectively sought to reverse the burden of proof", treating "a shortfall shown by an unreliable accounting system as an incontrovertible loss" | 137 | Output was treated as ground truth, and the subject was expected to disprove it |
The convictions in all 39 "Horizon cases" were quashed; the three appeals in which Horizon data was not essential to the prosecution were dismissed.1
The engineering reading
Write $S$ for "the system reports a shortfall" and $L$ for "money was actually lost". The prosecutions proceeded as if $P(L \mid S) = 1$. The findings above say three things about that assumption, without any need to put numbers on it: $P(S \mid \neg L)$ was materially above zero (para 121); the record of who caused an entry was not reliable under privileged injection (para 49); and the information needed to estimate either was held by the system's operators: the bug records were not disclosed (para 18), and the audit data was not used (para 45).1
So the conditions for a machine output to bear weight against a person are, at minimum:
- Corroboration: evidence that does not share the system's failure modes.
- Integrity and attribution of the record: every write, including privileged and operator writes, is itself recorded in a way the subject and a stranger can check (section 2).
- Disclosure of known defects: the defect log is part of the evidence, not internal housekeeping (section 3).
- A challengeable record: the subject can obtain the best available record, not a derived view.
The three dismissed appeals show the converse: where the case did not rest on Horizon data, the convictions stood.1 The lesson is not that machine records are inadmissible or useless; it is that their reliability must be shown, not presumed.
Misconception corrected: "Computer records are accurate unless someone proves otherwise." That presumption, applied to Horizon, placed what the Court of Appeal called an "improper burden" on defendants who were denied the material to discharge it.1
Big Widget Company
A made-up warranty-fraud classifier flags a dealer, and a manager proposes cutting off the dealer's payments. The gate puts the proposed action on hold, not deny: the flag is not relied on, nothing is decided against the dealer, and ordinary payments continue. Only the warranty operations lead, a named role, can take the proposal off hold or escalate it. Before any adverse action: (1) corroborate against parts invoices and physical inspection; (2) confirm, from the chained change log, that the parts-usage table has no operator edits since the claims were filed; (3) attach the model's known-issues entry for a region-specific part-code fault to the case file shared with the decider and the dealer. If any of the three cannot be done, the answer is "not checked", and the adverse action does not proceed on the flag.
Withholding payment is itself adverse, so a hold on the decision must not become a freeze on the money by default. Any interim restraint is a separate, accountable decision by a named person, with a recorded reason, a duration and review point, and a route for the dealer to challenge it; the model flag is not sufficient grounds for it.
2. A tamper-evident record, specified
Figure data as text
Three parts of a checkable record
- SAME BYTES — canonical JSON (JCS): properties sorted, array order kept, numbers written one fixed way. [s4]
- CHAIN — each entry hashes the last: change, remove or reorder one and every later hash changes. (course)
- SIGN — a signed checkpoint: the entry count and head hash, signed with an Ed25519 key. [s5, s6]
- CHECK — against what you got separately: verify with a key and checkpoint not taken from the bundle. (course)
Objective: 400.8-b. Text equivalent of figures/three-parts-of-a-checkable-record.svg.
Threat model
Adopt the model of Crosby and Wallach (2009): an untrusted logger that is the sole author of the log, clients that submit events, and auditors who challenge the logger to prove correct behaviour.3 Assume, as they do, that an attacker "cannot forge digital signatures or find collisions in cryptographic hash functions".3 The goal is detection, not prevention: tamper-resistance "might be impossible", and "If the log is never examined, then tampering cannot be detected."3 Fujitsu's position in the Horizon findings, a privileged party with write access the subject could not see, is exactly the untrusted-logger case.1
Construction
Let $H$ be a collision-resistant hash and $\mathrm{JCS}(\cdot)$ the RFC 8785 canonical serialisation.
Canonicalisation. Signing and hashing operate on bytes, so semantically equal JSON must serialise identically. RFC 8785: "Cryptographic operations like hashing and signing need the data to be expressed in an invariant format". Properties "MUST be sorted recursively"; "array element order MUST NOT be changed"; numbers follow the ECMAScript serialisation; NaN or Infinity "MUST cause a compliant JCS implementation to terminate".4 Two consequences for record design: never put floats you intend to compare exactly into a receipt (encode decimals as strings or integers in minor units), and validate before canonicalising, since a NaN halts the pipeline.
Chain. For events $e_1, \dots, e_n$:
h_0 = H(\texttt{"genesis"} \,\Vert\, \mathit{log\_id}), \qquad
h_i = H\big(h_{i-1} \,\Vert\, H(\mathrm{JCS}(e_i))\big)
Each receipt $e_i$ carries its index $i$, the previous head $h_{i-1}$, a timestamp as asserted by the logger, the system and model version, the policy hash, the decision (allow, constrain, hold or deny) and the approving role with the key id of the gate that recorded it: never the prompt, output or personal data, and never a person's name or staff number (section 3 gives the reason and the limit). Prefixing distinct inputs with distinct tags (domain separation) prevents a leaf from being reinterpreted as an interior value; RFC 9162 does this for Merkle leaves with $\mathrm{MTH}(\{d_0\}) = \mathrm{HASH}(\texttt{0x00} \Vert d_0)$.5
Checkpoint. $C_n = \mathrm{JCS}(\{\texttt{log\id}, n, h_n, \texttt{alg}\})$, signed $\sigma_n = \mathrm{Sign}{sk}(C_n)$ with Ed25519.6 RFC 8032 gives Ed25519 32-byte public keys, 64-byte signatures and a deterministic signing procedure, and verification decodes $(R, S)$ and checks a group equation against the public key $A$ and message; any decoding failure means the signature is invalid.6 Certificate Transparency's analogue is the signed tree head; a log "SHOULD sign its current tree head information" periodically.5 Beacon reports using the same pair, JCS and Ed25519, for its receipts.7
Verification (offline). Inputs: the bundle, a pinned public key $A^{}$, the log identity $\mathit{log\_id}^{}$ and an expected checkpoint $(n^{}, h^{})$, all obtained through a channel independent of the bundle. Matching a key string is not verification: PASS must rest on an actual signature check, by $A^{}$, over the checkpoint that commits to $(n^{}, h^{*})$. The bundle's own copy of the key is never used.
verify(bundle, A*, log_id*, n*, h*):
# 1. Authenticate the expected checkpoint itself. No signature check, no PASS.
(C, sig) := the entry in bundle.checkpoints with C.n == n*
require (C, sig) exists # none for n* (including an empty list) -> FAIL
require C.log_id == log_id* and C.alg == "Ed25519" and C.head == h*
require Verify(A*, JCS(C), sig) # Ed25519 verification under the pinned key
# 2. Recompute the chain.
require len(bundle.receipts) >= n* # else: truncated -> FAIL
h[0] := H("genesis" || log_id*)
for i in 1..len(bundle.receipts):
e := bundle.receipts[i]
require e.index == i and e.prev == h[i-1] # order and linkage
h[i] := H(h[i-1] || H(JCS(e)))
require h[n*] == h* # the prefix matches the authenticated head
# 3. Every other checkpoint shipped in the bundle must also hold; none is skipped.
for each (C_k, sig_k) in bundle.checkpoints:
require C_k.log_id == log_id* and C_k.alg == "Ed25519" and C_k.n <= len(bundle.receipts)
require Verify(A*, JCS(C_k), sig_k) and C_k.head == h[C_k.n]
return PASS(log log_id*, entries 1..n*, checkpoint (n*, h*), key A*)
Step 1 is what closes two gaps an earlier draft of this algorithm left open: a bundle with no checkpoints, and a bundle whose only signed checkpoint covers an older, shorter prefix. Both must fail. Entries after $n^{*}$ are chained and may be covered by later checkpoints, but the expected checkpoint says nothing about them.
The course sandbox: same questions, a different construction
The course repository's offline Level 400 sandbox, apps/sandbox400/ on the main branch, has a runnable verifier (verify_bundle.py) and a synthetic project bundle, bundles/bw-svc-notes-400p, with its trust file trust/bw-svc-notes-400p.trust.json and a tamper generator (sandbox400.py tamper). Its README maps them to this module and to the Level 400 project. That kit is not an implementation of verify above. It is a separate construction, stated in each bundle's own VERIFY.md, that asks the same questions: is the key the pinned one, is the chain intact, and does a checkpoint signed by that key match the count and head received out of band?
This module (verify above) | Sandbox kit (VERIFY.md in each bundle) | |
|---|---|---|
| What is signed | Checkpoints only | Every record, and every checkpoint, under the evidence key; the manifest under a separate packaging key |
| Numbering | Index $i = 1..n$; $n^{*}$ is a count | seq counts up from first_seq in the trust file: 0 in the project bundle (seq 0..41, 42 records), 1 in the 400.9 bundles A to C. The checkpoint's n is the seq of the last covered record, so seq 41 covers 42 records |
| Genesis | $h_0 = H(\texttt{"genesis"} \Vert \mathit{log\_id})$ | The first record's prev_hash is 64 zeros |
| Record hash and head | $h_i = H(h_{i-1} \Vert H(\mathrm{JCS}(e_i)))$, domain-separated | $b_i = \mathrm{JCS}(\{\texttt{seq}, \texttt{prev\_hash}, \texttt{body}\})$; the record hash at seq $n$ is SHA-256($b_n$), which is the head; the next record's prev_hash is that hash |
| Checkpoint fields | log_id, $n$, $h_n$, alg = Ed25519 | log_id, alg = ed25519+sha256+jcs, n, head, policy_version, policy_sha256, time |
| Trust received separately | $A^{}$, $\mathit{log\_id}^{}$, $(n^{}, h^{})$ | Evidence- and packaging-key fingerprints, log_id, first_seq, and the checkpoint (n, head, policy version and hash) |
| Missing or older-only checkpoint | FAIL at step 1 | REJECT at step 3: "no signed checkpoint matches" |
The last row is the one that matters for the exercises. Since the change to main on 19 November 2026 (commit 5459b20, "Require matching signed checkpoints"), the kit also rejects a bundle with no checkpoint, or with only an older signed one, even when every record signature and the chain verify. A red-team check of the earlier kit, on 19 November 2026, found that both cases were accepted then; on the current main, re-manifested copies of the project bundle with no checkpoint, and with only a validly signed checkpoint at seq 30, both reject at step 3. Both constructions therefore give Q12's answer, for different reasons in different code.
Which rules govern which exercise:
- This module's examples, the workbook's Exercise 2 and quiz questions 4, 5, 11 and 12 use the teaching construction above: records numbered from 1, and a checkpoint that states a count and a head.
- The sandbox exercises use the kit's
VERIFY.mdand trust file. Read its numbers in its own terms (seq 41 is 42 records), and do not compute this module's $h_i$ over the kit's records: the heads will not match, by design. - A kit ACCEPT is not a run of this module's
verify, and neither is a sign-off. It says what the kit's own statement says: integrity and origin under the pinned keys, complete up to the checkpoint. The kit's keys are course test keys derived from public labels, so anyone can sign with them; a pass there shows how the check works, not who signed. This module ships no executable implementation of the teaching algorithm above.
Cost: chains versus trees
A chain's consistency proof between checkpoints $j < k$ is the $k - j$ intervening entries; an inclusion proof for one entry is linear in the log. Crosby and Wallach report that "a classic hash chain might require an 800 MB trace to prove that a randomly chosen event is in a log with 80 million events", where their history tree "returns a 3 KB proof".3 RFC 9162 uses Merkle trees, where "Merkle consistency proofs prove the append-only property of the tree" and an inclusion proof "proves that the leaf exists in the tree"; consistency-proof length is bounded above by $\lceil \log_2 n \rceil + 1$.5 For the course fixtures (thousands of entries) a chain is adequate and easier to audit by hand; for production logs, use a Merkle structure.
What PASS means, and what it does not
Under the assumptions above, PASS against $(A^{}, \mathit{log\_id}^{}, n^{}, h^{})$ establishes:
- Integrity: entries $1..n^{}$ are byte-identical to what was hashed when $h^{}$ was formed.
- Origin: the checkpoint $(\mathit{log\_id}^{}, n^{}, h^{})$ was signed by a holder of the secret key matching $A^{}$.
- Prefix completeness: no entry in $1..n^{*}$ was removed, inserted or reordered.
All three hold only because $A^{}$ *and the whole expected checkpoint, both count and head, came from outside the bundle. A logger holding the real key can sign two different histories of the same length; only the head $h^{*}$ tells them apart.
It does not establish:
| Not established | Why |
|---|---|
| Truth of any entry's content | A signature binds bytes to a key; RFC 8032 verification checks the equation, not the semantics.6 A Horizon-style bug or privileged injection written before hashing is faithfully preserved.1 |
| Completeness after $n^{*}$ | Entries past the expected checkpoint, or events never logged, are invisible to the check |
| Completeness at all, if $(n^{}, h^{})$ came from the bundle | A truncated chain re-signed by the logger is internally consistent |
| Who holds $sk$, if $A^{*}$ came from the bundle | An attacker can ship their own key with their own chain |
| Absence of a split view | A logger can present "different views of the log to different auditors and clients"; auditors must reconcile commitments, e.g. by gossip or public publication.3 RFC 9162 names "a misbehaving log that shows different, inconsistent views of itself to different clients".5 |
| Correct timestamps | A timestamp inside the signed bytes is the logger's assertion |
| That the decision was right | Out of scope of any integrity check |
| That the named policy was applied, or the recorded approval happened | A receipt naming a policy hash and an approving role is the logger's signed attestation; the logger can sign it without running that policy or obtaining that approval |
| Anything before signing | Provenance begins at the first hash |
| Indefinite validity | Ed25519 targets about 128-bit security, and RFC 8032 states "A sufficiently large quantum computer would be able to break both" curves.6 Record alg in the checkpoint. |
RFC 9162 is cited here as a specification of a protocol design, not as evidence about any deployed log.5
Carry-forward from Level 300. Your 300 hold card and audit receipt enter the 400 bundle as entries with a provenance label: origin: level-300, content_free: true, signed_at_source: true|false. Signing at packaging gives integrity from packaging onward only; the stranger's statement must say so.
Misconception corrected: "A signed record proves that what it says is true, and a chain that verifies is complete." Verification proves integrity, origin relative to a pinned key, and completeness relative to an expected checkpoint, and nothing more.
Big Widget Company
The warranty receipt log signs a checkpoint nightly and emails $(\mathit{log\_id}, n, h_n)$ to the internal-audit mailbox, which the logging team cannot write to. An auditor's bundle verifies internally at $n = 4{,}000$. The emailed checkpoint says $n^{*} = 4{,}112$. verify fails at step 1: the bundle has no signed checkpoint for 4,112, and it is 112 receipts short. The key matches the fingerprint registered with the security team at key creation, but that does not rescue the bundle. The auditor records FAIL and holds the bundle; she does not decide what the missing receipts would have shown. Their content is recorded as unknown, with the receipt-log owner named to account for the gap and supply a bundle that verifies. (Made-up numbers.)
3. The evidence bundle
Contents
Beacon's bundle comprises "the manifest, the NDJSON receipt log, the public keys, the policy YAMLs, the checklists, and a one-page VERIFY.md"; its frameworks ship "as machine-readable YAML and XML", mapped to control IDs.7 Beacon is the Foundation's own tool: treat its page as developer documentation, not independent validation. This course's minimum, for a stranger who has never seen the system:
bundle/
MANIFEST.json # payload files only: path + SHA-256 of each (see "Manifest" below)
MANIFEST.sig # detached Ed25519 signature over JCS(MANIFEST.json), by the packaging key
receipts.ndjson # one JCS receipt per line, chained (section 2)
checkpoints.ndjson # signed checkpoints C_k, sig_k
keys/ # public keys + KEY-PROVENANCE.md: where to obtain each pinned copy out of band
policy/policy-v7.yaml
policy/policy-v7.sha256 # each receipt names this hash
crosswalk.yaml # requirement -> receipts/files that evidence it, with "checked against" and date
known-issues.md # defect and incident log, content-free, no personal data
VERIFY.md # offline steps and the bounded statement template
Manifest. This construction is this course's; it is not taken from Beacon's documentation. It is built in one direction so nothing signs itself:
- Write every payload file: everything above except
MANIFEST.jsonandMANIFEST.sig. - Write
MANIFEST.json: the path and SHA-256 of every payload file, plus the bundle'slog_id. It lists neither itself norMANIFEST.sig; those two are the only exclusions. - Sign $\mathrm{JCS}(\texttt{MANIFEST.json})$ with the packaging key and write the detached signature to
MANIFEST.sig. The packaging key is pinned out of band like the log key, and its provenance note sits inkeys/.
The stranger verifies in the reverse order: the manifest signature under the pinned packaging key; then every listed hash; then that the bundle holds no file the manifest does not list (apart from the two exclusions); then verify from section 2. The manifest signature proves only that the bundle has not changed since it was packaged, by whoever holds the packaging key. It adds nothing to what the receipt chain and checkpoints prove, and they do not depend on it.
Policy and its hash. Each receipt records the hash of the policy it names, so the stranger can check that the policy file in the bundle is the one each receipt refers to, and spot a receipt that names a policy missing from the bundle. A matching hash shows which policy bytes were referenced. It does not show the policy was executed: that needs separate evidence, such as an independent test of the gate against the policy, or corroboration of the decisions it should have produced.
Crosswalk. Map each requirement to evidence, and date the mapping. A made-up example entry: "Big Widget warranty policy v7, rule 4: every adverse dealer decision is held until a named role approves it → receipts with decision: hold followed by an approval receipt from role warranty-ops-lead; checked against policy-v7.yaml (hash in bundle) on 18 November 2026." For any external law or standard, the entry must quote the exact text it was checked against and when; if nobody has opened that text, the entry says "not checked".
Known issues. In Hamilton, the bug records existed and, so far as the court was aware, were not disclosed in the 42 prosecutions (para 18); separately, the best available record, the audit data, was not used in disputes with SPMs over branch accounts (para 45).1 A bundle without its defect log reproduces the first failure.
VERIFY.md ends with a statement template in the bounded terms of section 2: "Entries $1..n^{}$ of log $\mathit{log\_id}^{}$ verify against key fingerprint $F$ and checkpoint $(n^{}, h^{})$, both received via [channel] on [date]. Not established: [the table above]." A person writes and signs that statement; a script printing PASS is not a sign-off. Beacon says verification needs only stock tooling: "Anyone with openssl can re-check it. No vendor login. No phoning home."7
Exclusions
The bundle must contain no prompts, no model outputs and no personal data, and no receipt may carry a payload: a receipt holds hashes, the decision, the policy hash, the approving role and key ids, and no private content. Beacon states its beacons "never store prompts or outputs. Only signed metadata"; its page does not explicitly exclude personal data, which this course's rule does.7 Reasons: the bundle is designed to travel to parties you do not control; content adds nothing to what the stranger can verify; and content multiplies the confidentiality and data-protection surface of every copy. A bundle containing any of the three fails this course's check regardless of completeness.
What a receipt is, and is not. A receipt is an integrity-protected, attributable attestation: the logger, holding a known key, recorded that a decision was taken, naming a policy hash and an approving role. Verification proves the attestation is unchanged and came from that key. It does not prove the policy ran, or that anyone approved. Those stronger claims need evidence from outside the logger: for example, the approver's own gate signing its approval with a key the logger does not hold, an independent test of the gate against the policy, or corroboration that the decisions match what the policy requires. Where that evidence is absent, the stranger's statement says "not established".
Approval without personal data. Course rule: a receipt names the approving role (for example warranty-ops-lead) and the key id of the gate that recorded the approval, never a name, email or staff number. An opaque staff identifier is not a fix: if it can be linked back to a person, it is personal data. Which individual held the role on that day sits in the organisation's own access-controlled records, released only under its own governed process (an HR or legal request, say), never in the bundle. The limit is real: from the bundle alone the stranger can establish that an approval by that role was recorded, not which person approved, nor that they did. A hash of a case reference can also be linkable; whether a given field is personal data is a question for the organisation's data owner, not for the bundle author to assume away.
Misconception corrected: "More evidence is always better, so include the prompts and outputs." Sufficiency is defined by what the stranger must verify, not by volume. In Horizon, the best available record was not used (para 45) and the bug records were not disclosed (para 18).1
Big Widget Company
The draft warranty bundle includes samples/ (300 model inputs and outputs, "for context") and flagged_dealers.xlsx (names and phone numbers). Remove both. Then rebuild MANIFEST.json from the remaining payload files and re-sign it, writing a new MANIFEST.sig with the packaging key. The receipt log and its checkpoints do not change: the samples and the spreadsheet were never in the log.
4. The three yeses for records
The gate's decision set is allow / constrain / hold / deny (go ahead / only this far / wait for a person / no); every receipt records which.
- Get to Yes: a gate decides before any output is used against a person. Its default for a bare model flag is hold (wait for a person), not deny, and the hold applies to the proposed action, not to the subject's ordinary dealings. Before the gate can say allow, specify the corroboration, the chained record (including operator writes), the pinned-key and checkpoint channels, the known-issues log, the named role who can end the hold, and how long a hold lives before it lapses to deny. Approval is conditional on that specification, not a blanket licence.
- Stay at Yes: sign checkpoints on a fixed schedule and deliver each out of band to a party that does not operate the logger; audit regularly, since an unexamined log detects nothing.3 An approval at setup is not the end: keep checking that the gate still records every decision, including operator writes.
- Recover to Yes: on dispute, hand over the bundle and the defect log and let the other side verify. On a failed check (missing checkpoint, length, key or head mismatch), quarantine the affected range, name who owns the investigation, and let nobody act on those records until it is done. Report an unknown cause as "unknown", with its owner and next check, not as a guess. Stopping is not recovering: claim a return to yes only when a fresh bundle verifies against fresh out-of-band trust material and the cause is written in the known-issues log.
Terms: canonicalisation (RFC 8785), hash chain, Merkle tree, inclusion proof, consistency proof, signed checkpoint / signed tree head, pinned key, split view, attestation, packaging key, detached signature, provenance label, crosswalk.