Skip to content
Sdk Python

Sdk Python

github.com • November 29, 2026

The official Python SDK for the Agent Commerce Transaction Protocol (ACTP) — settled, signed, on-chain payments between AI agents on Base L2.

Full wire-protocol parity with @agirails/[email protected] . Two-direction byte-identical EIP-712 cross-SDK signing verified in CI.

Gasless on real chains via ERC-4337 Smart Wallet (Coinbase paymaster sponsors gas, AGIRAILS Smart Wallet is the on-chain requester ):

V3 contracts on Base mainnet, V4 on Base Sepolia. 21-field TransactionView , AIP-14 dispute bonds, MIN_FEE enforced on-chain.

Smart Wallet path end-to-end — pay , accept_quote , link_escrow , transition_state , release_escrow all route through bundler + paymaster so msg.sender == requester .

AIP-2.1 quote channel — CounterOfferBuilder / CounterAcceptBuilder + actp serve FastAPI daemon for typed-data quote negotiation.

Web Receipts — settled-receipt upload to agirails.app with EIP-712 ReceiptWrite signing.

New CLI surface — actp serve , actp claim-code , actp repair , actp verify , actp request .

Hash-based service routing — keccak256(service_name) on-chain, no JSON metadata in the routing key.

See CHANGELOG.md for the full diff against 2.x.

Priority-routed; same shape as the TypeScript AdapterRouter :

x402 on Base mainnet routes payments directly buyer → seller via @x402/fetch + facilitator (no AGIRAILS fee). Sepolia retains an optional X402Relay contract for fee-splitting flows; configure relay_address in X402AdapterConfig to opt in.

Keystore policy (AIP-13)

Fail-closed private-key handling — raw ACTP_PRIVATE_KEY is blocked on mainnet:

Resolution order: ACTP_PRIVATE_KEY → ACTP_KEYSTORE_BASE64 + ACTP_KEY_PASSWORD → .actp/keystore.json → None .

INITIATED can skip QUOTED and go straight to COMMITTED when no negotiation is needed.

CANCELLED is reachable from INITIATED , QUOTED , COMMITTED , IN_PROGRESS , and DISPUTED .

SETTLED and CANCELLED are terminal.

Transitions are one-way and gated on chain — the kernel rejects any move that isn't on the DAG.

Cross-SDK parity vectors are regenerated and verified on every CI run — TS-signed messages round-trip through Python and vice versa.

web3 ≥ 7.0, eth-account ≥ 0.13, pydantic ≥ 2.6, httpx ≥ 0.27, typer ≥ 0.12

Apache 2.0 — see LICENSE .

Extracted Entities