HTTP 402 · State Channels · MIT

State Channel Protocol

x402s lets anyone pay anyone with signed state updates instead of onchain transactions. It’s a universal, gas-free payment layer for APIs, agents, microservices and users of all kinds. Zero gas per request, sub-second settlement, one channel to reach every payee. Built on the x402 open standard.

Quick Start Open scp-pay
0
Gas per request
0s
Payment latency
0 chains
Same contract
ERC-20
Any asset
Three ways in
01

Browser Wallet

No install. scp-pay generates a wallet, discovers 402 offers, opens channels, and pays — all in one page. Claim a handle like you@pogchamp.tv for free.

Open scp-pay
02

CLI & Agent

Run scp:wizard to configure keys and hub. Open channels, check status, pay APIs, and view receipts — all from the terminal or via autonomous agents.

Quick start
03

LLM Skill

Drop the x402s/skill/ folder into Claude or any agent framework. The agent auto-discovers offers, opens channels, and pays — no code changes needed.

Learn more
Agent payments
without the friction

On-chain per-request payments are impractical at scale — gas costs, confirmation latency, and throughput limits make them unviable for API micropayments. State channels fix this.

On-chain per call

  • Gas fee every request
  • Block confirmation latency
  • Chain congestion risk
  • Public spending graph
  • One tx per payee per payment

x402s State Channels

  • Zero gas per request
  • Instant signed-state payment
  • Private off-chain flow
  • One channel → many payees
  • On-chain only at open / close
  • Dispute-protected settlement

x402s is compatible with the broader x402 open standard for internet-native payments, extending it with an off-chain state channel layer for throughput and cost efficiency.

— X402S Specification v2.0.0
Hub-routed payment flow

Agent opens one channel with a hub. The hub routes payments to any connected payee. Four messages to go from 402 to 200.

Agent (A) Hub (H) Payee (B) discover GET /resource 402 + offers[] quote POST /v1/tickets/quote { fee, totalDebit, draft } issue POST /v1/tickets/issue + sigA { ticket, ack } pay GET /resource + PAYMENT-SIGNATURE 200 + data + receipt

Discover

Agent GETs a resource. Payee returns 402 with payment offers: network, asset, amount, route mode.

Quote

Agent sends the chosen offer to the hub. Hub calculates fee, returns a draft with totalDebit ready to sign.

Issue

Agent signs the next channel state via EIP-712. Hub validates nonce monotonicity, balance invariant, and fee bounds. Returns a ticket.

Pay + Verify

Agent retries with PAYMENT-SIGNATURE header. Payee verifies ticket, returns 200 with receipt.

One contract,
every chain

Deterministic CREATE2 deployment. Same address, same interface, every supported EVM chain.

Ξ

Ethereum

Chain 1
ETH USDC USDT

Base

Chain 8453
ETH USDC USDT
Ξ

Sepolia

Chain 11155111 · testnet
ETH USDC

Base Sepolia

Chain 84532 · testnet
USDC
Contract (all chains) 0x07ECA6701062Db12eDD04bEa391eD226C95aaD4b CREATE2 deterministic · click to copy
@pogchamp.tv
resolves to
GET /handle/pr0 → 402
payee: 0x89cd...E3B7
intent: pay_handle

Human-readable
payment addresses

Type a handle in scp-pay instead of a raw URL. The hub resolves it to a payee address and normal payment flow begins.

Registration is free. Claim yours, share it, get paid — no wallet address sharing needed.

  • Type name@pogchamp.tv in scp-pay to pay someone
  • Free handle registration through the hub
  • Resolves via GET /handle/:name → standard 402 flow
  • Works across all supported networks and assets
Built for agents
01

Off-chain speed

Payments are signed state updates. No blocks to wait for. Pay and respond in one round-trip.

02

On-chain safety

Dispute contract enforces settlement. Challenge watcher catches stale closes. Funds always recoverable via finalizeClose().

03

HTTP-native

APIs return 402 with offers. Agents retry with PAYMENT-SIGNATURE header. Standard HTTP, no custom transport.

04

Hub routing

One channel to a hub unlocks every connected payee. Pay many APIs from a single funded channel.

05

Multi-asset

USDC, ETH, USDT, or any ERC-20. Per-path pricing. Payees set offers, agents pick what they hold.

06

Direct mode

Skip the hub entirely. statechannel-direct-v1 opens a channel directly with the payee. No intermediary needed.

07

Agent skill

Ships a ready-made skill folder. Drop into Claude or any LLM agent for automatic 402 discovery, channel management, and payment.

