Skip to main content

Portable, offline, zero-dependency verifier for invinoveritas verdict proofs — verify one proof, recompute the WHOLE public ledger, or assemble a recomputable compliance bundle, without trusting the API or us.

Project description

invinoveritas-verify (Python)

Verify an invinoveritas verdict proof OFFLINE — trusting no one, not even our API, and not us. An invinoveritas proof is a schnorr-signed Nostr event; this recomputes its event id (NIP-01), checks the BIP-340 signature against our published key, and confirms it's a real verdict — all on your machine. A valid result is something you proved, not something we told you.

Zero dependencies — pure stdlib (hashlib). A verifier that shipped a sketchy crypto dependency would be self-defeating; there is nothing here to trust but ~120 readable lines, and the only input that matters is a public key.

pip install invinoveritas-verify
from invinoveritas_verify import verify_proof

# `event` is the signed proof from a /review {sign:true} or /prove response.
result = verify_proof(event)
if result["valid"]:
    print("invinoveritas issued exactly this verdict —", result["checks"])
    # {'id_integrity': True, 'signature_valid': True, 'issued_by_invinoveritas': True, 'is_proof_event': True}

CLI:

curl -s https://api.babyblueviper.com/.well-known/agent-handshake \
  | python -c "import sys,json; json.dump(json.load(sys.stdin)['try_it_now']['sample_proof']['event'], open('proof.json','w'))"
python -m invinoveritas_verify proof.json     # → {"valid": true, ...}, computed entirely on your machine

Recompute the WHOLE ledger (not just one proof)

One command pulls our public verdict ledger and recomputes every entry — fetching each raw signed verdict straight from public Nostr relays (not from us), recomputing the NIP-01 event id from those bytes, and checking the BIP-340 signature against our published key:

invinoveritas-recompute-ledger            # or: python recompute_ledger.py
RECOMPUTED: 23/32 verdicts schnorr-verified from relay bytes against 6786…fbb7.
  · 9 raw events rotated off relays (NIP-33); 9 carry a CONFIRMED Bitcoin-PoW anchor — ots verify.
You trusted no one: the bytes came from public relays, the math ran here.

Still zero dependencies — the relay fetch is a minimal stdlib WebSocket client. Verdict events are NIP-33 parameterized-replaceable, so an older verdict's raw event may have rotated off relays; those can't be schnorr-recomputed anymore, but each one also carries a Bitcoin-PoW OpenTimestamps anchor on its event id, recomputable relay-independently: ots verify -d <event_id> <event_id>.ots.

v0.4.0 — hash-chain check. Signature verification alone proves each entry existed and wasn't tampered; it doesn't prove there's only one history (a server could show different entries to different requesters). Entries from #40 onward hash-link to the previous entry (head_hash = sha256(content_hash + "|" + prev_head_hash)), so this tool now also fetches each chained entry's full record, independently recomputes content_hash and head_hash from those bytes, and checks prev_head_hash against the actual predecessor's recomputed head — not the server's claim. A tampered record or a spliced-in alternate history breaks the chain visibly. Entries #1-39 predate this and are unaffected (still signature-only, as before).

Compliance bundle — oversight evidence a regulator can recompute

Running an agent you're on the hook for? Every /review {"sign": true} returns a signed verdict proof — keep them. This packages the ones that gated your agent's actions into a single, self-verifying compliance bundle an auditor or counterparty re-checks without trusting your logs OR our attestation:

# assemble (runs on YOUR proofs, on YOUR machine — we never store your action history)
invinoveritas-compliance-export ./my_proofs --subject "AcmeBot prod" --out bundle.json

# an auditor verifies it — re-checks every signature + that no displayed field was altered
invinoveritas-compliance-export --verify bundle.json
# → PASS — every verdict is an authentic invinoveritas judgment, bundle untampered.

Two independent tamper checks: each entry's BIP-340 signature is re-verified against our published key (the cryptographic truth), and every displayed field is cross-checked against the signed content, so the bundle can't misrepresent what we actually issued. Still zero dependencies. Self-custody by design — "trust no one" includes not trusting us with a database of what your agent did.

Verify our key yourself

The package pins PUBLISHED_PUBKEY. Re-derive it any time and confirm it matches:

curl -s https://api.babyblueviper.com/.well-known/agent-handshake | grep -o '"verifier_pubkey":"[a-f0-9]*"'

If a proof's pubkey ≠ that key, it is not an invinoveritas verdict.

Trust model

  • valid ⇒ invinoveritas issued exactly this verdict (id integrity + schnorr + our key + proof shape).
  • It does not assert freshness or that the proof was meant for your interaction — bind it to your input and check recency yourself.
  • Verdicts are byte-identical to POST https://api.babyblueviper.com/verify-proof. The endpoint is a convenience; this is the same check without the round trip — "recomputable, not a score."

Related

  • invinoveritas (PyPI) — the full Python SDK, incl. the online verify-before-pay client (preflight_verify, verify_proof) and now verify_proof_local (the same offline check).
  • invinoveritas-verify (npm) — the JavaScript/TypeScript twin.

Public track record: https://api.babyblueviper.com/ledger

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

invinoveritas_verify-0.4.0.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

invinoveritas_verify-0.4.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file invinoveritas_verify-0.4.0.tar.gz.

File metadata

  • Download URL: invinoveritas_verify-0.4.0.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for invinoveritas_verify-0.4.0.tar.gz
Algorithm Hash digest
SHA256 e15e3eaac4adec1ca822c06dbe9eb5a4eda3c7ac79100978b17df8593eef43bb
MD5 4ac1a2ce6fdff5c3f39582503e71276b
BLAKE2b-256 d2cad1d095ec994ef611ed7801e4d34c504028be98bf259dd7bde2265637e166

See more details on using hashes here.

File details

Details for the file invinoveritas_verify-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for invinoveritas_verify-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8335bc07d5e4d8ea7edb1a4f9ab5dd4751cbd647ac57f61892c2fb8dc031dc4
MD5 a7ef2f9bc4263156c66fd1898e42f68f
BLAKE2b-256 501fc127d0c7700da741ac8ffe5701772fa77bee3f9692b1023f491005e82988

See more details on using hashes here.

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