Quickstart
Add verifiable interaction records to your API in 5 minutes. Generate portable evidence for access decisions, settlement references, and applied terms.
Prerequisites
- -Node.js 22+
- -TypeScript (recommended)
- -pnpm, npm, or yarn
1. Install
$ pnpm add @peac/protocol @peac/crypto @peac/schemaThese three packages cover issuance and verification. For Express middleware, also add @peac/middleware-express.
2. Implement
import { issueWire02 } from '@peac/protocol'
import { generateKeypair } from '@peac/crypto'
// Generate or load your key pair
const { privateKey } = await generateKeypair()
// Issue an interaction record (Interaction Record Format 0.2)
const { jws } = await issueWire02({
iss: 'https://api.example.com',
kind: 'evidence',
type: 'org.peacprotocol/payment',
pillars: ['commerce'],
extensions: {
'org.peacprotocol/commerce': {
payment_rail: 'x402',
amount_minor: '10000',
currency: 'USD',
},
},
privateKey,
kid: 'peac-2026-03',
})
// Add receipt to response
res.setHeader('PEAC-Receipt', jws)3. Publish Keys
Serve your public key at /.well-known/jwks.json and create an issuer configuration at /.well-known/peac-issuer.json that points to it via jwks_uri:
{
"keys": [{
"kty": "OKP",
"crv": "Ed25519",
"use": "sig",
"kid": "peac-2026-03",
"x": "base64url-encoded-public-key",
"alg": "EdDSA"
}]
}Then create /.well-known/peac-issuer.json:
{
"version": "peac-issuer/0.1",
"issuer": "https://api.example.com",
"jwks_uri": "https://api.example.com/.well-known/jwks.json",
"receipt_versions": ["peac-receipt/0.1", "interaction-record+jwt"],
"algorithms": ["EdDSA"]
}4. Go-Live Checklist
Payment Rails
PEAC supports multiple payment rails with unified receipt verification:
@peac/rails-x402HTTP 402 with v0.2 profile and DoS guards
@peac/rails-stripeStripe with x402 crypto bridge
@peac/rails-razorpayIndia payments: UPI, cards, netbanking
@peac/rails-cardGeneric card billing bridge
Agent Protocols
Integrate with AI agent and commerce protocols:
@peac/mappings-mcpModel Context Protocol tool call mapping
@peac/mappings-a2aAgent-to-Agent evidence carrier
@peac/mappings-acpAgent Communication Protocol mapping
@peac/mappings-ucpUniversal Commerce Protocol mapping
@peac/mappings-tapTrusted Agent Protocol mapping
@peac/mappings-rslRights Specification Language mapping
@peac/mappings-aiprefIETF AI Preferences vocabulary
@peac/mappings-content-signalsContent use policy signal observation