Skip to main content

Python port of the Trust Standard Protocol (TSP) v3.0 reference verifier core: canonicalization, trust envelope and manifest validation, Ed25519 local verification.

Project description

⚠️ TSP public alpha preview

This repository contains historical TSP alpha-preview materials. It is not a final TSP release, is not certified for production use, and does not grant any right to claim TSP compatibility, TSP certification, TrustBadge authorization, or participation in the official TSP integrity domain.

TSP v3.1+ is governed by the LexiCo TSP License and official conformance process.

tsp-verify — Python port of the TSP reference verifier core

Verify Trust Standard Protocol v3.0 evidence from Python: canonicalization (RFC 8785-style, byte-identical to the JS reference), trust envelope and trust manifest validation, and Ed25519 local verification with the granular check profile.

Install

python -m pip install tsp-verify
# For the current public alpha pin:
python -m pip install tsp-verify==0.1.0

Requires Python >=3.10 and installs one runtime dependency, cryptography>=42, because Python's standard library has no Ed25519.

import json
from tsp_verify import verify_local

envelope = json.load(open("envelope.json"))
public_key = json.load(open("publickey.json"))

result = verify_local(envelope, public_key)
print(result["valid"])                    # True / False — fail-closed
print(result["checks"]["ledgerHash"])     # granular per-check verdicts

It also verifies commercial licenses (TSP License Artifact v1, ADR-0010) — a sibling artifact validated fully offline through license -> issuer -> pinned license-root, reusing the same crypto substrate:

from tsp_verify import verify_license

result = verify_license(
    bundle,                                   # a tsp.license-bundle.v1
    {"origin": "https://customer.example",    # this deployment's manifest origin
     "trustedRootKeys": [pinned_root],        # {"rootKeyId", "publicKey"} set
     "requiredModules": ["gateway-pro"]},     # default-deny per module
    now="2026-07-01T00:00:00.000Z",
)
print(result["ok"], result["reason"])         # e.g. True "valid", or False "license_expired"

Conformance is the correctness claim

This port is correct because it reproduces the normative verdicts of the tsp-spec fixture suite — including the ADR-0002 tamper-rejection vectors, the ADR-0010 license vectors, and byte-identical canonical forms — not because anyone says so. Prove it on your machine:

python conformance/run_conformance.py
# integrity: 10 fixtures match pinned SHA256SUMS
# ... all 23 conformance vectors pass against the Python port (v3.0 + license)

A failure of that runner is a bug in this port, never grounds to adjust the fixtures (ADR-0008: the spec owns the truth).

One dependency, declared honestly

Python's standard library has no Ed25519, so this port carries exactly one runtime dependency: cryptography. Everything else — canonicalization, hashing, schema and manifest validation — is stdlib. Verification only: this package holds no private keys and signs nothing.

Scope

Local verification (schema, content hash, ledger hash, signatures). The online plane (manifest resolution, key binding, revocation, rollback) is implemented in the JS reference core and specified by tsp-spec's online vectors; a Python online port follows. Local-only caveat: signature.keyRef is carried but not authenticated — key binding is an online-mode property.

Releasing

Publishing is automated through GitHub Actions and PyPI Trusted Publishing. To cut a release:

  1. Keep pyproject.toml and tsp_verify/__init__.py on the same version.
  2. Merge the release workflow changes to main after CI and conformance pass.
  3. Tag the main commit with v0.1.0 and push the tag.

The Release (PyPI) workflow runs unit tests, fixture conformance, python -m build, twine check, verifies that the tag matches pyproject.toml, and publishes to PyPI using the repository's trusted publisher identity. PyPI versions are immutable, so every future release needs a new version number.

Trust is not earned. It is given — to what can be verified.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tsp_verify-0.1.0.tar.gz (25.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tsp_verify-0.1.0-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file tsp_verify-0.1.0.tar.gz.

File metadata

  • Download URL: tsp_verify-0.1.0.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsp_verify-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d94ee04898a57112a6975d07455e2bce6b60ef15a30bde2323cd51a9c9e61578
MD5 42051f67503b2c142b4a90bc50403a56
BLAKE2b-256 94ae22fbc2014558b9f7ffbb0b5bb8a8b917f0f90972a616a1122e58711d383a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsp_verify-0.1.0.tar.gz:

Publisher: release.yml on Lexi-TSP/tsp-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tsp_verify-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tsp_verify-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tsp_verify-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0357922069b827253b28b3397bfd88d2bc70f2d94e9f061c37670b2c45bdb918
MD5 56e0bd2447c0b3190a7a7d4c1f19bdd4
BLAKE2b-256 ff0ccc8312bfdba50c06b5745bb6b16ea473064945b275653f84335c15abea09

See more details on using hashes here.

Provenance

The following attestation bundles were made for tsp_verify-0.1.0-py3-none-any.whl:

Publisher: release.yml on Lexi-TSP/tsp-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page