Skip to main content

vauban-verify

Offline cryptographic verifier for Vauban Command Center proof certificates.

Recomputes every step leaf from its payload preimage, then the Poseidon Merkle root from a certificate's decision_chain, and asserts it matches the certificate's anchored merkle_root ; verifies the Ed25519 signature when the certificate carries one. No network calls. No trust in our infrastructure or keys. Trust derives entirely from your independent on-chain read of the anchored root.

2.0.0: leaves are recomputed from their payload when present; entries without payload are refused unless --allow-unbound-steps or a pinned signature; Merkle tree is position-binding (not compatible with 1.0.0 certificates).

What a passing verification binds, and what it does not :

Data Bound by Verified by this tool when
merkle_root the on-chain anchor you read the root on Starknet and compare (out of band)
the ordered leaf_hash_poseidon list merkle_root always
a chain entry's fields (type, agent, amounts, timestamps…) its leaf, only through the payload preimage ; or the signature pinned to the issuer's full key the entry carries payload ; otherwise the entry is unbound to the root and refused unless the signature is pinned (--pubkey-spki-b64 / --pubkey-sha256) or --allow-unbound-steps is passed
run_id and every top-level field the Ed25519 signature only the certificate is signed ; pin the issuer's FULL key with --pubkey-spki-b64 / --pubkey-sha256, otherwise the key is self-asserted (NOT pinned). --expected-kid (16 hex = 64 bits) only selects a key : a colliding key costs ~2^64 trials, so a kid never pins. Naming a key for an unsigned certificate is a refusal.

Certificates emitted by the Command Center (GET /proof/:runId) carry no payload (the preimage is the run_step.payload column, not exported) and, on the public route, no signature : for them this tool verifies the leaf hashes against the root and nothing else ; --allow-unbound-steps makes that explicit on stdout (bound=0/N) and stderr (WARNING).

Pure Python; the only runtime dependency is poseidon-py for felt252 Poseidon arithmetic, exact-pinned to 0.1.5 (zero transitive dependencies) with a hash-locked requirements.lock, so the verifier is reproducible: an independent rebuild resolves the same trust-critical code (threat R-d.3). starknet-py is NOT a dependency of this verifier; if you want to read the anchored root on-chain yourself, use any Starknet client out of band.

This verifier matches the issuer's reference implementation. Cross-language parity is enforced by deterministic test vectors shipped in tests/ — any drift between the reference and Python fails the build.

Install

pip install vauban-verify

Reproducible install (recommended for verification ; threat R-d.3). Install the trust-critical dependency from the hash-locked file so an independent party gets the exact same bytes:

pip download --no-deps --no-binary :all: vauban-verify==2.0.0   # the sdist, which ships requirements.lock
tar xzf vauban_verify-2.0.0.tar.gz && cd vauban_verify-2.0.0
pip install --require-hashes -r requirements.lock   # poseidon-py==0.1.5, hash-pinned
pip install --no-deps .                             # the verifier itself

Or from source for development:

pip install -e ".[test]"

Requires Python ≥ 3.10.

CLI usage

vauban-verify path/to/cert.json
# → vauban-verify: OK — run_id=<…> leaves=<N> bound=<N>/<N> root=0x… signature=none (run_id and entry fields are NOT bound)
echo $?  # 0 = valid, 1 = tampered/invalid/unbound, 2 = usage error

# Command Center shape (no `payload` in the entries) : verify the leaves alone, say so
vauban-verify path/to/cert.json --allow-unbound-steps
# stderr → vauban-verify: WARNING — N step(s) without `payload` (indices […]): only their leaf hashes are bound to the root ; …
# stdout → vauban-verify: OK — run_id=<…> leaves=<N> bound=0/<N> root=0x… signature=…

# Signed certificate, issuer key pinned out of band (full key : no --allow-unbound-steps needed)
vauban-verify path/to/signed-cert.json --pubkey-sha256 <64 hex of SHA-256(SPKI DER)>
# → … signature=Ed25519 kid=<16 hex> (pinned)
# --expected-kid <16 hex> only selects the key ; it refuses an unsigned certificate but never pins

Library usage

from vauban_verify import (
    compute_step_leaf_hash,
    compute_poseidon_merkle_root,
    verify_poseidon_merkle_proof,
    load_certificate,
    verify_offline,
)

# Recompute a leaf from a run_step payload
leaf = compute_step_leaf_hash({"step_id": "s1", "type": "decision", "agent": "BUILDER"})

# Recompute a Merkle root from a list of leaves
root = compute_poseidon_merkle_root([leaf, ...])

# Verify a sibling-path inclusion proof
ok = verify_poseidon_merkle_proof(leaf, proof, root)

