# X402 v0.6.0 - Table of Contents

Elixir SDK for the x402 HTTP payment protocol

## Pages

- [Overview](readme.md)
- [Changelog](changelog.md)
- [License](license.md)

- Guides
  - [Getting Started](getting-started.md)
  - [Paying for Resources](client.md)
  - [Plug/Phoenix Integration](plug-integration.md)
  - [Custom Payment Schemes](custom-schemes.md)
  - [Paid MCP Tools](mcp.md)
  - [Browser Paywall](paywall.md)
  - [Local Payment Verification](local-verification.md)
  - [Run Your Own Facilitator](facilitator.md)
  - [Live Smoke Tests](live-smoke-tests.md)

## Modules

- Core Protocol
  - [X402](X402.md): Convenience API for working with x402 payment headers and wallet addresses.
  - [X402.PaymentRequired](X402.PaymentRequired.md): Encodes and decodes the x402 `PAYMENT-REQUIRED` header value.
  - [X402.PaymentRequirements](X402.PaymentRequirements.md): Validation and matching helpers for x402 v2 payment requirements.
  - [X402.PaymentResponse](X402.PaymentResponse.md): Encodes and decodes the x402 `PAYMENT-RESPONSE` header value.
  - [X402.PaymentSignature](X402.PaymentSignature.md): Decodes and validates x402 v2 `PAYMENT-SIGNATURE` header values.

