pay-mcp
v0.19.0x402 pay tools for MCP clients, plus a `buy` command: read the offer, consent, pay.
Your agent reads an x402 price, then pays it. The first call pays nothing. Nothing is paid if the offer moved. Start with test money. One command, nothing to set up: It makes a key on your machine, gets 1 test USDC for it on Base Sepolia, pays our demo offer and prints the transactions. Test USDC has no real value.
Summary extracted from the README.
@vauban-pay/mcp
Your agent reads an x402 price, then pays it. The first call pays nothing. Nothing is paid if the offer moved.
Start with test money. One command, nothing to set up:
npx -y @vauban-pay/mcp try
It makes a key on your machine, gets 1 test USDC for it on Base Sepolia, pays our demo offer and prints the transactions. Test USDC has no real value.
Then pay a real price, from your own key. A demo call on Base costs 0.01 USDC:
npx -y @vauban-pay/mcp buy https://pay.vauban.tech/x402-base-mainnet/v1/quote
buy pays one x402 resource on Base mainnet (USDC) or Starknet mainnet (STRK), with your own key, in two steps: read the offer, then pay with the consent token. On sale today: the x402 market watch, 0.10 USDC on Base, 1.7 STRK on Starknet.
First time on Base: buy key new --network base makes your key and prints the address to fund with USDC. Then buy <url>, then the same line with --consent.
Try it in one command
With Node.js 22 or later, and nothing else:
npx -y @vauban-pay/mcp try
It pays our demo x402 offer on Base Sepolia (test USDC, no real value) with your own key:
- finds or creates the key in
~/.vauban-pay(payer, a standard Web3 v3 keystore, andpayer.password; both readable by you only). The key and its password are never printed. IfPAY_MCP_EVM_KEYSTORE_PATHandPAY_MCP_EVM_PASSWORD_PATHare set, that keystore is used instead and nothing is written; - asks our test USDC route for 1 test USDC for that address (once per address; when it cannot, the command stops and prints the faucet to use);
- pays the offer:
exact(EIP-3009) oneip155:84532only, at most 1 test USDC, to the offer'spayTo. Any other offer is refused.
It prints the address, the funding and payment transactions, and a Verify:
command that reads the payment back from a public Base Sepolia node. --json
prints the same facts as one JSON object. Exit code: 0 paid, 1 refused,
2 usage, 3 outcome unknown (do not pay again before checking).
On Starknet Sepolia instead: npx -y @vauban-pay/mcp try --network starknet-sepolia (your STARK key in ~/.vauban-pay/starknet-sepolia.json, test STRK, your account deployed if it is not, at most 0.01 STRK paid; same output, --json and exit codes).
Buy the x402 market watch
buy pays one x402 resource on a value network, with your own key. Read first,
pay second: the first command prints the price and pays nothing, the second
pays exactly what you agreed to.
On Base, with USDC
The market watch costs 0.10 USDC on eip155:8453
(exact, printed as 0.1 USDC). You only need USDC on Base (network
fees are included in the price): no Starknet account, no node.
-
Make your key. It prints the address to fund.
npx -y @vauban-pay/mcp buy key new --network base -
Send USDC on Base to that address. The price above covers one call.
-
Read the offer, which pays nothing (exit code 2), then pay it with the consent token the first command printed.
npx -y @vauban-pay/mcp buy https://pay.vauban.tech/x402-base-mainnet/v1/intel npx -y @vauban-pay/mcp buy https://pay.vauban.tech/x402-base-mainnet/v1/intel --consent <token>
key new writes a Web3 v3 keystore and the file of its random password side by
side, ~/.vauban-pay/base-mainnet.keystore and base-mainnet.password, both
readable by you only (mode 0600). buy finds them on its own. The password sits
beside the keystore, so this protects like a plain key file with that mode, and no
more. buy key address --network base prints the address again, never the key.
To pay with a keystore of your own, name it with PAY_MCP_EVM_KEYSTORE_PATH and
PAY_MCP_EVM_PASSWORD_PATH; when set, they go first. You sign an EIP-3009
authorization. The wallet that try creates holds test money and is refused on a
value network (try_wallet_refused), even if you name it. The same two commands
pay any other x402 exact USDC offer on eip155:8453.
On Starknet, with STRK
The market watch costs 1.7 STRK on starknet:SN_MAIN.
You need a Starknet account that holds STRK and is deployed. buy neither funds
nor deploys one.
npx -y @vauban-pay/mcp buy key new
That makes a Starknet key, kept in ~/.vauban-pay/starknet-mainnet.json (mode 0600,
never printed), and prints the address to fund and deploy. That address is not
deployed and holds nothing yet; buy pays from it once you have done both. To
keep an account you already have, use buy key import --address 0x... (the key is
read from stdin, never from an argument), or set the two variables yourself. They
go first:
export PAY_MCP_STANDARD_X402_ACCOUNT_ADDRESS=0x... # your account
export PAY_MCP_STANDARD_X402_PRIVATE_KEY=... # its key, from your own secrets handling
Then the same two commands, read and pay:
npx -y @vauban-pay/mcp buy https://pay.vauban.tech/x402-mainnet/v1/intel
npx -y @vauban-pay/mcp buy https://pay.vauban.tech/x402-mainnet/v1/intel --consent <token>
buy contacts no Starknet node unless you name one, with --rpc <url> or
STARKNET_RPC_URL; there is no default node. A node you name must serve Starknet
mainnet, or nothing is signed.
The first command prints the price as served, and a consent token. The second pays only if the offer read again is identical: the token binds the network, the amount, the token, the payee and the resource, so if anything changed, nothing is paid. A paid run prints the transaction hash, your address as payer, and the data the resource returned.
What buy will not do, whatever the offer says: pay an offer that is not on
Starknet mainnet or Base mainnet, pay over plain http (except to a machine
on your own loopback), follow a redirect, pay when the 402 comes from another
origin than the one you called, sign when the Starknet node you gave serves
another chain than the offer's, or pay more than the consented amount. It counts its payments per day
in ~/.vauban-pay/buy-day.json and stops at PAY_MCP_STANDARD_X402_MAX_PER_DAY
(100 when unset). Your key is read from the environment or the keystore and never printed.
Exit codes: 0 paid, 1 not paid, 2 consent needed, 3 sent but not
confirmed (do not pay again before checking), 4 a facilitator on your own
machine reported a simulated chain: that is not a payment.
--hide-addresses is a choice, for a recording or a screen share: the output
shows only the amount, the transaction hash and the payer, with no payee, no
token contract and no explorer link. The consent token holds none of them
either, so on the read-only call you consent to a payee you have not seen on
screen. Run once without the flag to see where the money goes; --json prints
the same facts as one JSON object.
What the payments and the receipts are
Vauban Pay MCP server -- x402 payment tools for MCP clients.
Your agent makes a real on-chain payment in about a minute
(make_payment, sponsored, Sepolia, no wallet); that payment is a Starknet
transaction you read back from any node, not a STARK receipt. On the proof
rail (pay_for_resource against a merchant that asks for a STARK proof), the
receipt is backed by a STARK the facilitator verified, and merchants are graded
on their proven on-chain history, never on a declared counter. The standard x402 path
(Starknet, and EVM networks such as Base), and the sponsored payment carry no STARK, and they
hide nothing: the amount, the payer and the payee are public on their chain.
Each outcome says which rail it came from.
The default rails are not private: our proofs are transparent STARKs. On
the proof rail the
amount, the currency, the timestamp and the payer are public inputs to the
proof. What the proof buys you is verifiability without trust, not
confidentiality. pay_shielded (below) is the private rail: through the pool,
the payer can stay out of the payment transaction when another account submits it.
Use it from your program
import { payFetch } from "@vauban-pay/mcp";
const res = await payFetch(url, { method: "POST", body }); // replayed with the payment on a 402
console.log(res.status, res.payment?.outcome, res.payment?.transaction);
Same bounds as the server: Base Sepolia by default (1 test USDC per payment, 5 per session, wallet in ~/.vauban-pay, test funds when short); another network ({ network } or VAUBAN_PAY_NETWORK) needs maxPerPayment, maxPerSession, payees, and on a value network acceptMainnetSpend naming it.
A 402 is paid only when it comes from the origin you called: the first request never follows a redirect, and a 402 served by another origin is refused (pay_fetch_cross_origin). If you pass your own fetch, it must return a Response with its url set, or every 402 is refused (pay_fetch_origin_unverified).
Paying on Starknet mainnet
The plain x402 rail is served at https://pay.vauban.tech/x402-mainnet. Its
/supported endpoint answers the standard x402 v2 document, and /v1/quote
answers a 402 listing exact, exact-pq and exact-cctp on starknet:SN_MAIN
(see Post-quantum payment intent).
exact and exact-pq ask for 0.5 STRK
(500000000000000000 atomic units of the STRK token
0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d), paid to
0x0386bc09b9ae44eb1475021db5c840d40d86bc49622946d2c006282fd81ad6bc, which is
also the feePayer: the facilitator pays the gas, you sign the transfer.
exact-cctp asks for 0.10 USDC
(100000 atomic units of the USDC token
0x033068f6539f8e6e6b131e6b2b814e6c34a5224bc66947c47dab9dfee93b35fb), a different asset on its own terms.
This server refuses that payment out of the box, on purpose: the account, the chain, the payee list and the cap have to be set by you before value can move, and the token is pinned, so only STRK is paid unless you list another. That is the point: a payment tool that pays anything a 402 names is a drain waiting to happen. Set these five variables to pay it:
| variable | why it exists |
|---|---|
PAY_MCP_STANDARD_X402_ACCOUNT_ADDRESS |
your Starknet account. Yours, never ours. |
PAY_MCP_STANDARD_X402_PRIVATE_KEY |
its key. Supply it through your own secrets handling; never commit it. |
STARKNET_RPC_URL |
defaults to Sepolia. On mainnet you must set it, or the authorization is signed against the wrong chain id. |
PAY_MCP_STANDARD_X402_PAYEES |
the payTo addresses this server may pay. Empty means none: it fails closed, so an unset install pays nobody. |
PAY_MCP_STANDARD_X402_MAX_WEI |
cap for a single payment, in atomic units of the token paid. Unset, it is 0.1 STRK (100000000000000000), which is below the 0.5 STRK offer above, so the default refuses it. Raise it deliberately. |
The token is a guard too, closed by default: this server signs a transfer of
STRK (0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d, the
same address on mainnet and Sepolia) and of no other token, whatever the offer
names, unless PAY_MCP_STANDARD_X402_ASSETS lists it. An offer for another
token is refused before anything is signed, with code
starknet_asset_not_allowed.
The day and the window are bounded as well. PAY_MCP_STANDARD_X402_MAX_PER_DAY
(100 when unset) counts the payments the server process signs on this path,
across every call and every client of that process, and past it a payment is
refused before signing with code daily_budget_spent. An offer whose
maxTimeoutSeconds is above 900 s, or is not a positive integer, is refused
before signing (authorization_window_too_long,
authorization_window_unreadable): a signed authorization stays executable
until its expiry, and this client does not sign one that outlives its offer.
A refusal on any of these is the outcome unpayable, and it is a fact about
your configuration, never about the merchant.
The shielded rail (pay_shielded) runs on Starknet Sepolia only.
Paying on Base and Ethereum mainnet
Starknet is the reference implementation; Base and Ethereum are also served.
https://pay.vauban.tech/x402-base-mainnet/v1/quote answers a 402 listing exact and exact-pq, on
eip155:8453; exact and exact-pq ask for
0.01 USDC (10000 atomic units of
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), and
https://pay.vauban.tech/x402-ethereum-mainnet/v1/quote lists exact and exact-pq on
eip155:1, exact and exact-pq for 1 USDC (1000000 atomic units of
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48), all paid to
0x4FCc101D25dcA5759dfC2D6443154bA32396260b. You sign an EIP-3009
authorization; you only need USDC, network fees are included in the price. See "Paying an EVM offer" below for the
variables; on Ethereum, USDC needs PAY_MCP_EVM_ASSETS.
Install
npx @vauban-pay/mcp
In Claude Code, with no configuration (pays on Base Sepolia only, see Without configuration):
claude mcp add vauban-pay -- npx -y @vauban-pay/mcp
Renamed from @vauban-org/pay-mcp
@vauban-org/pay-mcp is the former name of this package. Every version
published under it stays on npmjs.org and stays installable, so nothing you
already installed breaks. @vauban-pay/mcp is the name to use from now on, and
the only one this README, the demo site and the MCP registry entry point at.
@vauban-pay is our public scope: everything in it is on npmjs.org, and it
also carries @vauban-pay/substrate.
The MCP registry name does not change : it is still tech.vauban/pay-mcp,
a reverse-DNS namespace proven by a DNS record, unrelated to the npm name.
If your tooling says the package does not exist
A 404 on @vauban-pay/mcp almost always means your client resolved the
@vauban-pay scope to a private registry (GitHub Packages, an internal proxy)
where this package is not hosted. It is published on npmjs.org. Ask the public
registry explicitly, for the scope and not just for the command:
npm view @vauban-pay/mcp version --@vauban-pay:registry=https://registry.npmjs.org
--registry alone is not enough : the scoped mapping wins over it. If that
command still fails, read the registry directly, which no client config can
distort: curl -s https://registry.npmjs.org/@vauban-pay%2fmcp.
Or as an MCP client entry (Claude Desktop, Claude Code, any MCP client):
{
"mcpServers": {
"vauban-pay": { "command": "npx", "args": ["-y", "@vauban-pay/mcp"] }
}
}
Listed in the official MCP Registry
as tech.vauban/pay-mcp ; a domain-verified name, not a platform account:
ownership is proven by an Ed25519 signature whose public key lives in a DNS
record at the apex of vauban.tech. Also on
Smithery.
No account and no token are required to run it. What each tool reaches:
jcs_hashandrequest_delegation_grantare offline.make_paymentwithout a signer of your own calls our sponsor (https://demo.pay.vauban.tech/sponsor/v1/sponsor/settle, or whateverPAY_MCP_SPONSOR_URLnames), which settles a real Starknet Sepolia transfer that it funds. With a signer, it submits a transaction from your account throughSTARKNET_RPC_URL.verify_receiptin on-chain mode andcheck_merchantread Starknet throughSTARKNET_RPC_URL;check_merchantalso fetches the history URL you give it.pay_for_resourceandpay_shieldedtalk to the URLs you give them (the resource, and forpay_for_resourcethe proof URL); the standard x402 path also reads your node throughSTARKNET_RPC_URL.pay_shieldedalso reads a file from your disk and sends it to the URL: the proof named byproof_path, only inside the directory you name inPAY_MCP_SHIELDED_PROOF_DIR. See Files.
STARKNET_RPC_URL defaults to a public node we do not operate.
There is a second entrypoint, dist/serve.js, which speaks HTTP, refuses every
call without a JWT issuer, audience and JWKS endpoint, and exits rather than
serve unverified requests when its optional authentication dependency is not
installed. If you are reading this to try the tools, you want the stdio
entrypoint above.
Try it in 60 seconds (offline, no config)
After the client entry above, ask your agent to canonicalize and hash a JSON
object ; jcs_hash is fully offline, so this needs no keys, no RPC, no network:
Use the
jcs_hashtool on{"b": 2, "a": 1}and show me the digest.
You get back the RFC 8785 canonical form {"a":1,"b":2} and its SHA-256. The
point of the demo: two objects that differ only in key order hash to the same
digest ; that is the canonicalization every STARK receipt in this ecosystem is
built on. Change a value, and the digest changes; reorder keys, and it does not.
Then, still offline, request_delegation_grant builds and hashes a
bounded-spend authorization object without touching a chain. The other tools
reach the network, each in the way listed above.
Importing from another package
Three entry points are declared, and only three:
import { payFetch, createPayFetch } from '@vauban-pay/mcp'; // since 0.15.0; the same as '@vauban-pay/mcp/fetch'
import { payFetch } from '@vauban-pay/mcp/fetch';
import { classifyTransaction, fetchTransactionOutcome } from '@vauban-pay/mcp/starknet';
Importing the package starts nothing (before 0.15.0 the root was the HTTP
server's file). The servers are run, not imported: the MCP stdio server is
npx -y @vauban-pay/mcp, the HTTP one is node dist/serve.js.
./starknet reads a Starknet transaction and classifies it. It verifies no
proof: a SUCCEEDED transaction carrying the expected payment event is a
settlement, not a STARK receipt. Checking a receipt is verify_receipt, which
is a different statement.
Anything else inside the package is an implementation detail, closed by the
exports field: deep paths such as @vauban-pay/mcp/dist/... fail with
ERR_PACKAGE_PATH_NOT_EXPORTED. If you need something that is not one of
the two entry points above, ask for it to be declared rather than reaching for
the file.
Tools
| Tool | Description |
|---|---|
jcs_hash |
JCS (RFC 8785) canonicalize a JSON object and return its SHA-256 hex digest |
make_payment |
A Starknet Sepolia payment. Without signer env vars (the default): our sponsor settles a real, value-carrying Sepolia STRK transfer it funds, to a payee it fixes. With PAY_MCP_SEPOLIA_* set: your account emits a receipt hash through PaymentDemoEmitter, a real transaction that moves no value |
verify_receipt |
Check a receipt, three modes: its JCS hash against an expected hash (hash mode), a payment-committed-note-v1 receipt against its own cells (note-receipt mode), or a Starknet transaction read on chain, on mainnet or Sepolia as the node's chain id says (chain mode). See below |
request_delegation_grant |
Build and JCS-hash a DelegationGrant authorization object |
check_merchant |
Check a merchant's proven service history (e.g. https://demo.pay.vauban.tech/x402/v1/history). Four verdicts, never conflated: PROVEN_SAMPLE, REFUTED (names the contradicting element), NO_RECORD (indeterminate, not negative), UNREACHABLE (a transport fact, not a merchant fact). An RPC outage degrades chain checks to structural level and says so |
pay_shielded |
The same walk on the shielded rail, whose receipt carries no amount: read the vauban-shielded-strk20 offer, build the X-VAUBAN-SHIELDED-SETTLEMENT header (pool coordinates plus an amount commitment), stream the STARK proof you hold (proof_path, sent as given) as the POST body, return the receipt. Starknet Sepolia only. Outcomes: paid, refused (code replayed_settlement when the value leg was already served once), unpayable (this client will not pay THIS offer), unreachable, no_payment_required -- see below |
pay_for_resource |
The x402 client walk: GET a resource, and if it answers 402, download a STARK proof, gunzip it in memory, and POST it back to settle. Outcomes: no_payment_required (200 direct -- free, not a failure), paid (content + PAYMENT-RESPONSE receipt + manifest), refused (402 again, server's reason verbatim), unreachable (transport fact only). Proof: the one the merchant pre-generated and published for that resource; every paid result carries a label stating what the 200 establishes. Standard x402 v2 (0.7.0): a foundation-format 402 with an exact/Starknet offer is paid by the configured account's own SNIP-9 signature instead (see below); fifth outcome unpayable. exact-cctp (off unless PAY_MCP_EXACT_CCTP=1; mainnet off unless PAY_MCP_EXACT_CCTP_MAINNET=1 as well): an exact-cctp offer on Starknet Sepolia is paid by the same account's SNIP-9 signature for two calls, an approve then a CCTP V2 burn, and the merchant is paid in USDC on Base Sepolia by a mint; the same on Starknet mainnet towards Base when the mainnet option, a eip155:8453:<address> payee entry, a written cap and a written daily cap are all set (codes cctp_mainnet_not_enabled, cctp_destination_not_allowed, cctp_mainnet_cap_unset, cctp_mainnet_daily_cap_unset, cctp_mainnet_daily_cap_spent); signed only when asset, payTo and the destination are the USDC, TokenMessengerMinterV2 and Base network (CCTP domain 6) this client pins for the offer's network, and destination_caller is zero, otherwise unpayable with code cctp_asset_not_pinned, cctp_pay_to_not_pinned, cctp_destination_network_not_pinned, cctp_destination_domain_not_pinned, cctp_destination_asset_not_pinned (mainnet) or cctp_destination_caller_not_zero, and when extra.max_fee is above 100 basis points of the amount (cctp_max_fee_above_bound); a paid result carries cctp and cross_chain_leg (the Base mint, minted or attested), and an indeterminate one carries burn_tx and do_not_repay. On every Starknet scheme, a refused that comes after the signature carries authorization_outstanding, execute_before and an instruction: the authorization stays executable by the offer's feePayer until then, so do not pay again before it. EVM: an exact offer on an eip155 network is paid with an EIP-3009 authorization signed from your keystore, closed until you configure it (see below); sixth outcome indeterminate (do not pay again before checking) |
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
STARKNET_RPC_URL |
No | https://starknet-sepolia-rpc.publicnode.com |
Starknet RPC, a Sepolia one by default. Point it at whichever node you trust, mainnet or Sepolia; the default is a public one we do not operate, deliberately. verify_receipt and the standard x402 path ask the node which chain it serves rather than trust its URL. |
PAY_MCP_SEPOLIA_ACCOUNT_ADDRESS |
No | -- | Starknet Sepolia account address for signer mode. When absent, make_payment uses the sponsored mode: a network call to the sponsor, and a real Sepolia transfer. |
PAY_MCP_SEPOLIA_PRIVATE_KEY |
No | -- | Private key hex for that account. Never commit it; supply it through your own secrets handling. |
PAY_MCP_SPONSOR_URL |
No | https://demo.pay.vauban.tech/sponsor/v1/sponsor/settle |
The sponsor make_payment calls when no signer is set. |
PAY_MCP_STANDARD_X402_PAYEES |
No | empty (pays nobody) | Standard x402 path: comma-separated payTo addresses this server may pay, or * for any. Empty fails closed, on purpose: a server that paid any payee a 402 names would be a drain for whoever holds the key. |
PAY_MCP_STANDARD_X402_ASSETS |
No | STRK only | Standard x402 path (exact, exact-pq, Falcon card mode): comma-separated <CAIP-2>/<token address> entries, e.g. starknet:SN_SEPOLIA/0x0512.... Without it only STRK (0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d) is payable, on starknet:SN_MAIN and starknet:SN_SEPOLIA; set, it replaces that default, so list STRK too if you still want it. Any other token is refused before signing (starknet_asset_not_allowed); a malformed entry refuses every payment (starknet_assets_malformed). |
PAY_MCP_STANDARD_X402_MAX_WEI |
No | 100000000000000000 (0.1 STRK), for STRK only |
Standard x402 path: cap on one payment, in atomic units of the token paid. Unset, the default applies to STRK (18 decimals) and any other listed token is refused (starknet_cap_unset_for_asset), since this server does not know its decimals. Written but not a base-10 integer, every payment is refused (starknet_cap_unreadable), never paid under the default. Set, the one value caps every listed token in its own atomic units, so allowing a token with other decimals changes what it means. |
PAY_MCP_STANDARD_X402_MAX_PER_DAY |
No | 100 |
Standard x402 path (exact, exact-pq, Falcon card mode, exact-cctp): payments per UTC day, one count for the whole server process, shared by every call and every client of that process. Past it, unpayable with code daily_budget_spent, before anything is signed. Written but not a base-10 integer, every payment is refused (daily_budget_unreadable). The counter lives in memory: a restart resets it, which is why the two caps above exist too. |
PAY_MCP_STANDARD_X402_ACCOUNT_ADDRESS / PAY_MCP_STANDARD_X402_PRIVATE_KEY |
No | falls back to PAY_MCP_SEPOLIA_* |
Standard x402 path: a signer of its own, so a hosted server can pay standard 402s without flipping make_payment out of sponsored mode. |
PAY_MCP_EXACT_CCTP |
No | -- (off) | The exact-cctp scheme (pay on Starknet Sepolia, the merchant is paid in USDC on Base Sepolia through CCTP V2). Exactly 1 turns it on; anything else, 1 included, leaves it off. On, it is chosen only when the 402 offers it, and before exact. In Falcon card mode, only with PAY_MCP_EXACT_CCTP_FALCON=1 as well. Same signer, daily budget (the one count of PAY_MCP_STANDARD_X402_MAX_PER_DAY) and chain check as the standard path. It does not open mainnet. |
PAY_MCP_EXACT_CCTP_MAINNET |
No | -- (off) | exact-cctp from Starknet mainnet to Base mainnet (eip155:8453), real USDC. Exactly 1, besides PAY_MCP_EXACT_CCTP=1, opens it; otherwise a mainnet offer is unpayable (cctp_mainnet_not_enabled), or skipped when the 402 also has an exact offer. Exactly 1: 1 does not open it. Open, it still needs a eip155:8453:<address> entry in PAY_MCP_EXACT_CCTP_PAYEES, PAY_MCP_EXACT_CCTP_MAX_UNITS and PAY_MCP_EXACT_CCTP_MAINNET_MAX_DAILY_UNITS set. STARKNET_RPC_URL must point at a mainnet node. |
PAY_MCP_EXACT_CCTP_FALCON |
For exact-cctp in Falcon mode |
-- (off) | exact-cctp paid by the Falcon card: exactly 1, besides PAY_MCP_EXACT_CCTP=1, lets the card sign the two calls of an exact-cctp offer, under the same payee list, caps, daily budget and chain check. Otherwise Falcon mode pays exact-pq only, and an exact-cctp-only 402 is unpayable (falcon_requires_exact_pq). No ML-DSA intent is sent with it. On Starknet mainnet the card must also be listed in PAY_MCP_FALCON_MAINNET_CARDS with a date to come, or the offer is unpayable (cctp_falcon_card_not_mainnet) before any budget is used. |
PAY_MCP_EXACT_CCTP_PAYEES |
With PAY_MCP_EXACT_CCTP |
empty (pays nobody) | exact-cctp: comma-separated merchants this server may pay (extra.destination_pay_to). A bare Base address, or *, applies to Base Sepolia only; a CAIP-10 entry (eip155:84532:0x… or eip155:8453:0x…) applies to its network, and is the only form that lets a mainnet payment through. Not the offer's payTo: this client signs only when payTo is Circle's TokenMessengerMinterV2 and asset is Circle's USDC, both pinned per Starknet network in the client, and refuses any other before signing. |
PAY_MCP_EXACT_CCTP_MAX_UNITS |
Mainnet only | 100000 (0.10 USDC) on Sepolia; none on mainnet |
exact-cctp: cap on one payment, in atomic USDC units. On mainnet there is no default: unset is unpayable (cctp_mainnet_cap_unset). Written but not a base-10 integer, on Sepolia as on mainnet, is unpayable (cctp_cap_unreadable), never the default. |
PAY_MCP_EXACT_CCTP_MAINNET_MAX_DAILY_UNITS |
Mainnet only | none | exact-cctp mainnet: cap on the USDC burnt per UTC day, all mainnet payments of the server process together, in atomic USDC units. No default: unset is unpayable (cctp_mainnet_daily_cap_unset), unreadable is cctp_cap_unreadable, and a payment that would go past it is cctp_mainnet_daily_cap_spent, before anything is signed. In memory: a restart resets it. |
PAY_MCP_FALCON_MODE |
For Falcon mode | -- (off) | Falcon card mode: must be exactly testnet-falcon-card to turn it on. Once any of the five PAY_MCP_FALCON_* below is set, all five must be set and valid, or the standard path answers unpayable (FALCON-CONFIG); it never falls back on the ECDSA account. See below. |
PAY_MCP_FALCON_ACCOUNT_ADDRESS |
For Falcon mode | -- | Falcon mode: the address of the Falcon card account that pays. |
PAY_MCP_FALCON_SIGN_TX_PATH |
For Falcon mode | -- | Falcon mode: absolute path to the card signer binary you were given. |
PAY_MCP_FALCON_SK_PATH |
For Falcon mode | -- | Falcon mode: absolute path to the card's secret key file, mode 0600 or stricter. Read at each signature, never a key in the environment. |
PAY_MCP_FALCON_INTENT_SK_PATH |
For Falcon mode | -- | Falcon mode: absolute path to the ML-DSA intent seed file (64 hex digits), mode 0600 or stricter. Falcon mode pays only the exact-pq offer; an exact-only 402 is unpayable (falcon_requires_exact_pq). |
PAY_MCP_FALCON_MAINNET_CARDS |
For a card on Starknet mainnet | empty (none) | Falcon mode: the cards that may sign on Starknet mainnet, as <0x card address>@<ISO-8601 UTC date> pairs separated by commas, each until its date, e.g. 0x0123...@2026-12-31T00:00:00Z. Empty: no card signs on mainnet. A malformed entry is FALCON-CONFIG, and no card is enabled. |
PAY_MCP_EVM_INTENT_SK_PATH |
For EVM exact-pq |
-- (off) | EVM path: absolute path to an ML-DSA intent seed file (64 hex digits), mode 0600 or stricter. Set, the EVM path pays only the exact-pq offer; an exact-only 402 is unpayable (evm_requires_exact_pq). Use a seed of its own, not the Falcon one. Unset, the EVM path is unchanged. |
PAY_MCP_EVM_KEYSTORE_PATH |
For EVM | -- | EVM path: path to your Web3 Secret Storage v3 keystore (scrypt or pbkdf2, aes-128-ctr). Never a key in the environment. |
PAY_MCP_EVM_PASSWORD_PATH |
For EVM | -- | EVM path: path to the file holding that keystore's password (trailing newline ignored). |
PAY_MCP_EVM_PQ_ACCOUNT |
For an EVM post-quantum account | -- (off) | EVM path, instead of a keystore: the address of your ERC-1271 account whose key is ML-DSA. The authorization's from is that account and its signature is ML-DSA; no ECDSA key is used. Set together with the next two. Setting both an account and a keystore is unpayable (evm_payer_ambiguous). |
PAY_MCP_EVM_PQ_ACCOUNT_SK_PATH |
For an EVM post-quantum account | -- | Absolute path to the account's ML-DSA seed file (64 hex digits), mode 0600 or stricter. Read at each payment, never a key in the environment. |
PAY_MCP_EVM_RPC_URLS |
For an EVM post-quantum account | empty | Comma-separated <CAIP-2>=<https node URL> pairs, e.g. eip155:84532=https://.... Before signing, the server reads the key the account publishes on the offer's network and refuses (evm_pq_account_key_mismatch) if it is not the seed's; a network without a node here is unpayable (evm_pq_account_unverified), nothing signed. |
PAY_MCP_EVM_NETWORKS |
For EVM | empty: with every other EVM policy variable empty too, eip155:84532 only, capped (see Without configuration); otherwise pays nothing |
EVM path: comma-separated CAIP-2 networks this server may pay on, e.g. eip155:84532. |
PAY_MCP_EVM_I_ACCEPT_MAINNET_SPEND |
For a value network | empty | EVM path: comma-separated CAIP-2 value networks you consent to spend real money on, each named, e.g. eip155:8453. Only Base Sepolia (eip155:84532) and Ethereum Sepolia (eip155:11155111) are test networks; every other chain id needs this. |
PAY_MCP_EVM_PAYEES |
For EVM | empty (pays nobody, except under the Base Sepolia default) | EVM path: comma-separated payTo addresses this server may pay. Empty fails closed: a server that paid any payee a 402 names would be a drain. * pays any payee, up to the session cap: avoid it. |
PAY_MCP_EVM_MAX_PER_PAYMENT |
For EVM | none (refuses; 1000000 under the Base Sepolia default) |
EVM path: cap on one payment, in atomic units of the asset (1000000 = 1 USDC, which has 6 decimals). |
PAY_MCP_EVM_MAX_PER_SESSION |
For EVM | none (refuses; 5000000 under the Base Sepolia default) |
EVM path: cap on the total value of the authorizations this server process has signed and handed over, per network and asset, in atomic units. Never credited back, even on a refusal. A restart resets it. |
PAY_MCP_EVM_ASSETS |
No | the network's known USDC | EVM path: comma-separated <CAIP-2>/<token address> entries, e.g. eip155:84532/0x036C.... Without it only USDC is payable, on eip155:84532 and eip155:8453. The caps are in atomic units of whichever asset is paid, so allowing a token with other decimals changes what they mean. |
PAY_MCP_SHIELDED_PROOF_DIR |
For pay_shielded |
-- (reads nothing) | pay_shielded: the one directory, absolute path, that proof_path may read from. No default: unset, every call is refused (proof_dir_unset) and no file is read. Put only proofs in it, never a key. See Files. |
PAY_MCP_WITNESS_DIR |
No | -- (no salt drawn) | pay_shielded: a directory where one fresh purchase salt per shielded payment is kept, one file per transaction (0600, in a 0700 directory, never overwritten), with the payer_pseudonym it was combined with and the value sent. A salt is drawn only when payer_pseudonym is also given, and it never leaves the process: only a value derived from it is sent. Unset: no salt is drawn and the payment is unaffected. |
PAY_MCP_EVM_HTTP_SHARED_KEY |
Only for the HTTP transport | -- | The HTTP transport refuses to start while PAY_MCP_EVM_KEYSTORE_PATH or PAY_MCP_EVM_PQ_ACCOUNT is set: every caller would sign with that one key and share one session budget. Set it to exactly i-accept-a-shared-key-and-budget if a shared payer is what you mean. |
The HTTP transport reads several more, all of them mandatory; it is not the entrypoint you want. See the Install section above.
Files
Which files each tool reads or writes on the machine that runs this server.
No tool takes a file path from the model except proof_path; every other path
below comes from an environment variable you set.
| Tool | Reads | Writes |
|---|---|---|
jcs_hash, request_delegation_grant, verify_receipt, check_merchant, make_payment |
nothing | nothing |
pay_for_resource |
Starknet path, in Falcon card mode only: the files of PAY_MCP_FALCON_SK_PATH and PAY_MCP_FALCON_INTENT_SK_PATH, and it runs the binary of PAY_MCP_FALCON_SIGN_TX_PATH. EVM path: PAY_MCP_EVM_KEYSTORE_PATH and PAY_MCP_EVM_PASSWORD_PATH, or PAY_MCP_EVM_PQ_ACCOUNT_SK_PATH, and PAY_MCP_EVM_INTENT_SK_PATH when set. These files are read to sign and never sent. |
nothing |
pay_shielded |
proof_path, sent to the merchant, read only under the rules below |
with PAY_MCP_WITNESS_DIR and payer_pseudonym, one salt file per payment, <tx_hash>.sel.json, 0600, directly in that directory |
proof_path is the one path the model chooses, and the model reads what
merchants serve, so it is read only when all of this holds, each refusal named
and before any request or salt file:
PAY_MCP_SHIELDED_PROOF_DIRnames an existing directory by an absolute path (proof_dir_unset,proof_dir_unusable). No default.proof_pathis inside it, relative to it or absolute (proof_path_outside_dir), with no..component (proof_path_traversal) and no symbolic link anywhere below that directory, the file included (proof_path_symlink).- It is a regular file (
proof_path_not_a_file,proof_path_unreadable), not empty (proof_file_empty), at most 64 MiB, or 16 MiB gzipped (proof_file_too_large). - Its bytes, gunzipped when the name ends in
.gz(which must then be valid gzip), have the form of a proof file: a JSON document whose root is an object, of at least 1 MiB, with no key material in it (no keystore fields, no PEM block); otherwiseproof_form_invalid. Keys, keystores, passwords and seeds are all far smaller than that, and are never sent.
Keep proofs only in that directory, and keys elsewhere. The salt file is
written only directly in PAY_MCP_WITNESS_DIR.
Standard x402 v2 (pay_for_resource, since 0.7.0)
pay_for_resource also pays the x402 foundation's own wire format. When a 402
carries the foundation's PaymentRequired document (standard base64 of JSON,
x402Version: 2) with an exact offer on starknet:SN_SEPOLIA or
starknet:SN_MAIN, the tool does not look for a proof: the configured account
signs a SNIP-9 outside execution for exactly that transfer (the client half of
@vauban-pay/x402-starknet),
the same GET is retried with PAYMENT-SIGNATURE, and the merchant's
facilitator settles it and pays the gas. Any merchant built with the
foundation's middleware and the merchant half of that package is payable this
way; so is https://demo.pay.vauban.tech/starknet/v1/quote.
What a paid outcome then carries: the content, the facilitator's receipt
(transaction, network, payer), standard{scheme, network, payTo, amount, asset, payer, feePayer}, and an honesty note: value moved from THIS agent's
account, no STARK proof was verified on this path, and the transaction is not
believed until it is read back from a Starknet node.
A fifth outcome, unpayable, is a fact about this server and never about the
merchant: no signer configured, a token other than STRK that
PAY_MCP_STANDARD_X402_ASSETS does not list (code starknet_asset_not_allowed),
payee not in PAY_MCP_STANDARD_X402_PAYEES (empty fails closed), amount above
PAY_MCP_STANDARD_X402_MAX_WEI, or no Starknet offer among the accepts.
A sixth outcome, indeterminate, comes AFTER the signature: the signed
authorization was presented and the answer is neither 200 nor 402 (an HTTP
502, say), or no answer came. The facilitator may have settled. It carries
do_not_repay: true, authorization_outstanding: true, execute_before
(Unix seconds) and an instruction: do not pay again before checking the
account's nonce on a Starknet node; the authorization stays executable by the
offer's feePayer until execute_before. Same on exact-pq. Until 0.11.0
this case was unreachable.
Falcon card mode
The account behind the standard Starknet path can be a Falcon card
account instead of an ECDSA account whose key sits in the environment. Set the five PAY_MCP_FALCON_* variables of the table
above, and PAY_MCP_FALCON_MAINNET_CARDS for a card that pays on Starknet
mainnet. The ECDSA account (PAY_MCP_STANDARD_X402_*) stays the default; this
mode is on only when PAY_MCP_FALCON_MODE holds its exact phrase.
The token list, the payee list, the per-payment cap, the daily budget (the
same count, for the whole server process) and the chain check of the standard
path apply unchanged, before anything is signed. Every outcome of
the standard path carries signer_label: "falcon-card" in this mode.
Limits:
- Starknet Sepolia, and the listed mainnet cards. On Starknet mainnet, only
the cards
PAY_MCP_FALCON_MAINNET_CARDSlists sign, each until its date (FALCON-TESTNET-ONLYotherwise). - Linux only (
FALCON-LINUX-ONLYelsewhere). - Payments only. No deploy-account, no declare (
FALCON-INVOKE-ONLY). - Presented is not accepted. Whether the facilitator settles is its
decision; a refusal is reported as
refused, with its reason. exact-pqonly, unless told otherwise. The card paysexact-pq; it paysexact-cctponly withPAY_MCP_EXACT_CCTP_FALCON=1set besidesPAY_MCP_EXACT_CCTP=1(see the table above).
Post-quantum payment intent (exact-pq)
An exact-pq offer is the exact offer plus a payment intent the agent signs
with ML-DSA. It is served on Starknet, Base and Ethereum mainnet.
To pay it, give the agent an intent seed file (64 hex digits, mode 0600,
absolute path), one per rail:
- Starknet:
PAY_MCP_FALCON_INTENT_SK_PATH, in Falcon card mode (above). - Base and Ethereum:
PAY_MCP_EVM_INTENT_SK_PATH, beside your EVM keystore settings (below). Use a seed of its own.
The facilitator accepts an intent only from a key it has registered.
Once a seed is set, that rail
pays only the exact-pq offer: an exact-only 402 is unpayable
(falcon_requires_exact_pq, evm_requires_exact_pq), and nothing is signed.
exact-pq offers are served at https://pay.vauban.tech/x402-mainnet/v1/quote
(Starknet), https://pay.vauban.tech/x402-base-mainnet/v1/quote (Base) and
https://pay.vauban.tech/x402-ethereum-mainnet/v1/quote (Ethereum).
Paying an EVM offer (pay_for_resource, exact / EIP-3009, since 0.9.0)
When the 402 offers exact on an eip155 network (USDC on Base, for
instance), pay_for_resource signs an EIP-3009 transferWithAuthorization
with your own key, retries the same GET with PAYMENT-SIGNATURE (standard
base64 of the JSON payment payload), and the merchant's facilitator broadcasts
it and pays the gas. You never send a transaction; the price you read is the price you pay.
What is signed, exactly: the EIP-712 domain is {name, version} taken from the
offer's extra (never guessed: an offer without them is refused),
chainId from the CAIP-2 network, verifyingContract = the offer's asset.
The authorization is from = your address, to = payTo, value = the
offer's amount, validAfter = 0, validBefore = now + the offer's
maxTimeoutSeconds (300 s at most; an offer whose window would be under 30 s
is refused before anything is signed), and a random 32-byte nonce. The key is
decrypted for that one signature; the buffers this package controls are then
zeroed; JavaScript does not guarantee more (the curve library's internal
integers and the runtime keep copies until garbage collection). This package
never puts the signature in any field of its own output; what a merchant
echoes back in its body or receipt is the merchant's. The paid request goes
over https only (plain http is accepted for 127.0.0.1, localhost and
[::1]), and a redirect is never followed.
Without configuration: Base Sepolia only
With no PAY_MCP_EVM_* policy variable set, on the stdio transport, the
server pays test networks only: eip155:84532 (Base Sepolia, test USDC, no
real value), at most 1 test USDC per payment and 5 per session, to the
offer's payTo. The key is created in ~/.vauban-pay at the first EVM
payment (never at startup, so a Starknet-only user sees no change), and when
its balance does not cover the offer the server asks our test USDC route for
funds; if it cannot, the refusal gives the address to fund. Writing any one
of PAY_MCP_EVM_NETWORKS, PAY_MCP_EVM_PAYEES, PAY_MCP_EVM_MAX_PER_PAYMENT,
PAY_MCP_EVM_MAX_PER_SESSION, PAY_MCP_EVM_ASSETS or
PAY_MCP_EVM_I_ACCEPT_MAINNET_SPEND turns this off: the policy is then yours,
as below. No value network is ever paid by default.
Configure it
The key lives in an encrypted keystore, named by path, with its password in a separate file. Any tool that writes a Web3 Secret Storage v3 keystore will do. Once a policy variable is written, nothing is payable until you name the network, the payees, both caps, and for a value network the network again in a separate consent:
{
"mcpServers": {
"vauban-pay": {
"command": "npx",
"args": ["-y", "@vauban-pay/mcp"],
"env": {
"PAY_MCP_EVM_KEYSTORE_PATH": "/home/you/.keys/payer.json",
"PAY_MCP_EVM_PASSWORD_PATH": "/home/you/.keys/payer.password",
"PAY_MCP_EVM_NETWORKS": "eip155:84532",
"PAY_MCP_EVM_PAYEES": "0x<the merchant's payTo>",
"PAY_MCP_EVM_MAX_PER_PAYMENT": "1000000",
"PAY_MCP_EVM_MAX_PER_SESSION": "5000000"
}
}
}
}
That pays at most 1 USDC per payment and 5 USDC per session, on Base Sepolia
only, to that one payee (* pays any payee; use it only with a key you are
ready to see drained up to the session cap: avoid it). To pay on Base mainnet you add eip155:8453 to PAY_MCP_EVM_NETWORKS
and set PAY_MCP_EVM_I_ACCEPT_MAINNET_SPEND=eip155:8453: the consent names
the network, so a configuration copied to another chain does not silently open
it. Keep the keystore and password files readable by you only (chmod 600).
The session budget is per server process. Run the EVM payer on the stdio
transport (npx @vauban-pay/mcp), one process per client. The HTTP transport
serves every caller from one process, so they would all sign with your key and
share one budget: it refuses to start with a keystore configured unless
PAY_MCP_EVM_HTTP_SHARED_KEY says, in full, that this is what you want.
Then ask your agent:
Use
pay_for_resourceonhttps://merchant.example/v1/quote.
When a 402 offers both a Starknet and an EVM offer, Starknet is the reference:
the Starknet offer is taken when a Starknet signer is configured, the EVM one
when only an EVM payer is set (PAY_MCP_EVM_KEYSTORE_PATH, or the post-quantum
account PAY_MCP_EVM_PQ_ACCOUNT) or when there is no Starknet offer.
Pass network (for instance "network": "eip155:84532") to choose yourself.
What comes back
paid: the resource, the facilitator's receipt as it said it (success,transaction,network,errorReason,payer),evm{network, chainId, asset, payTo, amount, payer, nonce, validBefore}, and an honesty note: the transaction is established once you read it back from a node of that network.refused: the facilitator said no and named no transaction (for instanceinvalid_exact_evm_insufficient_balance). The merchant says nothing was broadcast; the signed authorization it received stays spendable untilvalid_before, so the amount stays counted against the session budget and the result carriesauthorization_outstanding: true. Do not re-sign blindly.unpayable: this server will not pay this offer, with acodenaming why (evm_network_not_allowed,evm_mainnet_not_opted_in,evm_payee_not_allowed,evm_over_payment_cap,evm_over_session_cap,evm_cap_not_configured,evm_asset_not_allowed,evm_domain_missing,evm_timeout_too_short,evm_insecure_url,evm_no_key,evm_key_unavailable...). Every EVM exact offer of the 402 is examined and the payable one with the smallest atomic amount is taken, whatever the merchant's order (at equal amounts, the earliest in that order); comparing atomic amounts is only meaningful between tokens with the same decimals, which is why the payable asset is bounded. When none is payable,rejectedlists why for each. Nothing was signed or sent.indeterminate: the signed authorization was presented and the answer does not say whether money moved: an HTTP 502,settlement_pending, a refusal that names a transaction, a 200 without a receipt, a receipt saying success for another network, a malformed transaction hash or another payer, a redirect, a lost answer, or any other answer that is not a readable refusal (a fresh 402 included). It carriesdo_not_repay: true, the transaction hash when there is one, thenonceandvalidBefore. Do not pay again: check the transaction, orauthorizationState(from, nonce)on the token contract. The amount stays counted against the session budget.
Paying privately on Starknet (pay_shielded, since 0.8.0)
pay_shielded pays a resource whose facilitator answers 402 with a
conforming x402 v2 document whose offer carries the scheme
vauban-shielded-strk20. It reads the offer, builds the settlement header,
streams the proof, and hands back the receipt.
It reads the proof from your disk, so it reads nothing until you name the one
directory it may read from: set PAY_MCP_SHIELDED_PROOF_DIR (see
Files).
Every value below is a placeholder, not a real transaction:
{
"url": "https://merchant.example/x402/v1/quote",
"proof_path": "proof.json",
"settlement": {
"pool_address": "0x<the STRK20 pool contract>",
"tx_hash": "0x<your pool transaction>",
"block_number": 1234567,
"note_id": "0x<the note that transaction created>"
},
"amount_commitment": "0x<the commitment>"
}
The header it builds is
X-VAUBAN-SHIELDED-SETTLEMENT: vzk20-v2.<base64url(json)>, carrying the pool
coordinates and the commitment.
What is done
- Starknet Sepolia only. An offer on any other network is refused before
any proof is sent (
unpayable, codenetwork_not_supported). - The offer is read, and refused by name when it is not payable: no shielded
entry in
accepts[], noextra.amountIsCeiling: true(that flag is the only thing separating "the amount to pay" from "the published bound", and a client that assumed the bound would be reading a price and calling it privacy), an offer binding somebody else's commitment, or an offer missing a field. - The proof:
proof_path, a proof file you hold, read from your disk and sent as given. It is read only insidePAY_MCP_SHIELDED_PROOF_DIR, and only when it has the form of a proof; every refusal is named and comes before any request (see Files). The offer says which proof it wants (extra.proof); an offer that asks for another form is refused before any upload (unpayable, codeproof_form_mismatch). - The proof is capped before it is read (64 MiB, 16 MiB gzipped), read once, checked, and the bytes checked are the bytes sent.
settlement.tx_hashmust be a 0x-hex hash (1 to 64 hex digits), or the call is refused (settlement_tx_hash_malformed).- The witness (
amount+blinding_hex) is optional and never leaves the process: it is used to check that it opens the commitment, that the amount is strictly under the published ceiling, and that neither number appears in the receipt served back. It is never sent, never returned, never logged. Passamount_commitmentalone and the witness never reaches this tool at all. A blinding shorter than 128 bits, or one byte repeated, is refused before any request (unpayable, codeweak_blinding): draw 31 random bytes. - A replay is a named refusal (
replayed_settlement): one value leg is one payment. - The purchase salt (optional): with
PAY_MCP_WITNESS_DIRset andpayer_pseudonymgiven (the pseudonym your proof publishes), one fresh salt is drawn per purchase and kept in a 0600 file with that pseudonym. The salt itself never leaves the process: only a value derived from it goes in the header. Keep that file: a merchant that supports it may ask for it to match this purchase to you. Without either, nothing is drawn and the header is byte-identical to before.
Scope
- What private means here. The payer can stay out of the payment transaction when another account submits it, inside one STRK20 pool. Without a relay, the payer submits it and is its public sender. It is not anonymity.
- The witness is yours to keep. Lose it and the receipt can no longer be checked. This tool does not hold it.
- The binding to the pool is the facilitator's verdict. This client asserts
coordinates and is believed or refused; the tool reports what it could
establish from the receipt as
verification.pool_binding_established.
make_payment, two modes
Sponsored mode (the default: no signer env vars). make_payment builds the
DelegationGrant object, JCS-hashes it, and POSTs it to the sponsor
(PAY_MCP_SPONSOR_URL, default
https://demo.pay.vauban.tech/sponsor/v1/sponsor/settle). The sponsor settles a
real, value-carrying STRK transfer on Starknet Sepolia, which it funds, to a
payee it fixes (a funded demo, not a faucet). You get back the transaction hash
and a Voyager link, and you can read the transfer back from any Sepolia node.
This mode makes a network call and moves testnet value: do not treat it as an
offline or CI-safe call. An unreachable or refusing sponsor is reported as
such, and nothing settles.
Signer mode (PAY_MCP_SEPOLIA_ACCOUNT_ADDRESS and
PAY_MCP_SEPOLIA_PRIVATE_KEY both set):
make_paymentbuilds the DelegationGrant object, JCS-hashes it, then callsemit_receiptonPaymentDemoEmitterat0x044dd87a94a801cf775d4c5e4b6703102d4e97e1cd1d0a8879341219ae4f19fffrom your account.- Returns
status: "submitted"withtx_hash,voyager_url,settlement_receipt, andreceipt_jcs_hash. - The Voyager link (
https://sepolia.voyager.online/tx/<hash>) can be opened to verify thePaymentReceiptEmittedevent on-chain.
That transaction records a receipt hash and moves no value: it is not proof of a settled payment. The account must hold testnet STRK to pay for the transaction's gas. Obtain it from the upstream Sepolia faucet.
verify_receipt modes
Three modes, chosen by the arguments you give. Each one says what it checked, and nothing more.
Hash mode: receipt + expected_hash.
{
"receipt": { "type": "SettlementReceipt", "amount": 5000, "currency": "USDC" },
"expected_hash": "sha256:abcdef..."
}
Canonicalizes the receipt (JCS, RFC 8785), hashes it with SHA-256, and returns
{ valid, computed_hash, match }. Nothing else about the receipt is checked.
Note-receipt mode: receipt alone, whose variant is
payment-committed-note-v1. Recomputes note_receipt_hash from the ten cells
in note_cells and checks that the fields repeating a cell agree with it. It
says only that the receipt is consistent with itself: not that a proof was
verified, not that the pool note exists on chain, and nothing about the amount,
which no cell carries.
Chain mode: tx_hash.
{ "tx_hash": "0x<starknet_tx_hash>" }
Reads the transaction through the node at STARKNET_RPC_URL, on Starknet
mainnet or Starknet Sepolia, whichever that node serves. The tool first asks
the node its starknet_chainId, and the result says what it answered:
| Node's chain id | network |
voyager_url |
|---|---|---|
SN_MAIN |
starknet-mainnet |
https://voyager.online/tx/<tx_hash> |
SN_SEPOLIA |
starknet-sepolia |
https://sepolia.voyager.online/tx/<tx_hash> |
| anything else | none: verified: null, status and code unknown_network, the transaction is not read |
none |
The default STARKNET_RPC_URL is a Sepolia node; point it at a mainnet node to
read mainnet. Then, in this order:
- On Sepolia only, a
PaymentReceiptEmittedevent ofPaymentDemoEmitter(a receipt hash, no value moved) returnsreceipt_type: "demo-emit-only",on_chain_event,reconstructed_receiptandcomputed_jcs_hash. - A STRK transfer other than the fee payment returns
verified: true,receipt_type: "starknet-transfer", its amount, sender and recipient. Who funded it is not established. - A reverted transaction returns
verified: falsewith its reason. - A transaction that succeeded but carries neither returns
verified: nullwith status and codenot_a_recognised_payment: it exists and succeeded, and this tool does not read its form, which says nothing against it. - A transaction the node does not see (
not_yet_observable), or a failed read (read_failed), returnsverified: null: not a verdict.
License
PolyForm Shield License 1.0.0. See LICENSE and AUTHORS.
From 0.8.0 on, this package is source-available under PolyForm Shield: it may be used for any purpose except building a competing product. Versions up to 0.7.2 were published under Apache 2.0 and stay under it.
This package ships compiled output only. Its pay_for_resource tool speaks
the x402 payment wire format and checks the STARK receipt as described in the
Vauban IETF Internet-Drafts; that specification is public and independently
implementable.