Docs

Private x402, in minutes.

Ring402 speaks standard x402 on Solana with a shielded scheme. If you know x402, you know Ring402.

The flow

StepWhat happens
1. AskThe agent calls a paid route and gets a 402 with the price in accepts.
2. SignThe agent signs a one time authorization with its own Ed25519 key.
3. RetryThe agent sends the same request with the X-PAYMENT header.
4. SealRing402 verifies it and settles a private transfer inside a Privacy Ring.
5. ServeThe route returns the data with an X-PAYMENT-RESPONSE header.

Open an agent vault

POST https://ring402.cash/v1/agents
{ "publicKey": "your agent public key" }

You get a deposit address. Fund it with SOL or USDC and it moves into the agent's private balance.

Sign a payment

import { buildPayment, encodeHeader } from './x402.js'

const res = await fetch(url)
const { accepts } = await res.json()
const payment = buildPayment(accepts[0], agentSecretKey)
const paid = await fetch(url, { headers: { 'X-PAYMENT': encodeHeader(payment) } })

Charge for a route

app.get('/signal',
  paywall({ merchantId: 'm_yourid', price: '0.01', asset: 'USDC' }),
  (req, res) => res.json(signal()))

Routes

RouteUse
GET /supportedSchemes and assets Ring402 settles.
POST /verifyCheck a payment against its requirements.
POST /settleVerify and settle a payment privately.
POST /v1/agentsOpen an agent vault.
GET /v1/agents/:keyDeposit address and private balance.
POST /v1/merchantsAdd an API and get a merchant ID and secret.
POST /v1/merchants/:id/withdrawWithdraw earnings to any Solana address.

Payment payload

{
  "x402Version": 1,
  "scheme": "shielded",
  "network": "solana",
  "payload": {
    "authorization": { "from", "to", "asset", "value", "validAfter", "validBefore", "nonce", "resource" },
    "signature": "base58 Ed25519 signature"
  }
}