- Payer Client
  - [X402.Client](X402.Client.md): Transport-agnostic payer client for x402 v2 payments.
  - [X402.Client.Finch](X402.Client.Finch.md): Finch-backed payer client with an automatic 402 → sign → retry flow.
  - [X402.EIP3009](X402.EIP3009.md): EIP-3009 `TransferWithAuthorization` building and EIP-712 signing.
  - [X402.EIP712](X402.EIP712.md): Generic [EIP-712](https://eips.ethereum.org/EIPS/eip-712) hashing primitives.
  - [X402.Permit2](X402.Permit2.md): Permit2 `PermitWitnessTransferFrom` building and EIP-712 signing for the
x402 `upto` scheme on EVM networks.
  - [X402.Signer](X402.Signer.md): Behaviour for client-side payment signers.
  - [X402.Signer.LocalKey](X402.Signer.LocalKey.md): `X402.Signer` backed by a raw secp256k1 private key held in memory.
  - [X402.Signer.SolanaKey](X402.Signer.SolanaKey.md): `X402.Signer` backed by a raw Ed25519 private key held in memory.

- Facilitator Client
  - [X402.Facilitator](X402.Facilitator.md): Client for the x402 facilitator API: verify, settle, supported, discovery.
  - [X402.Facilitator.Auth](X402.Facilitator.Auth.md): Behaviour for facilitator request authentication.
  - [X402.Facilitator.Auth.CDP](X402.Facilitator.Auth.CDP.md): Authentication for the Coinbase Developer Platform (CDP) x402 facilitator.
  - [X402.Facilitator.Error](X402.Facilitator.Error.md): Structured error returned by facilitator client operations.

  - [X402.Facilitator.HTTP](X402.Facilitator.HTTP.md): HTTP transport for facilitator requests.
  - [X402.Hooks](X402.Hooks.md): Behaviour for lifecycle hooks around facilitator verify and settle operations.
  - [X402.Hooks.Context](X402.Hooks.Context.md): Context passed between x402 lifecycle hook callbacks.
  - [X402.Hooks.Default](X402.Hooks.Default.md): Default no-op implementation of `X402.Hooks`.

- Plug Integration
  - [X402.Paywall](X402.Paywall.md): Behaviour for rendering browser-facing HTML paywall pages.
  - [X402.Paywall.Default](X402.Paywall.Default.md): Self-contained HTML paywall page for browser-facing 402 responses.
  - [X402.Plug.PaymentGate](X402.Plug.PaymentGate.md): Plug middleware that gates configured routes behind x402 v2 payment verification.

- Payment Schemes
  - [X402.Scheme](X402.Scheme.md): Behaviour for pluggable x402 payment schemes.
  - [X402.Scheme.EVM](X402.Scheme.EVM.md): Shared local pre-checks for EVM authorization-style scheme payloads.
  - [X402.Scheme.ExactEVM](X402.Scheme.ExactEVM.md): Built-in `X402.Scheme` for `exact` payments on EVM (`eip155:*`) networks.
  - [X402.Scheme.ExactSVM](X402.Scheme.ExactSVM.md): Built-in `X402.Scheme` for `exact` payments on Solana (`solana:*`) networks.
  - [X402.Scheme.Registry](X402.Scheme.Registry.md): Resolves (scheme, network) pairs to `X402.Scheme` modules.
  - [X402.Scheme.UptoEVM](X402.Scheme.UptoEVM.md): Built-in `X402.Scheme` for `upto` payments on EVM (`eip155:*`) networks.

- MCP Transport
  - [X402.MCP](X402.MCP.md): x402 v2 payment flows over the Model Context Protocol (MCP transport).
  - [X402.MCP.Client](X402.MCP.Client.md): Client half of the x402 MCP transport: pay for tool calls automatically.
  - [X402.MCP.Server](X402.MCP.Server.md): Server half of the x402 MCP transport: gates a tool handler behind payment.

- Local Verification
  - [X402.ERC6492](X402.ERC6492.md): ERC-6492 signature wrapper parsing and building.
  - [X402.RPC](X402.RPC.md): Minimal Ethereum JSON-RPC client over Finch.
  - [X402.Verify.EVM](X402.Verify.EVM.md): Local verification of EVM `exact`/`eip3009` payment payloads.
  - [X402.Verify.SVM](X402.Verify.SVM.md): Local verification of SVM `exact` payment payloads.

- Facilitator Server
  - [X402.Facilitator.Engine](X402.Facilitator.Engine.md): Facilitator-role engine: verify and settle x402 payments yourself.
  - [X402.Facilitator.NonceManager](X402.Facilitator.NonceManager.md): Serializes fee-payer transaction nonces for concurrent settlements.
  - [X402.Facilitator.PendingSettlementStore](X402.Facilitator.PendingSettlementStore.md): Behaviour for pending-settlement reconciliation stores.
  - [X402.Facilitator.PendingSettlementStore.ETS](X402.Facilitator.PendingSettlementStore.ETS.md): ETS-backed pending-settlement store adapter.
  - [X402.Facilitator.SVMEngine](X402.Facilitator.SVMEngine.md): Facilitator-role engine for `exact` payments on Solana (`solana:*`).
  - [X402.Plug.Facilitator](X402.Plug.Facilitator.md): Plug scaffold exposing one or more facilitator engines as the
facilitator HTTP API.
  - [X402.RLP](X402.RLP.md): Minimal pure [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/)
(Recursive Length Prefix) encoding.
  - [X402.Transaction](X402.Transaction.md): Minimal [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) (type-2)
transaction encoding and signing digests.

- Solana
  - [X402.Base58](X402.Base58.md): Base58 encoding and decoding using the Bitcoin alphabet.
  - [X402.Solana](X402.Solana.md): Solana address primitives: program IDs, PDA and ATA derivation.
  - [X402.Solana.RPC](X402.Solana.RPC.md): Minimal Solana JSON-RPC calls over an `X402.RPC` endpoint.
  - [X402.Solana.Transaction](X402.Solana.Transaction.md): Solana v0 transaction message building, serialization, and decoding.

- Utilities
  - [X402.Behaviour](X402.Behaviour.md): Utilities for working with Elixir behaviours and callback implementations.

  - [X402.Telemetry](X402.Telemetry.md): Telemetry event definitions and emission helpers for x402 operations.
  - [X402.Utils](X402.Utils.md): Shared utility functions for the X402 library.
  - [X402.Wallet](X402.Wallet.md): Wallet address validation utilities for x402.

- Extensions
  - [X402.Extensions.Bazaar](X402.Extensions.Bazaar.md): Bazaar discovery extension for x402 v2: extension builder and discovery client.
  - [X402.Extensions.EIP2612GasSponsoring](X402.Extensions.EIP2612GasSponsoring.md): Builds, signs, and validates the `eip2612GasSponsoring` extension.
  - [X402.Extensions.ERC20ApprovalGasSponsoring](X402.Extensions.ERC20ApprovalGasSponsoring.md): Builds and validates the `erc20ApprovalGasSponsoring` extension.
  - [X402.Extensions.OfferReceipt](X402.Extensions.OfferReceipt.md): Offer-and-receipt extension for x402: signed offers and signed receipts.
  - [X402.Extensions.OfferReceipt.JWS](X402.Extensions.OfferReceipt.JWS.md): Compact JWS signing and verification for the offer-receipt extension.
  - [X402.Extensions.PaymentIdentifier](X402.Extensions.PaymentIdentifier.md): Encodes and decodes x402 payment identifier payloads.
  - [X402.Extensions.PaymentIdentifier.Cache](X402.Extensions.PaymentIdentifier.Cache.md): Behaviour and adapter helpers for payment identifier idempotency caches.
  - [X402.Extensions.PaymentIdentifier.ETSCache](X402.Extensions.PaymentIdentifier.ETSCache.md): ETS-backed cache adapter for payment identifier idempotency.
  - [X402.Extensions.PaymentIdentifier.RedisCache](X402.Extensions.PaymentIdentifier.RedisCache.md): Redis-backed cache adapter for payment identifier idempotency.
  - [X402.Extensions.PaymentIdentifier.RedisCache.Command](X402.Extensions.PaymentIdentifier.RedisCache.Command.md): Behaviour for the Redis command layer used by
`X402.Extensions.PaymentIdentifier.RedisCache`.
  - [X402.Extensions.SIWX](X402.Extensions.SIWX.md): Encodes and decodes SIWX messages and `SIGN-IN-WITH-X` header values.
  - [X402.Extensions.SIWX.ETSStorage](X402.Extensions.SIWX.ETSStorage.md): ETS-backed SIWX storage with TTL-based expiration.
  - [X402.Extensions.SIWX.Storage](X402.Extensions.SIWX.Storage.md): Behaviour for storing SIWX access records.
  - [X402.Extensions.SIWX.Verifier](X402.Extensions.SIWX.Verifier.md): Behaviour for SIWX signature verification.
  - [X402.Extensions.SIWX.Verifier.Default](X402.Extensions.SIWX.Verifier.Default.md): Default EVM SIWX signature verifier using `ex_secp256k1`.

