veritas-verify
v0.1.0
Published
VERITAS verification library — verify W3C Verifiable Credentials, proof-of-possession, and ECDSA signatures from the VERITAS identity protocol
Maintainers
Readme
veritas-verify
Core verification library for the VERITAS identity protocol on ICP.
Zero-network credential verification for AI agents. Verify W3C Verifiable Credentials, proof-of-possession challenges, and ECDSA secp256k1 signatures — all locally, sub-ms.
Install
npm install veritas-verifyQuick Start
import { generateKeypair, setIssuerKey, verifyCredential } from 'veritas-verify';
// Configure the issuer key (from the VERITAS canister's DID document)
setIssuerKey('0256180048901b2dd3596ce0037066635d6c8433e620dd9718610ca430847696e3');
// Verify a credential (local, no network calls)
const result = verifyCredential(credentialJson);
console.log(result.valid); // true or falseAPI
Key Management
generateKeypair()— Generate secp256k1 keypairderivePublicKey(privateKeyHex)— Derive public key from privatesign(privateKeyHex, message)— Sign a messageverifySignature(publicKeyHex, message, signatureHex)— Verify ECDSA signature
Proof-of-Possession
generatePoPChallenge(agentPrincipal)— Create a PoP challengerespondToPoPChallenge(privateKeyHex, challenge)— Sign challenge with private keyverifyPoPResponse(challenge, response)— Verify PoP response
Credential Verification
parseCredential(credentialJson)— Parse W3C VC JSON-LDisExpired(credential)— Check if credential expiredisNotYetValid(credential)— Check if credential is future-datedverifyCredential(credentialJson)— Basic verification (structure + expiry + key)verifyCredentialFull(credentialJson, revocationStatus?)— Full verification with on-chain status
Batch Verification
verifyBatch(items)— Verify many credentials in one call (no network)
Canister Interface
checkRevocationStatus(canisterId, credentialId)— Query revocation on-chainfetchDIDDocument(canisterUrl)— Fetch and cache DID document
Configuration
setIssuerKey(hexKey)— Set the issuer's chain-key public keygetIssuerKey()— Get the current issuer key
License
MIT
