provenance-verify (Python)
A clean-room, zero-platform-dependency offline verifier for the TruthLayer ledger and EvidenceVault (TruthCert) certificate trust chain.
provenance-verify independently checks the cryptographic claims of both platforms from public artifacts alone — no platform endpoint, cooperation, or continued existence required. It reimplements every trust-critical primitive (RFC 8785 JSON canonicalization, RFC 6962 Merkle trees, Ed25519, ML-DSA-65, SLH-DSA-SHA2-128f, OpenTimestamps→Bitcoin, Lamport OTS) from the published format spec, depending only on audited public cryptography libraries (cryptography, dilithium-py, slh-dsa, blake3).
Why "independent" matters. The platforms ship their own verifiers, but those run identical logic to the code that produced the artifacts — a bug or tampering in that code would pass both. This package shares no code with either platform. It is a genuine second implementation whose agreement with the platform is proven, not assumed: against a byte-identical cross-implementation conformance corpus and a live field-for-field diff against the TypeScript
provenance-verifyover shared fixtures.
This is the Python sibling of the TypeScript provenance-verify npm package. Both verify the same artifacts and produce the same verdicts. MIT licensed. Python ≥ 3.10.
Install
Status: not yet published to PyPI. Until the first release lands, install from source:
pip install ./tools/independent-verify-py
Once published (via the gated publish.yml → pypi-provenance-verify):
pip install provenance-verify
CLI
# Verify a TruthLayer sealed agent-day (event chain → hourly sub-seals → daily
# root → Bitcoin anchor) from a local artifact bundle (or --base-url <url>):
provenance-verify ledger --tenant-id <t> --agent-id <a> --date <YYYY-MM-DD> --dir <bundle>
# Verify an EvidenceVault certificate (Ed25519 + ML-DSA-65 + SLH-DSA hybrid):
provenance-verify cert --cert-id <c> --tenant-id <t> --dir <bundle>
# Verify the full provenance→certificate chain, including the Merkle-root join:
provenance-verify chain --tenant-id <t> --agent-id <a> --date <d> \
--cert-id <c> --cert-tenant <t> --dir <bundle>
# Self-test the crypto core against the bundled cross-implementation corpus:
provenance-verify conformance
Exit codes: 0 ok · 1 a check failed (fail-closed) · 2 usage error.
Library
from provenance_verify import DirSource, verify_certificate_from_artifacts, verify_day
cert = verify_certificate_from_artifacts(
DirSource("bundle"), {"certId": "cert_...", "tenantId": "tnt_..."}
)
print(cert["ok"], cert["checks"])
What it verifies
- RFC 8785 (JCS) canonicalization, byte-identical to the JavaScript signer — including the ECMAScript
Number::toStringnumber format and UTF-16 key ordering. - RFC 6962 / RFC 9162 Merkle inclusion and consistency proofs (
0x00leaf /0x01node domain separation), plus the frozen Bitcoin-style v1 tree. - Hybrid-AND signatures — a certificate/seal is valid only if every family verifies: Ed25519 (RFC 8032) + ML-DSA-65 (FIPS 204) + SLH-DSA-SHA2-128f (FIPS 205).
- The trust root — two-level tenant root → time-bounded agent subkey resolution, and SLH-DSA root certifications.
- The OpenTimestamps → Bitcoin anchor — the stored calendar proof is parsed and executed to the claimed block; an unparseable/unexecutable proof is an error, never silently "pending".
- The Lamport one-time anchor — the SHA-256-only floor beneath the hybrid stack.
- Fail-closed discipline — unknown formats, hash suites, and signature suites are rejected; missing required artifacts fail closed.
Proof of faithfulness
The port is not merely internally consistent — its agreement with the reference implementation is tested:
tests/test_conformance.pyruns the sharedcanon-vectors.jsoncorpus (JCS canonical strings + SHA-256, v1/v2 Merkle roots for leaf counts 1..32) and asserts every value matches byte-for-byte.tests/test_cross_validation.pyruns the TypeScriptprovenance-verifyCLI and this implementation over the same fixtures and asserts they agree onok,validity, and the entirechecksmap, field-for-field.tests/test_fixtures.pyverifies real green bundles end-to-end and confirms tampered payloads/seals and missing registries fail closed.
pip install -e ".[test]" && pytest
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file provenance_verify-0.1.0.tar.gz.
File metadata
- Download URL: provenance_verify-0.1.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2b017e94e541c76798db4988a602330f79a60e34b8ce373a40cc2f7bd9c16b5
|
|
| MD5 |
5065d4ad7acee555482558a5e898638c
|
|
| BLAKE2b-256 |
1633f7852b93e65c2df4fe59efe3334762f0cf33422e9bb1bdea8e4c49524d31
|
File details
Details for the file provenance_verify-0.1.0-py3-none-any.whl.
File metadata
- Download URL: provenance_verify-0.1.0-py3-none-any.whl
- Upload date:
- Size: 48.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5093296a81518a9dae20ef5b994af790f4d6ec943e55b0b2ed10e2540ed0894
|
|
| MD5 |
1e115af17668f6a90a35a94942eefc38
|
|
| BLAKE2b-256 |
0abaf708a50bc3b70f26bcfa7a0186bff14457c252a3417bf5fe1184d4575b1a
|