08

Credit system

Hub credit lets agents pay instantly without opening a channel first. Query balance with /v1/credit/balance.

09

Webhooks

Async settlement notifications. Payees receive POST callbacks when payments are issued, verified, or disputed.

10

EIP-712 signatures

Channel state signed with typed structured data. Domain-separated, chain-scoped, replay-protected by design.

11

Hub rebalance

Hubs move earned funds between channels without closing. One rebalance() call, no disruption.

12

Free & open

MIT licensed. Zero platform fees. Run your own hub or use a public one. Fork it, extend it, ship it.

Bounded risk by design

Every participant's risk is explicitly bounded. The on-chain contract serves as the arbiter of last resort.

Agent

Capped exposure

Agent never authorizes more than totalDebit per payment. Spend caps, nonce monotonicity, and explicit fee ceilings protect the payer.

Payee

Hub-backed tickets

Payee trusts hub-signed tickets bounded by signature validity, ticket expiry, and hub credit policy. Direct mode gives on-chain dispute rights.

Hub

State-proven claims

Hub is protected by valid, signed channel state updates proving the agent's debit authorization. Challenge watcher auto-disputes stale closes.

Five minutes to
first payment

Install, configure, open a channel, and pay. The wizard handles key generation and hub configuration.

Or skip the CLI entirely — open scp-pay in your browser for a zero-install wallet.

terminal
# setup npm install npm run scp:wizard # open a channel (Sepolia testnet) npm run scp:channel:open -- \ 0xHubAddr sepolia eth 0.01 # check channel + hub health npm run scp:channel:status # pay an API npm run scp:agent:pay -- \ https://api.example/v1/data # view payment history npm run scp:channel:receipts

Protect an
endpoint

Return HTTP 402 with offers when unpaid, verify the payment signature, serve data with a receipt. Three code paths, no SDK required.

payee-api.js
const sig = req.headers["payment-signature"]; if (!sig) { return res.status(402).json({ error: "payment required", accepts: [{ scheme: "statechannel-hub-v1", network: "eip155:8453", asset: "0x833589...", maxAmountRequired: "1000000", payTo: "pay.eth" }] }); } const result = await verify(sig, store); if (!result.ok) return res.status(402).json({ error: result.error }); return res.json({ ok: true, data, receipt: { paymentId: result.paymentId } });
Pay from your browser

No CLI, no extension, no seed phrase backup. Create a wallet, fund it on testnet, and make your first state-channel payment — all right here.

01

Create wallet

A fresh keypair is generated in your browser and stored in localStorage. No extensions needed.

02

Fund on testnet

Grab Sepolia ETH from a faucet. Open a channel to the hub with a single on-chain deposit.

03

Discover offers

Hit any 402-protected URL. The wallet parses payment options and picks the best route automatically.

04

Sign & pay

EIP-712 state update signed in-browser. The hub issues a ticket — zero gas, instant settlement.

05

Get data

Retry with the payment ticket attached. The API verifies and serves the response. Done.

Sepolia testnet No gas per call EIP-712 signed localStorage wallet
statechannel.org/scppay
Embed in your app
<iframe src="https://statechannel.org/scppay/?autopay=1&url=YOUR_API" allow="clipboard-write"></iframe>

Use postMessage for auto-pay integration. The iframe handles wallet creation, channel funding, and payment — your app just listens for x402:payment:success.

micropayments

Meow Garden

Plant a tree for 100000000000 wei. One link. One payment. One tree.

Launch Demo →
pay per request

Chat

State-channel payments for APIs. Pay per request, not per block. Perfect for metered APIs.

Chat →
payments

Pay

A browser-native SCP client. Send instant peer-to-peer payments to address handles without gas fees or awaiting block confirmations.

Open Pay →
Run what you need

Most users only need the agent. Build paid APIs or run hub infrastructure when ready.

Most users

Agent (Payer)

Discover offers, open channels, pay APIs. Auto-mode handles everything — or use the CLI for manual control.

npm run scp:agent:pay -- <url>
API devs

Payee API

Protect routes with 402, define per-path pricing via offers.json, validate tickets with built-in verification.

npm run scp:payee
Infra ops

Hub Operator

Quote fees, issue tickets, track settlements, run challenge watchers. Scale with PM2 for production.

npm run scp:hub

Build paid APIs
and agents.

MIT licensed. Deploy on Sepolia to test, Base or Mainnet for production. One contract, any EVM chain.

View on GitHub Try scp-pay
$ npm run scp:wizard