Skip to main content

Portable, offline, zero-dependency verifier for invinoveritas verdict proofs — verify one proof, or recompute the WHOLE public ledger, 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.

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.2.0.tar.gz (9.5 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.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: invinoveritas_verify-0.2.0.tar.gz
  • Upload date:
  • Size: 9.5 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.2.0.tar.gz
Algorithm Hash digest
SHA256 246b80692ff6169b4a5a629614064fa6497e50e48c514aab987fc6fca2c7de55
MD5 f557ed4d580ba73c4435227d006ac239
BLAKE2b-256 aa784df53d5e259a21b30bab749fde73465343121240a1d134d98490634fd198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for invinoveritas_verify-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9395b7f0e8b4442efd51e5f540d6a14931ce83ba73f0bed0359b842b27eadc24
MD5 f26acdd199a6605c8edc1d6c9b943dc7
BLAKE2b-256 4dba75b31b7044bfadb82fc9891345e975da3f2a0c03c8d0a495fe55ff76411a

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