VEIL
docs v1 rail x402

Docs / Concepts

Concepts

Veil makes one specific thing private: the amount of an agent payment. It does not pretend to hide anything else, and knowing which is which is the whole of using it well.

The two layers

Layer 1 — confidential balances (the amount)

The payment moves a Token-2022 balance between two confidential accounts. The account state on chain holds an ElGamal ciphertext and an AES ciphertext of the balance, not a number. A confidential transfer carries the ciphertexts, a zero-knowledge proof that the transferred amount was in range, and a proof that the sender's remaining balance did not go negative.

The practical consequence: you can read the explorer link and see that a transfer happened, but not how much moved. The recipient — and an auditor key set on the mint, if one is — can decrypt it.

Layer 2 — one-time accounts (the graph)

Confidential balances hide amounts. They do not hide that an account exists. If a merchant received every payment into one token account, you could still count the transactions and correlate them with the merchant's public identity: amount privacy with a fully public graph wrapped around it.

So every payment lands in a different pre-created account. Two payments to the same merchant never sit next to each other on the account graph.

These accounts cannot be derived, and the design notes say so explicitly rather than shipping a derivation that would silently disagree with itself. There is exactly one deterministic address form per (owner, mint) — the associated token account — so a pool of N accounts is created once and its addresses recorded. What is deterministic is which slot a payment is assigned: deriveSlot(identity, poolSize) is pure, so the merchant can reconcile an incoming payment without the payer telling it anything extra.

What a payment actually does

agent                          rail (facilitator)              merchant
  |  GET /resource?nonce=N  ────────►  |
  |  ◄──── 402 + offer (price, seat)   |
  |  generate 3 proofs, write them,    |
  |  verify them into context accounts |
  |  sign the transfer (own half) ───► |
  |                    co-sign fee → broadcast ──► chain ──► merchant seat
  |  ◄──── 200 { paid: true }          |

Three proofs precede the transfer, each in its own transaction:

The payer signs the money movement. The rail co-signs only the network fee, so a reasonably-funded buyer is not the rail's problem, and the rail never holds the payer's keys.

The identity, and the 409

A payment identity is (resource, payer, nonce). It is deterministic, so the same identity always maps to the same seat — a client that retries a 402 after a network blip does not burn a second seat. Once it settles, that identity is spent: asking again returns 409 payment-already-settled naming the time. Nonces must be fresh per payment, which is why the agent SDK generates one per call rather than letting you set it.

The honest limits

Stated plainly, because a privacy claim that overreaches is worse than a modest one:

Where defensibility actually lives

Not in the cryptography. The confidential-transfer primitives are Solana's. Veil's position is the facilitator, the one-line merchant integration, the auditor workflow, and the dashboard — and if the x402 spec absorbs confidential settlement, that is the part that survives.

See also