Overview & Integration Guide
x402 is a privacy-preserving transaction protocol that allows AI agents, apps, and users to exchange value, data, or proofs securely and confidentially.
It's designed for the new era of machine-to-machine and agent-to-agent payments, where transactions must be verifiable but not publicly traceable.
In simple terms, x402 provides a way for agents to:
x402 doesn't replace blockchains — it operates as a privacy layer on top of them. It orchestrates how payments are prepared, signed, proven, and logged across compatible networks such as Solana, Zcash, and Monero.
Traditional blockchain transactions are fully transparent. Anyone can see who paid whom, how much, and when.
That's fine for open-ledger systems but unsuitable when agents:
x402 fixes this by introducing privacy-aware transaction orchestration, using cryptography and off-chain proofs to preserve confidentiality while keeping an auditable link if needed.
The protocol coordinates four key layers:
Your AI agent or DApp defines what action requires a payment (e.g., executing a model, generating data, sending output).
x402 converts the required value (expressed in SOL) into the chosen privacy rail (Zcash or Monero). It fetches real-time conversion rates from trusted oracles, then prepares a shielded transfer request.
The user's wallet (or agent enclave) signs and broadcasts the shielded transaction. For Zcash, x402 can attach metadata that supports view-key selective disclosure. For Monero, x402 generates standard private transactions using ring signatures and stealth addresses.
After the transaction is confirmed, x402 creates a lightweight proof object (proof_hash) that confirms payment occurred, links to the agent action, and stores only the minimum info: timestamp, SOL equivalent, privacy rail used, and transaction status. No raw wallet or address data is stored on the x402 servers.
| Rail | Type | Key Feature | Integration |
|---|---|---|---|
| Zcash (shielded) | zk-SNARKs | Optional view-keys for selective disclosure | Preferred for agents that need compliance-ready audit proofs |
| Monero (private-by-default) | RingCT, stealth addresses | Strong anonymity, no native audit keys | Suitable for maximum privacy or peer-to-peer agent payments |
Both rails are optional. You can build x402 agents that use:
When a developer or user creates an agent:
Toggles the privacy layer in the setup wizard.
Zcash (shielded) — recommended default. Monero (private-by-default) — optional for ultra-private mode.
Defines when x402 applies different privacy or disclosure rules (micro, standard, or KYC-required).
The user's wallet or enclave signs transactions. The platform never handles raw private keys.
x402 records a proof-hash on its relay to confirm the agent's operation without revealing sensitive details.
If the user allows it, x402 stores a temporary encrypted view-key for compliance or audit requests.
x402 follows a privacy-by-design model:
Agents charging per inference request can accept shielded micro-payments with x402 proofs.
Two AI agents exchange tasks and payments privately, using Monero rail through x402.
Companies can offer pay-per-call APIs with Zcash shielded billing to protect customer usage patterns.
Creators can tokenize and receive revenue privately while still showing public proof of earnings if needed (via Zcash view-key).
x402 enables privacy but is not designed to evade regulation. Transactions remain verifiable through cryptographic proofs or selective disclosure when legally required. Agents using Monero should clearly communicate that full auditability may not be available, depending on jurisdiction.
x402 = Privacy layer for AI and Web3 agents.
It bridges transparent blockchains (like Solana) with privacy rails (Zcash / Monero), letting agents operate confidentially while staying compliant.