Skip to main content
A payment scheme defines how a payment is made on a specific blockchain. Schemes handle the chain-specific details: constructing transactions, signing them, and producing the proof that gets sent in the X-PAYMENT header.

Scheme identification

Every payment is identified by a tuple of three values:
FieldExampleDescription
scheme"exact"The payment method
network"solana-devnet"The blockchain network
asset"USDC"The token being used
When a server returns payment requirements, the client matches against this tuple to find a compatible payment handler.

Solana schemes

SPL Token payments

The primary Solana scheme uses SPL token transfers for payments. The client signs a transaction transferring tokens from their wallet to the merchant’s address.
import { xSolanaSettlement } from "@faremeter/info/solana"

const requirements = xSolanaSettlement({
  network: "devnet",
  payTo: "7xKXwxRPMo2sUAT5...",
  asset: "USDC",
  amount: "10000",
})
Supported assets: USDC (devnet, mainnet-beta).

Native SOL

Faremeter also supports native SOL transfers for Solana payments.

EVM schemes

EIP-3009 gasless transfers

The EVM scheme uses EIP-3009 transferWithAuthorization for gasless USDC payments. The client signs an EIP-712 typed message authorizing the transfer. The facilitator submits the transaction on-chain and pays the gas fees.
import { x402Exact } from "@faremeter/info/evm"

const requirements = x402Exact({
  network: "base-sepolia",
  asset: "USDC",
  amount: "10000",
  payTo: "0x1234...",
})
Supported networks: Base Sepolia, Base, Polygon, Skale Europa Testnet, Monad. The gasless design means clients never need native tokens for gas. The facilitator covers transaction costs.

How schemes compose

Faremeter’s plugin architecture allows multiple schemes to coexist. A server can accept both Solana and EVM payments simultaneously:
import { createMiddleware } from "@faremeter/middleware/express"
import { xSolanaSettlement } from "@faremeter/info/solana"
import { x402Exact } from "@faremeter/info/evm"

const middleware = await createMiddleware({
  facilitatorURL: "https://facilitator.corbits.dev",
  accepts: [
    xSolanaSettlement({ network: "devnet", payTo: "7xKX...", asset: "USDC", amount: "10000" }),
    x402Exact({ network: "base-sepolia", payTo: "0x1234...", asset: "USDC", amount: "10000" }),
  ],
})
The client selects the scheme it can fulfill based on its available wallets.

Adding new schemes

New payment schemes can be added through the payment handler interface. See Extensions for community-contributed schemes.

Further reading