Skip to main content

qed-verify

An independent verifier for Valqore QED evidence chains. It answers one question — were these records written in this order, by the holder of these keys, unaltered since — without trusting the instance that produced them.

pip install qed-verify

One dependency, cryptography, on purpose: an auditor must be able to install this on a machine that is not allowed to reach the internet twice. It imports nothing from qed, and it is published as its own distribution so that installing the verifier does not install the thing it verifies.

Running it

A QED operator produces the export with qed export and hands over the public keys:

qed-verify chain.jsonl --keys keys/ --instance-id acme-prod   --anchor ./qed-checkpoint-0000001234-ab12cd34ef567890.json --require-complete

Exit codes: 0 verified, 1 one or more problems, 2 usage error. --json emits the machine-readable report, --range FROM:TO verifies a slice, and --require-complete is what a pipeline should use — it fails unless every check ran, not merely every check that ran passed.

Two of the inputs have to come from outside the export, and neither is optional for a verification that means anything: --instance-id and --anchor. The sections below are what each one buys.

What it checks

  1. seq starts at 0 and is contiguous.
  2. prev_hash of record n equals hash of record n-1, and record 0's prev_hash matches the genesis binding for --instance-id.
  3. hash recomputes from the record's own fields — from payload_hash rather than the payload, so a record purged under retention still verifies.
  4. payload_hash recomputes from the payload, when the payload is present.
  5. The signature verifies under the key named by key_id.
  6. Each key_rotated record is signed by the old key, which is what makes rotation one continuous chain instead of two.
  7. Each checkpoint record's Merkle root recomputes over the range it claims.
  8. Each --anchor matches the export: the record it names is present and byte-identical, and the records in its range recompute to its published Merkle root.

--instance-id is the one that matters

Check 2 is the only check that ties these records to a particular instance, and the only one that can be skipped. Everything else is self-referential: a chain generated on a laptop five minutes ago, signed with a key generated at the same time, satisfies checks 1 and 3–7 exactly as well as a real one. So when no instance id is given the report names the check that did not run instead of reporting an unqualified pass.

The instance id has to reach the verifier from outside the file under review — a contract, an engagement letter, the operator's published instance identity. It is also in the genesis payload, so reading it out of the export and passing it back proves nothing: a forger chose both. The same applies to the public keys.

--anchor is the only one that can see a chain that stops early

Checks 1 and 3–7 are satisfied by any prefix of a chain. Drop the last thousand records and what remains is contiguous, correctly linked, correctly signed and internally consistent. That is not a gap in this implementation; it is a property of hash chains. The record that would say more records followed is the record that was removed, so nothing inside an export can establish that it is the whole export.

An anchor can. QED publishes each checkpoint record to somewhere the instance cannot afterwards revise — an object-locked S3 key, a GCS bucket with a locked retention policy, a signed git tag. Fetch that copy from the target it was published to and pass it here:

  • a record the anchor names that the export does not contain is anchor_not_in_export, and names the seq the export ends at;
  • a record present but different is anchor_mismatch;
  • a range that recomputes to a different root is anchor_root_mismatch, reported alongside the mismatch rather than instead of it: one says the export was rewritten, the other says where.

--anchor takes a file or a directory of them, so a bucket synced to disk works without naming each object.

Two things to hold onto. An anchor the instance hands you is not an anchor — it is a second file it could have written to match, exactly as with the instance id. And an anchor covers the records it names and nothing later: with the newest one at seq 1234 and an export running to 1600, the report says those 366 records are present on the export's own word, and stays short of complete.

Why it reimplements the format

Canonicalisation and the record hash are written again here from the specification rather than shared with the producer. A shared helper would mean a bug in the producer verifies cleanly, which is the one failure this package exists to rule out.

  • Format and checks: SPEC §10.7
  • Evidence record format: schema_version is tracked independently of this package's version, and every version ever written stays verifiable.

Apache-2.0.

Metadata

Release files for qed-verify 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qed-verify 1.3.0
File Size Uploaded Provenance Actions
qed_verify-1.3.0.tar.gz 25.3 kB With provenance Details for qed_verify-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qed-verify 1.3.0
File Interpreter ABI Platform Actions
qed_verify-1.3.0-py3-none-any.whl Python 3 none any Details for qed_verify-1.3.0-py3-none-any.whl

Total release size: 44.7 kB

Release files / qed_verify-1.3.0.tar.gz

Download URL qed_verify-1.3.0.tar.gz
Size 25.3 kB
Tags Source
SHA-256 checksum
How to use checksums
34bc8043ad7aab2ae89620ee096797303970e311a4df3baab87e8bdfc3b3907d
BLAKE2b-256 checksum
How to use checksums
55f500096c12a89e3bca28623645484ad5499e698ba5e1be511444e905150827
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / qed_verify-1.3.0-py3-none-any.whl

Download URL qed_verify-1.3.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b128858af6c2f800b3b6e12d7a452c570bf11f0ab4e697651369111c6f8dbc20
BLAKE2b-256 checksum
How to use checksums
420eed607b3043710d7e77108840aad78ae59793d7c900b6464a396286792c2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for qed-verify 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qed_verify-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page