JSPM

@witnessed/verifier

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 188
  • Score
    100M100P100Q9478F
  • License MIT

Offline verifier for Receipts action receipts — checks signatures, the witness countersignature, and evidence chains.

Package Exports

  • @witnessed/verifier

Readme

@witnessed/verifier

Offline verifier for Receipts action receipts. No network or trust in the issuer required — verify signatures and the witness countersignature against a known witness public key.

npm i @witnessed/verifier
import { verifyReceipt, verifyChain } from "@witnessed/verifier";

// trustedWitnessKeys: { [key_id]: publicJwk } — fetch from GET <witness>/public-key
const result = verifyReceipt(receipt, trustedWitnessKeys);
if (result.valid) {
  console.log(result.claim.action, result.anchor_check, result.payment);
}

// Verify an evidence chain (a receipt's `prev` links, e.g. a human-approval over an action):
const chain = verifyChain([actionReceipt, approvalReceipt], trustedWitnessKeys);
console.log(chain.valid, chain.issues);

MIT licensed.