tascan-verify
v0.2.0
Published
Reference verifier for TaScan Action Receipts (Ed25519 JWS) and signed documents (passkey signature bundles). Zero dependencies, Node 18+, one file you can read end to end. Checks without trusting TaScan's server.
Maintainers
Readme
tascan-verify
Check a TaScan Action Receipt (an Ed25519 JWS) on your own machine, without trusting TaScan's server. Zero dependencies, Node 18+, one file you can read end to end.
This is the reference verifier, byte for byte; the repository's harness fails if this copy ever differs.
Usage
npx tascan-verify receipt.jws
npx tascan-verify receipt.jws --offline --jwks keys.json
npx tascan-verify receipt.jws --json
npx tascan-verify receipt.jws --profile public
npx tascan-verify --fixtures path/to/manifest.json
npx tascan-verify --signature bundle.json --doc signed-document.pdfreceipt.jws— a file holding the compact JWS, a receipt.jsonexport, or the compact JWS string itself.--offline --jwks keys.json— verify against a key set you already hold (no network); without--offlinethe key set is fetched from the issuer's/.well-known/tascan-receipt-keys.json.--json— machine-readable output.--profile full|public— pin the profile you expect (the headertypnames the profile; a mismatch failsbad_typ).--fixtures [manifest.json]— run every fixture and cross-check row in a conformance manifest, offline, and report one PASS/FAIL per row. Pass the manifest path explicitly: the package ships the verifier and schemas, not the fixtures.- Also available:
--photo,--notes,--response(hash your bytes against the signed evidence) and--issuer-check(print the issuer's own verdict beside yours).
Exit code 0 means the receipt checks out; anything else means it does not.
What it checks
Each step prints PASS / FAIL / SKIP / INFO, in this order:
- shape — size limit, compact JWS with three strict base64url segments, no repeated member names, header
typ(full or public profile),algEdDSA, akid. - envelope —
issis an https origin with no default port,subis atascan://subject,jtipresent,seriala non-negative integer. - key — the
kidis in the issuer's JWKS (or your--jwksfile) and not revoked for compromise; rotation revocation is judged againstiat. - signature — Ed25519 over the signing input verifies with that key (the check that matters).
- profile — hashing profile (RFC 8785 JCS): every number is an IEEE-754-safe integer.
- semantics — GPS bounds, real calendar datetimes, coherent verification fields.
- schema — the payload validates against
receipt.schema.jsonorreceipt-public.schema.json. - binding — public profile only: the binding to the full receipt is well formed and not a self-binding.
- redaction — public profile only: no raw ids or evidence URIs leak past their hashes.
- snapshot —
sha256(JCS(chain.snapshot))equals the committed hash for the profile. - coherence — receipt-wide consistency, e.g. at most one evidence entry per field.
- evidence — evidence hashes match any bytes you pass (
--photo/--notes/--response); otherwise SKIP. - sources — every claim has a source from the protocol vocabulary; an absent value carries a reason.
- vocabulary — receipt authenticity, work verification and execution provenance, read out as three separate questions.
- issuer — optional (
--issuer-check): the issuer's own verdict printed beside yours, never a substitute for steps 3–4.
The exact, ordered list is in the header comment of bin/tascan-verify.js.
Signed documents (--signature)
A TaScan signature task has a worker read a document, type their full name, and sign with their passkey (Face ID, fingerprint or PIN). The organization can export the signature bundle for any signed copy. Check it offline:
npx tascan-verify --signature bundle.json --doc signed-document.pdf- shape: the bundle has the signed preimage, clientDataJSON, authenticatorData, signature, public key, rp_id and origin.
- challenge: base64url(SHA-256(JCS(preimage))) equals the challenge the passkey signed, so the document hash, the task, the signer and the typed name are exactly what was signed. Change any of them and this fails.
- client: a
webauthn.getceremony fromhttps://<rp_id>. - authdata: rpIdHash = SHA-256(rp_id); user present and user verified (biometric or PIN) flags set.
- signature: ES256 over authenticatorData || SHA-256(clientDataJSON) verifies with the bundle's P-256 passkey key.
- document: the document hash matches the signed one, and with
--doc, your file's bytes hash to it.
Then it prints the signed facts: typed name, signer, task, time. Exit code 0 means the signature checks out. What it cannot tell you on its own: that the public key belongs to the person you think. Compare it with the signer's enrolled passkey if that matters to you.
