MeshGateway / Docs
Networks & Rails

Robinhood Chain rail

The x402 exact scheme over Permit2 witness transfers, with gasless buyers.

USDG has no EIP-3009, so MeshGateway implements the x402 exact scheme itself using Permit2 witness transfers.

How it works

  1. The gateway issues the payment-required challenge.
  2. The buyer signs a PermitWitnessTransferFrom: the spender is pinned to the canonical x402ExactPermit2Proxy (0x402085…20001) and the recipient is pinned by the witness.
  3. A relayer wallet broadcasts proxy.settle(...), and USDG moves straight from payer to merchant.

The relayer needs ETH on chain 4663 for gas (RELAYER_PRIVATE_KEY); buyers never do.

Gasless buyers

Agent wallets only ever need USDG. Payments are signatures (the relayer pays settlement gas), and the one-time Permit2 approval is gas-sponsored:

curl -X POST https://api.meshgateway.co/api/gas/sponsor \
  -H 'content-type: application/json' \
  -d '{"address": "0xYourAgentWallet"}'

This sends exactly enough ETH dust for that single approval transaction, and is guarded: the address must hold USDG, have no existing allowance, have no existing gas, is served once per address, and the endpoint is rate-limited.

On this page