VEIL
facilitator veil.devnet spec x402

The 402 body

An agent that has never seen Veil still understands this response, because it is a standard x402 Payment Required body with one added requirement: settle confidentially, or do not settle at all. Every body on this page was captured from a running Veil server — the same process that produced the merchant ledger — and its /.well-known/veil published privacySource: pool-ledger.

One unpaid call, one paid call

agent → feedmarket.veil · GET /v1/market/price HTTP · devnet
1 · unpaid
GET /v1/oracle/tide
  X-PAYMENT: (none)

← 402 Payment Required
  accepts[0].scheme "exact-confidential"
  accepts[0].asset  6pFk…3ur
  accepts[0].payTo  Eidqo…RUKr (one-time)
  accepts[0].maxAmountRequired 49000
   accepts[0].extra.privacy confidential-balances
  accepts[0].extra.poolIndex 7
2 · paid
GET /v1/oracle/tide
  X-PAYMENT: signed · confidential

← 200 OK · resource delivered
  paid true
  settled.at 23:41:15
  settled.signature null
  amount [ciphertext on chain]
  mode local-ledger-only
the price is public to the payer accepts[0].scheme the on-chain amount is not

Note what is not hidden here, on purpose: the price. An x402 challenge has to state what it costs, and Veil does not pretend otherwise. What stays unreadable is the on-chain amount and the balance either side of it — so the chain records that a confidential transfer happened without recording the figure, while the payer's own HTTP exchange is a private conversation with the server.

The body, verbatim

HTTP/1.1 402 Payment Requiredcontent-type: application/json
{
  "x402Version": 2,
  "resource": {
    "url": "https://veil-devnet.vercel.app/v1/oracle/tide",
    "description": "Sea-state and tidal window, per call (0.049000 units)",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact-confidential",
      "network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      "asset": "6pFkZndusKGifrKLXgaQJFjUT3Gi9n1uXcwkG7Jef3ur",
      "payTo": "EidqotpL1dEap2ykWc7uKxXKJpvKRYpwyzhv6gWkRUKr",
      "maxAmountRequired": "49000",
      "amount": "49000",
      "resource": "https://veil-devnet.vercel.app/v1/oracle/tide",
      "description": "Sea-state and tidal window, per call (0.049000 units)",
      "maxTimeoutSeconds": 60,
      "extra": {
        "tokenProgram": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
        "decimals": 6,
        "privacy": "confidential-balances",
        "poolIndex": 7,
        "auditor": null,
        "hides": [
          "on-chain-amount",
          "on-chain-balance"
        ]
      }
    }
  ]
}

The accepts[] entry is a conformant x402 offer. Everything under extra is Veil's addition, and it is published in both directions: hides and exposes name what stays private and what does not, so a client cannot read the privacy claim and miss the boundary. A client that ignores scheme is refused rather than served in the clear.

Every refusal is a specific code

A facilitator that fails opaquely is a support burden and a privacy hole: the agent retries, and a looser code path settles in public. Each failure mode below has one code, one cause and one thing the agent should do.

Veil's confidential-precondition refusals, read from a running server's /.well-known/veil. None of them degrade to a public settlement, and none of them are recoverable by retrying the same request unchanged.
Code HTTP Cause The agent should
VEIL-CONF-001 — Mint is not confidential Do not pay. Fix the configuration, then retry.
VEIL-CONF-002 — Destination cannot receive confidential credits Do not pay. Fix the configuration, then retry.
VEIL-CONF-003 402 Confidentiality cannot be guaranteed — refusing to serve Do not pay. Fix the configuration, then retry. observed: no precondition probe configured
VEIL-CONF-004 402 Buyer spend cap exceeded Backoff, or refill the pool. Never fall back to a plain transfer. observed: spend cap exceeded while quoting
VEIL-CONF-005 503 One-time address pool exhausted Backoff, or refill the pool. Never fall back to a plain transfer. observed: pool exhausted while quoting
VEIL-CONF-006 — Could not reserve a one-time address Do not pay. Fix the configuration, then retry.
VEIL-CONF-007 — Payment is bound to a different resource Do not pay. Fix the configuration, then retry.
VEIL-CONF-008 — Transaction is not a confidential transfer Do not pay. Fix the configuration, then retry.

The proofs are generated in this browser

"Private" means nothing if a server does the proving, because then the server learns every amount. So this is not a claim on a slide: press the button and this page builds the three zero-knowledge proofs a confidential transfer needs, from the payer's own keys, on this device. It also counts the network requests made while it works, so you do not have to take "no prover service" on trust.

prover · this devicenot started
Press “Generate a transfer proof”. Nothing is sent anywhere; the log below is the real output.
The same prover runs on the server for CLI payers and in the wallet for browser payers — one implementation, compiled twice.

The bundle this loads is compiled from the same proofs.ts the test suite exercises; it is not a browser-only reimplementation. npm run prove:browser asserts the shipped artifact in CI, including the statements it must refuse.

The signal a merchant actually ships

Everything above is produced by a facilitator the merchant points at. From the merchant's side the change is one value in the settlement config; the response body does the rest. The refusal below is real output from a running server — the same code the merchant dashboard renders as a row with no amount beside it.

before · plain x402settles in the open
settlement = x402.facilitator(
  payTo: "8gz…e2",
  asset: "USDC" )
after · Veilsettles confidentially
settlement = veil.facilitator(
  alias: "feedmarket.veil",
  confidential: true )
// everything else unchanged
refusal · live outputHTTP 402
{
  "x402Version": 2,
  "resource": {
    "url": "https://veil-devnet.vercel.app/v1/payee/test",
    "description": "Reference payee — the seat the end-to-end check pays (0.001000 units)",
    "mimeType": "application/json"
  },
  "accepts": [
    {
      "scheme": "exact-confidential",
      "network": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      "asset": "6pFkZndusKGifrKLXgaQJFjUT3Gi9n1uXcwkG7Jef3ur",
      "payTo": "2KncEeBuW9WRRqfxbrCgVJ63nMPTBJqpwvzaRXAuRTi5",
      "maxAmountRequired": "1000",
      "amount": "1000",
      "resource": "https://veil-devnet.vercel.app/v1/payee/test",
      "description": "Reference payee — the seat the end-to-end check pays (0.001000 units)",
      "maxTimeoutSeconds": 60,
      "extra": {
        "tokenProgram": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
        "decimals": 6,
        "privacy": "confidential-balances",
        "poolIndex": 8,
        "auditor": null,
        "hides": [
          "on-chain-amount",
          "on-chain-balance"
        ]
      }
    }
  ]
}

A refusal carries no accepts[] entry at all, which is the field that matters. An offer alongside a refusal would invite a client to pay something the server has already said it cannot settle privately — the failure this whole surface exists to prevent. Why the refusal matters →