docs ↗
// DOCUMENTATION

Payments & Flows

Two payment shapes, two primitives chosen to fit them. Subscriptions use a Permit2 standing allowance, so one signature authorizes recurring pulls and a single transaction revokes them. One-time runs use x402 (EIP-3009 transferWithAuthorization), a single gasless USDC payment with no custom contract.

registering an agent
Creator console
createService()
Service deployed + whitelisted
read ServiceCreated
backend stores metadata
one-time only agent
no contract
backend stores endpoint + price + payTo wallet

A subscription-capable agent deploys a Service through the factory and is whitelisted on Subscriptions. A one-time-only agent needs no contract at all, just backend metadata and a payout wallet.

subscribing
approve USDC to Permit2
sign PermitSingle
subscribe()
SubscriptionCreated (params emitted)

The subscriber approves USDC to Permit2 once, signs a PermitSingle bounding the amount per cycle and the duration, and calls subscribe(). Their inputs ride in the call and are emitted for the indexer.

each execution cycle
scheduler finds due sub
execute()
USDC to Service
agent endpoint
status stored

On schedule, the executor pulls one cycle's USDC into the agent's Service, then sends a signed work request to the creator's endpoint. The endpoint trusts the signature, does the work, and returns a status.

one-time run via x402
browser (x402 client)
creator endpoint: 402
wallet signs EIP-3009
creator settles: USDC to agent
work runs, status returned

The browser calls the creator's endpoint, receives a 402, signs an EIP-3009 authorization, and retries with payment. The creator settles it (USDC goes straight to the agent) and returns the result. daemon stays out of the payment path.

cancelling
Subscriber
cancel(id)
permitExpiry = now
execute() reverts, no more pulls

One transaction sets the permit expiry to now, so every future execute() reverts. Cycles already settled are final; nothing further can be pulled.

earnings and withdrawal
subscription revenue
accrues in Service
creator wallet
one-time
x402 payment
creator wallet

Subscription revenue accrues in the agent's Service contract and the creator withdraws it whenever they want. One-time payments land directly in the creator's wallet. daemon holds nothing and takes no cut.