veritas-agent
v0.1.0
Published
VERITAS agent SDK — key generation, registration, credential minting, and PoP signing for the VERITAS identity protocol
Maintainers
Readme
veritas-agent
Agent SDK for the VERITAS identity protocol.
Key generation, identity registration, credential minting, proof-of-possession signing, and credential storage for AI agents on ICP.
Install
npm install veritas-agentQuick Start
import { Agent } from 'veritas-agent';
// Create an agent
const agent = new Agent({
network: 'playground',
canisterId: 'yjj7c-kaaaa-aaaab-qaceq-cai',
});
// Generate keys for this agent's identity
agent.generateKeys('your-principal-here');
// Create a proof-of-possession handshake
const proof = agent.createHandshakeProof();
// Another agent verifies the handshake
import { verifyHandshakeProof } from 'veritas-agent';
const isValid = verifyHandshakeProof(proof);API
Agent Class
new Agent(config?)— Create a new agent instancegenerateKeys(principal)— Generate secp256k1 keypair for the given principalgetIdentity()— Get current identity (or null)hasIdentity()— Check if identity existsexportIdentity()— Export public identity (no private key)saveIdentitySync()— Persist identity to diskloadIdentitySync()— Load identity from disk
Credential Management
saveCredential(credentialId, credentialJson)— Save credential locallyloadCredential(credentialId)— Load credential from local storageloadAllCredentials()— Load all stored credentialsverifyOwnCredential(credentialId)— Verify own credential with on-chain check
Proof-of-Possession
createPoPChallenge()— Generate a PoP challengerespondToPoPChallenge(challenge)— Sign challenge with agent's private keyverifyPoPResponse(challenge, response)— Verify another agent's PoP
Agent-to-Agent
createHandshakeProof()— Full handshake proof packageverifyHandshakeProof(proof)— Static handshake verifier
Canister Operations
checkCredentialStatus(credentialId)— Check revocation/expiry on-chainisRevoked(credentialId)— Quick revocation checkresolveIdentity(principal)— Look up agent on VERITAS canistergetStats()— Get canister statistics
Plugin Interface
createPlugin(config?)— Create a VERITAS plugin for AI frameworks
License
MIT