# Verify a full certificate offline
cert = load_certificate("cert.json")
verify_offline(cert)  # True, or raises VerifierError (forged leaf, unbound entry, bad signature…)

# Same, with the report of what is bound
from vauban_verify import verify_certificate
report = verify_certificate(cert, expected_pubkey_sha256="…")  # full key pinned ; expected_kid only selects
report.bound_steps, report.unbound_steps, report.signature.pinned, report.run_id_bound

Security model

Threat Defended by
Compromised Vauban infrastructure This verifier runs offline; never contacts our servers
Compromised Vauban signing keys The verifier asserts only Merkle consistency; trust the chain anchor, not us
Hash-function preimage attacks Poseidon over felt252 — STARK-friendly, post-quantum sound
Drift between TS reference and verifier 30 cross-language vectors gated in CI (regen + diff)
Rewritten entry fields, leaves and root kept Each leaf is recomputed from its payload preimage and compared ; entries without preimage are refused by default (--allow-unbound-steps opts in and the output then says the fields are unverified ; a signature pinned to the issuer's FULL key also vouches for them ; a 64-bit kid does not)
Rewritten run_id / top-level fields Only the Ed25519 signature binds them ; verified when present, with optional full-key pinning ; a certificate stripped of its signature is refused as soon as the caller names a key
Second-preimage on the 64-bit kid A kid selects a key, never pins it ; only the full SPKI DER or its full SHA-256 pins

The only thing that should be trusted is the on-chain merkle_root. Read it yourself from Starknet (e.g. via starknet-py's read_contract) and compare to cert.merkle_root — this verifier proves which parts of the certificate are bound to that root, and refuses to call "OK" what is not.

Algorithm reference

  • JCS canonicalisation (RFC 8785 subset): keys sorted recursively, -0 → 0, arrays preserve order, JSON.stringify-equivalent emission.
  • Step leaf: Poseidon([0x1, sha256_to_31_felt(JCS(payload)), step_marker]), step_marker = UTF-8 run_step as felt. Recomputed by the verifier from a chain entry's payload when present.
  • Merkle (position-binding, matches the on-chain verify_inclusion; not the sorted scheme of 1.0.0): leaves kept in decision_chain order (NOT sorted), padded at the end with Poseidon([0, 0]) to the next power of 2, each parent Poseidon([left, right]) in positional order.
  • Certificate hash (signed form): Poseidon([0x1, sha256_to_31_felt(JCS(cert without "signature")), cert_marker]), cert_marker = UTF-8 run_cert as felt ; Ed25519 (RFC 8032, pure) over its 32 big-endian bytes ; kid = first 16 hex of SHA-256(SPKI DER).

Hex output matches starknet.js: lowercase, 0x-prefixed, no leading-zero padding (e.g. POSEIDON_NULL_LEAF = 0x1fb7169b936dd880cb7ebc50e932a495a60e0084cdab94a681040cb4006e1a0).

Publishing

Releases are published to PyPI via Trusted Publishers (sigstore-signed) using the .github/workflows/vauban-verify-publish.yml workflow. Tag a release with vauban-verify-vX.Y.Z to trigger publication.

License

MIT.

Metadata

Release files for vauban-verify 2.0.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 vauban-verify 2.0.0
File Size Uploaded Provenance Actions
vauban_verify-2.0.0.tar.gz 51.4 kB With provenance Details for vauban_verify-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vauban-verify 2.0.0
File Interpreter ABI Platform Actions
vauban_verify-2.0.0-py3-none-any.whl Python 3 none any Details for vauban_verify-2.0.0-py3-none-any.whl

Total release size: 89.8 kB

Release files / vauban_verify-2.0.0.tar.gz

Download URL vauban_verify-2.0.0.tar.gz
Size 51.4 kB
Tags Source
SHA-256 checksum
How to use checksums
95d0142fb53b9ee15af23635974a0484857c1f69ff21652a06be10e31c95358f
BLAKE2b-256 checksum
How to use checksums
2f5ffc7d580988de567df60dd68ac0af9fac61cb799109f48c98968b357151e5
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 7, 2026.

Transparency log

Release files / vauban_verify-2.0.0-py3-none-any.whl

Download URL vauban_verify-2.0.0-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
136e11f89cd6d2ab41ee9f21c53fb11bb61d2e7fdbaaaa24b186e180ff76572d
BLAKE2b-256 checksum
How to use checksums
c02c899bc9342c0714513e7ec9a0c605b721867c92fccb4ab4da6bac46a4d4e0
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 7, 2026.

Transparency log

Security for vauban-verify 2.0.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 vauban_verify-2.0.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 7, 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.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files Full provenance

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