x402-group-pay

Split one booking across N wallets — the 6-person dinner problem, solved with pooled x402 USDC contributions, signed receipts for every payer, and a signed funded proof for the merchant.

USDC on BaseUSDC on Solana HTTP 402Apache-2.0

Pay on either rail — your client picks. Every 402 challenge lists Base and Solana at the same price, and one pool can be funded by a mix of both.

git clone https://github.com/nirholas/x402-group-pay && cd x402-group-pay
npm install && cp .env.example .env   # pre-filled — set your own payTo to get paid
npm run dev                            # http://localhost:4041 — demo checkout included

Pricing

RoutePriceReturns
POST /pools$0.001Pool record + join links
POST /pools/:id/pay$0.01 / shareSigned contribution receipt
GET /pools/:idfreeLive pool status
GET /pools/:id/prooffreeSigned funded proof once complete

Payment rails

USDC on Base

EIP-3009 transferWithAuthorization, signed in the wallet. Nothing on-chain until the facilitator settles.

network
base-sepolia (default) · base
payTo
0x40252CFDF8B20Ed757D61ff157719F33Ec332402
facilitator
https://x402.org/facilitator

USDC on Solana

Fee-sponsored SPL transferChecked. The facilitator's feePayer covers the SOL fee — you need only USDC.

network
solana (default) · solana-devnet
payTo
WwwuGbqHrwF5RG89KhUbmRWEvjnRH9k5kVM5p7T3WwW
facilitator
https://facilitator.payai.network

A rail with no configured address is dropped from the challenge instead of failing the request, so a single-rail deployment is a one-line change.

How a paid call works

1 · RequestPOST /pools/:id/pay
2 · 402accepts[]: Base and Solana, same price
3 · Paypick a rail, sign, send X-PAYMENT
4 · 200signed receipt in-body + X-PAYMENT-RESPONSE

Quickstart: full agent flow

PRIVATE_KEY=0x...   # wallet with Base Sepolia USDC (faucet.circle.com)
npm run client       # create pool → pay shares → fetch signed funded proof

Humans use the same server: public/index.html is a working split-the-bill page built on the drop-in @three-ws/x402-payment-modal — create a pool, copy the join link, everyone pays their share in a browser. Because the challenge carries both rails, the modal offers EVM wallets and Phantom with no extra wiring, plus SIWX re-entry and per-site spending caps.