Skip to content

v0.12.334

Choose a tag to compare

@VickyXAI VickyXAI released this 02 Dec 07:36
· 13 commits to main since this release

ClawRouter only signs USDC on Base, Arc or Solana, and only polls its gateway

x402 lets the server name the chain, token and payee of every payment, and
ClawRouter signed whatever a 402 named. It now signs only USDC on the three
chains BlockRun settles on. The rule filters the 402's offers before one is
picked, so a 402 that also lists a foreign token still pays in USDC, and one
that offers nothing else is refused with payment_terms_refused before
anything is signed. The Solana batch payer gets the same rule. Operators who
want the payee pinned as well keep using allowedPayees; it is not pinned by
default because BlockRun settles to several treasuries and adds them
server-side.

Async image, video and image-edit jobs signed a fresh payment on every poll of
whatever poll_url the job returned, on any host. A poll URL must now be on
the gateway's own origin; one that is not is refused before any request. The
API-key rail had the same gap with the account's bearer key, and is fixed the
same way.

The same rule covers HTTP redirects: fetch followed a 3xx to any host and
kept the signed payment header. Wallet-rail requests now follow redirects
only on the origin they were sent to (the gateway's own trailing-slash 308
still works); a cross-origin redirect is refused with redirect_refused, and
the request stops there instead of falling back to another paid model. On
Base and Arc the payment must also be an EIP-3009 authorization: a permit2
offer, which can have an unlimited USDC approval signed, is refused.

A payment's validity window is capped at one hour. The signer makes an
authorization valid for as long as the 402's maxTimeoutSeconds asks, so a
402 asking for a month produced a payment that could settle a month later.
BlockRun asks for 300 seconds, 600 for media jobs and 3600 for a Solana batch
escrow, all of which still pay.

A refusal ends the request, including a cost-cap or spend-policy refusal on
the retry after a 429 (which used to move on to the next model, sometimes a
free one that hid the refusal): it is never retried after a 429, and never read
as a payment failure that moves on to a free model (the refusal message
quotes the 402, so its text cannot be trusted for that).

Reported in an outside threat model (source review).

allowedNetworks with Solana no longer blocks every Solana payment

CAIP2_SOLANA_MAINNET was the full genesis hash, but the gateways and
@x402/svm carry the 32-character prefix (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp).
An operator who allowlisted Solana had every Solana payment refused, and
/policy rejected the id that would have matched. The constant is now the
short form, both spellings are accepted, and stored policies are read as the
short form.