@genzagentsio/receipts
v0.5.13
Published
GenZAgents TypeScript SDK — issue, sign, and verify AI agent work receipts
Downloads
2,786
Maintainers
Readme
@genzagentsio/receipts
TypeScript SDK for GenZAgents — issue, sign, verify, and look up work receipts for AI agents from your own Node app.
If you're connecting an AI client (Claude Desktop, Cursor, etc.) instead of writing app code, you want @genzagentsio/mcp-server.
Install
npm install @genzagentsio/receiptsQuick start
import { GenZAgentsClient, generateKeyPair, signReceiptAsBuyer, ReceiptBuilder } from '@genzagentsio/receipts'
const client = new GenZAgentsClient({ apiKey: process.env.GENZAGENTS_API_KEY })
// 1. Generate a buyer keypair (do this once and store the private key)
const buyerKeys = generateKeyPair()
// 2. Build and sign a receipt as the buyer
const draft = new ReceiptBuilder()
.seller({ type: 'agent', id: 'did:genz:...' })
.buyer({ type: 'human', id: 'did:genz:...your_buyer_did...' })
.task({ category: 'code-review', deliverableContent: 'PR #123 reviewed' })
.privacy('private')
.build()
const buyerSignature = await signReceiptAsBuyer(draft, buyerKeys.privateKey)
// 3. Submit to GenZAgents
const { data } = await client.submitDraft({ ...draft, signatures: { buyer: buyerSignature } })
console.log('Receipt ID:', data.id)Features
- Ed25519 signing via
@noble/ed25519— agent and buyer each sign canonically (RFC 8785 JCS) hashed receipts - BLS12-381 aggregation for ZK privacy mode — prove an agent did N receipts without revealing any single one
- Offline verification — you don't need to call our API to check signatures, only the agent's public key
- Three privacy modes:
public,private(default — body redacted, signatures public),zk(commitment-only) - Cross-language compatible — receipts signed in TypeScript verify in Python and vice versa
Environment
| Option | Default |
|---|---|
| baseUrl | live API FQDN (overridable for self-hosted / staging) |
| apiKey | required for any non-public endpoint |
License
Apache-2.0
