Hosted endpoint
POST api.algovoi.co.uk/v1/receipt/verify — submit any JWS receipt, get back a structured pass/fail report. Stateless. Rate-limited at 120 req/min.Python (PyPI)
pip install algovoi-receipt-verifier. Exposes verify_compliance_receipt() and ReceiptVerificationError with nine typed error codes.TypeScript (npm)
npm install @algovoi/receipt-verifier. Byte-for-byte parity with the Python sibling proven by 13 shared cross-validation vectors.What the verifier checks
| # | Check | Error if fails |
|---|---|---|
| 1 | JWS format — three-part header.payload.signature base64url | INVALID_JWS_FORMAT |
| 2 | Algorithm whitelist — EdDSA, ES256K, RS256 only; reject without fallback | UNSUPPORTED_ALG |
| 3 | Ed25519 signature — cryptographic verification against the issuer’s public key | TAMPERED_SIGNATURE |
| 4 | canon_version — must be in the supported registry (jcs-rfc8785-v1) | UNSUPPORTED_CANON_VERSION |
| 5 | JCS re-canonicalisation — re-canonicalise payload via RFC 8785; compare byte-for-byte | NON_CANONICAL_PAYLOAD |
| 6 | Required fields — payer_ref, screen_result, screen_timestamp_ms, screen_provider_did, jurisdiction_flags, canon_version | MISSING_FIELD |
| 7 | screen_result enum — must be ALLOW, REFER, or DENY | INVALID_PAYLOAD |
| 8 | payment_hash binding — if expected_payment_hash is supplied, must match exactly | PAYMENT_HASH_MISMATCH |
Hosted endpoint
200 OK):
422 Unprocessable Entity):
jwks to verify a receipt signed by a third-party key rather than AlgoVoi’s platform key.
Programmatic use (Python)
Programmatic use (TypeScript)
Phase 8 ATB threat mapping
Each of the eight invalid cross-validation vectors maps directly to a Phase 8 Agent Trust Bench threat profile:| Vector | ATB threat | Error code |
|---|---|---|
i01_tampered_signature.json | receipt-tampered-sig | TAMPERED_SIGNATURE |
i02_unsupported_alg.json | receipt-alg-unknown | UNSUPPORTED_ALG |
i03_unsupported_canon_version.json | receipt-canon-version-mismatch | UNSUPPORTED_CANON_VERSION |
i04_payment_hash_mismatch.json | receipt-replay-modified | PAYMENT_HASH_MISMATCH |
i05_missing_envelope.json | receipt-missing-envelope | MISSING_ENVELOPE |
i06_non_canonical_payload.json | receipt-bad-jcs | TAMPERED_SIGNATURE or NON_CANONICAL_PAYLOAD |
i07_malformed_jws.json | — | INVALID_JWS_FORMAT |
i08_missing_screen_result.json | — | MISSING_FIELD |
Cross-validation vectors
13 self-contained JSON fixtures (vectors/valid/ and vectors/invalid/) are run by both test suites. Each fixture embeds its own jwks — no external key store required.
| Suite | Unit tests | Vector tests | E2E (from registry) | Total |
|---|---|---|---|---|
| Python | 28 | 13/13 | 13/13 | 41/41 |
| TypeScript | 19 (incl. vectors) | — | 13/13 | 19/19 |
algovoi-receipt-verifier==0.1.0 from PyPI and @algovoi/receipt-verifier@0.1.0 from npm) into a clean environment and run all 13 vectors. Source: e2e/test_registry_python.py and e2e/test_registry_npm.mjs.
Regenerate vectors at any time:
JWKS endpoint
AlgoVoi’s public key is available at:jwks. The kid in the JWS header is used for key selection; falls back to the first key if no kid match.
See also
- Compliance gate — the
POST /compliance/screenendpoint that emits the JWS receipts this verifier checks - JCS canonicalisation substrate — the
build_compliance_receipt()emitter and JCS substrate underlying thecanon_versionpin - Audit verifier — selective-disclosure audit bundle verifier; composes with receipt verification in the compliance audit chain
- Composite trust query — sits above this verifier; aggregates receipt signals into a single
TRUSTED/PROVISIONAL/UNTRUSTEDverdict - Settlement attestation — multi-chain settlement record that pairs with the compliance receipt
- Agent Trust Bench — Phase 8 receipt/substrate-integrity profiles (OWASP LLM09)