Authentication: SIWE and SIWS
A wallet authenticates to the gateway through Sign-In with Ethereum (SIWE) or Sign-In with Solana (SIWS). The wallet signs a structured message proving it controls a specific address; the gateway verifies the signature and issues a session credential that subsequent requests carry. SIWE binding authenticates the wallet but does not, by itself, grant Z-internal debit privileges. Debit eligibility requires a first qualifying on-chain x402 payment from the wallet. The linking moves the wallet through three states (Unlinked, Pending, Durable), and only the Durable state can debit pre-funded balances. This is intentional: it prevents a freshly signed-in wallet from drawing on credits that were granted to a different principal.Per-request payment: x402
x402 is a protocol for in-band payment over HTTP. A request that requires payment receives a402 Payment Required response carrying the payment requirements. The client constructs a payment proof against the requirements (for x402 this is a signed on-chain authorization) and retries the request with the proof in a header.
The gateway verifies the proof on-chain, debits the proof’s value, and serves the response. The flow is per-request: there is no pre-funded balance to manage at the wallet level (though pre-funding is supported as an optimization).
The practical effect: an agent operating on its own wallet can issue an inference request, receive a 402, construct a USDC payment authorization against the requirement, and retry. The total cost is settled at the moment of the request.
A note on concurrency: concurrent requests from the same wallet are each challenged at the full rate until prior settlement writes complete. The gateway does not optimistically aggregate concurrent in-flight payments; each request must clear settlement independently.
Supported chains and assets
X402 is supported on:- Base. USDC. 2-block soft finality with reorg handling.
- Solana. USDC. Finalized commitment.