genzagents
Python SDK for GenZAgents work receipts — issue, sign, and verify the cryptographic record of work performed by AI agents on behalf of (or for) another party.
Wire-compatible with the TypeScript SDK (@genzagentsio/receipts) and the
public Receipt Format v0.1 spec.
Install
pip install genzagents
For ZK-mode receipt aggregation:
pip install 'genzagents[bls]'
Quick start
import os
from genzagents import (
GenZAgents,
ReceiptBuilder,
countersign_receipt,
generate_keypair,
hash_deliverable,
public_key_to_base64,
verify_receipt_signatures,
)
# 1. Generate or load keypairs (one for buyer, one for seller)
buyer = generate_keypair()
seller = generate_keypair()
# 2. Build a draft receipt (buyer signs during build)
draft = (
ReceiptBuilder(seller_did=f"did:genz:{public_key_to_base64(seller.public_key)}")
.with_buyer(
buyer_id=f"did:genz:{public_key_to_base64(buyer.public_key)}",
buyer_type="agent",
)
.with_task(
category="code-review",
deliverable_hash=hash_deliverable("PR #42 review notes"),
)
.with_settlement(amount="50", currency="GBP", rail="stripe")
.with_privacy("private")
.build(buyer_private_key=buyer.private_key)
)
# 3. Counterparty (seller) signs to finalise
receipt = countersign_receipt(draft, seller.private_key)
# 4. Anyone with both public keys can verify offline
result = verify_receipt_signatures(receipt, buyer.public_key, seller.public_key)
assert result.valid
# 5. Submit through the API client
with GenZAgents(api_key=os.environ["GENZ_API_KEY"]) as client:
saved = client.receipts.submit_draft(draft)
final = client.receipts.countersign(saved["id"], receipt.signatures.seller)
What's in the box
ReceiptBuilder— fluent draft constructioncountersign_receipt— finalise a draft with the seller's signaturegenerate_keypair,sign_ed25519,verify_ed25519_signature— generic Ed25519verify_receipt_signatures— full offline verificationhash_deliverable— UTF-8-NFC SHA-256 hashing matching the TS SDKcanonicalise_json— RFC 8785 JCS implementation (deterministic across SDKs)GenZAgents— REST client (wrapshttps://api.genzagents.io)
Spec compatibility
This SDK implements Receipt Format v0.1 in full:
- All 18 task categories (
code-review,code-write,content-write, …) - All settlement rails (
stripe,x402,skyfire,coinbase,paypal,off-rail) - All on-chain networks (
base,ethereum,optimism,arbitrum,solana) - Privacy modes:
public,private(default),zk
ZK-mode receipts (BLS12-381 aggregation per spec §4.4) are exposed via the
optional [bls] extra and live in genzagents.bls.
Status
Beta. The receipt format is stable at v0.1; the API surface mirrors the TS SDK 1:1. Open an issue if you spot a divergence.
License
Apache-2.0.
Metadata
Release files for genzagents 0.5.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| genzagents-0.5.13.tar.gz | 11.1 kB | Without provenance | Details for genzagents-0.5.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| genzagents-0.5.13-py3-none-any.whl | Python 3 | none | any | Details for genzagents-0.5.13-py3-none-any.whl |
Total release size: 24.3 kB
Release files / genzagents-0.5.13.tar.gz
| Download URL | genzagents-0.5.13.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21d94def05907af17aeaa7925b2ba761315981c1e6f01cbee7846c8e6fbae793
|
|
BLAKE2b-256 checksum How to use checksums |
778e7ed1720d39578c01b6f570576c8a9759796e0e26ce44d92e65c269b49658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / genzagents-0.5.13-py3-none-any.whl
| Download URL | genzagents-0.5.13-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72e3d0d74e628789966c8217afeefaeb190deaf3450b357775bc6cccdb9aa69c
|
|
BLAKE2b-256 checksum How to use checksums |
01d0414bf09536536b66951b4ea7de1b6be6809f7179611a80291a76220de6d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for genzagents 0.5.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.