OpenChainGraph · Explainer

Art 781 X402 Svm Payment Outcome

An x402 exact-scheme payment on Solana, recomputed clause by clause against two pinned readers: the scheme specification and the reference facilitator code, both frozen at x402-foundation/x402 commit e4a086819f419e9395acbbdc1679fe6627029ff7. Where the two readers disagree, the clause returns DIVERGES instead of a pass.

Presenter mode shows one step per screen. Arrow keys move, A toggles autoplay, Esc exits.
1
Step 1

The verdict table and its pasted inputs

The caller pastes the decoded instruction list, the PaymentRequirements, the mint configuration and optional Ed25519 signature checks. Every clause answers three questions: what does the spec accept, what does the reference code accept, and where do they split.

decoded instructionsPaymentRequirementsmint fee config recomputevalues only verdict table, one row per clausePASSFAILDIVERGES: spec and code disagree

Clauses: the amount rule, the single matching transfer, the destination associated token account, fee payer isolation, the net amount on a transfer-fee mint, the memo rule, transaction-version admission, and optional signature checks. The kernel reads nothing on-chain, calls no facilitator and looks up no balance; everything is recomputed from pasted bytes. Splits (extra.splits) are refused for this version rather than mis-judged, and inner (CPI) instructions are matched only when the caller pastes them, so a smart-wallet payment without its inner instructions reports zero matches instead of a verdict the bytes cannot support. Two guard rules sit beside the spec text, which sets no verifier rule for them because the token program enforces both on chain: the matched transfer decimals must equal the declared mint decimals, and its token program must equal the mint's declared token program, otherwise the node refuses with TRANSFER_DECIMALS_MISMATCH or TOKEN_PROGRAM_MISMATCH. An extra non-matching transfer beside one correct match does not change the verdict, since section 1.4 rejects only more than one matching transfer, but section 3.1 Path 1 allows a single top-level TransferChecked when there are no splits, so the node raises EXTRA_TOKEN_TRANSFER_PRESENT and reports transfer_checked_count. An input the hash canonicalizer cannot serialize (a nesting or element-count limit, a non-finite number, an integer beyond the safe range, or a BigInt) never throws: the node mints the artifact with a null execution_hash beside a hash_refusal that names the path and kind, so the hostile shape is reported rather than crashing the run.

Who asks at this stepMCP
Run the AINumbers MCP tool `verify_x402_svm_outcome` with policy_parameters {"requirements":{"asset":"GqD4CyuJhggoXpnhzK14cjgQKg3o3C2u5itsVREXrXsv","amount":"1000000","pay_to":"EuhMhFpWGKHenUBZsehZ4QPb3W7yEp6XEH1fgXK5Lprw","extra":{"fee_payer":"3m8q4EK2PRBFQSZrpnqB7xFAn5ovhhxYG6kCUwjhe4xF"}},"transaction":{"version":0,"instructions":[{"kind":"transfer_checked","token_program":"token-2022","source":"AgkwPo8kExfn2LE16knS9E4cGnLNTr4JndynqiEy3eKD","mint":"GqD4CyuJhggoXpnhzK14cjgQKg3o3C2u5itsVREXrXsv","destination":"H6Rg1aU5iPZoMBp6iZg4wquRGCaqARBZHmcxaEk8zCu2","authority":"EuhMhFpWGKHenUBZsehZ4QPb3W7yEp6XEH1fgXK5Lprw","amount":"1000000","decimals":6}]},"mint":{"token_program":"token-2022","decimals":6}} and read the verdicts array.
2
Step 2

The same overpayment passes one reader and fails the other

The spec outcome definition accepts any transfer of at least the required amount and tolerates overpayment. The static verification path rejects any amount that is not exactly equal.

required 1,000,000paid 1,200,000 spec 1.4: at least required, MAY exceed scheme.ts L1160: amount !== required, reject amount_rule: DIVERGESsmart-wallet paths accept (L662, L777)

Pinned at specs/schemes/exact/scheme_exact_svm.md in the x402 repo at the commit above: section 1.1 asks for a transfer of at least the required amount and section 1.4 says a matching transfer MAY exceed it and MUST NOT be less. The reference facilitator disagrees with itself in the other direction: the static path rejects any inequality (scheme.ts L1160), while the smart-wallet paths accept gross amounts greater or equal (smartWalletVerification.ts L657-662 and L727-781) and the balance-delta fallback accepts net deltas greater or equal (L795-803, L837-844). An underpaid transfer fails every reading; an exact amount passes every reading; an overpayment returns DIVERGES with both readings quoted.

Who asks at this stepMCP
Same tool, change the instruction amount to "1200000" and compare the amount_rule row: spec_reading says at least, reference_reading says exact, verdict DIVERGES.
3
Step 3

On a transfer-fee mint, the same payment nets less than it grosses

Token-2022 transfer fees are withheld at arrival. The static path compares the gross instruction amount; the balance-delta readers compare what actually landed. One payment can pass one and fail the other.

gross 1,000,000100 bps, cap 500 withheld min(ceil(g*bps/10000), cap)= 500 net received 999,500static reading: PASS (gross equals required)delta reading: below required, DIVERGES

The withheld amount is min(ceil(gross times basis points over 10000), maximum_fee), the Token-2022 arithmetic this estate already ships in its transfer-fee reconciler, copied by hand. The spec text never mentions the transfer-fee extension by name; its balance-delta fallback (section 3.4, L446) compares a net quantity all the same. Two Kora advisories hit exactly this seam, GHSA-725g-w329-g7qr (transfer fee not deducted during payment verification) and GHSA-x442-m7cc-hr92 (unrecognized instruction stubs bypassing fee payer policy); both records carry severity medium and first_patched_version 2.0.5 (vulnerable below 2.0.5), and both are cited as facts, never rated.

Who asks at this stepMCP
Same tool, add mint.transfer_fee {"transfer_fee_basis_points":"100","maximum_fee":"500"} and read net_received: withheld 500, net_amount 999500, and the net clause turns DIVERGES.
4
Step 4

The recipient account depends on the token program

The associated token account derives from wallet, token program id and mint. Derive it under the classic Token program for a Token-2022 mint and you get a different, wrong, account.

wallet + mintseeds, ATA program under token-2022: H6Rg1aU5iPZoMBp6iZg4wquRGCaqARBZHmcxaEk8zCu2 under classic: 5Hc4ETDxeVwT9fiJ5eNPPCmbs6T7se5tvzeHRFQifWpM different accounts:a payment to the classic onenever reaches the declared mint

The derivation is the pinned one this estate already audited as its own node: seeds [wallet, token program id, mint] under the associated-token program, with the canonical bump scan from 255 down to 1 and the off-curve rule. The kernel derives the account under the declared program and under the classic program side by side, so a transfer that pays the classic-program account of a Token-2022 mint is visible as wrong_program_ata rather than a mystery zero-match.

Who asks at this stepMCP
Same tool, set destination to the classic-program ATA 5Hc4ETDxeVwT9fiJ5eNPPCmbs6T7se5tvzeHRFQifWpM for the Token-2022 mint: single_matching_transfer FAIL, destination_ata FAIL, wrong_program_ata true.
5
Step 5

The fee payer is a signature for fees only

The sponsor's fee payer must appear in no instruction account, no authority, no source. And since the June rewrite, the spec itself defines which transaction versions a charge may carry, so the version clause returns pass or fail instead of undefined.

fee payerpays network fees only instruction accountssource, destination, authority fee payer in any account:isolation FAIL (S2.1.1) version 1 admitted when extra.transactionVersions has 1absent field means [0]; strings fail closed (S1.5)

The isolation rule is spec section 2.1.1: the fee payer signs for transaction fees and nothing else, with one bounded exception, it may be the recipient when it equals pay_to. The reference static path checks the narrower fact that its own signers are not the transfer authority, which is why the kernel implements the spec rule account by account and reports the difference as a fact. On versions: the spec now normatively defines transactionVersions (JSON integers 0 and 1, default 0, fail closed on anything else) and the reference reads the wire version before signature work, so spec and code agree here; the earlier stance, that version 1 was spec-undefined, is retired and recorded in the fixture notes.

Who asks at this stepMCP
Same tool, set the transfer authority to the fee_payer address: fee_payer_isolation FAIL with the violating instruction index. Then set transaction.version 1 with extra.transaction_versions [0,1]: the version clause passes; drop the field and it fails closed.
6
Step 6

Manifest & provenance

One input surface, one output contract, one kernel digest, and the whole thing runs offline.

Kernel: chaingraph/kernels/art-781-x402-svm-payment-outcome.kernel.mjs: string equality and BigInt comparisons, vendored SHA-256, vendored Ed25519 decompression and signature verification (verify path only), base58 conversion, and ceiling-division fee arithmetic. Spec pins: x402-foundation/x402 at commit e4a086819f419e9395acbbdc1679fe6627029ff7, scheme_exact_svm.md L5, L150, L166-174, L187-192, L200+ (S1.5), L215, L276-292 (S2.1.1), L410-411, L418-421, L446 (S3.4); reference pins: scheme.ts L359-364, L767-774, L1112-1115, L1160 and smartWalletVerification.ts L657-662, L727-781, L795-803, L837-844; advisories: GHSA-725g-w329-g7qr and GHSA-x442-m7cc-hr92, severity medium on both records, first_patched_version 2.0.5 on both, vulnerable below 2.0.5. Associated-token-account derivation pinned at solana-program/associated-token-account commit 4004274dfb861e09570af873b46cb0b0919e8df0. Fixtures: 27 vectors, expectations stated before the kernel ran; zkVM proof deferred to the next batch.

Who asks at this stepMCP
Run the AINumbers MCP tool `verify_x402_svm_outcome`, then call `verify_execution_hash` on mcp.ainumbers.co with the returned execution_hash to confirm the artifact.
🔒 All inputs are processed locally in your browser. No data is transmitted. Do not enter real personal data — use synthetic or anonymised inputs only.

Ask your agent

Copy this paragraph into Claude, OpenClaw, or any MCP-aware agent to run this exact tool, with this sample, and verify the artifact.

Run the AINumbers MCP tool `verify_x402_svm_outcome`. Task: Recompute, clause by clause, whether a pasted x402 exact-scheme Solana payment met its requirements: the decoded instructions, the PaymentRequirements, the mint token program and optional Token-2022 fee config, and optional Ed25519 checks.
Call it with arguments: {"policy_parameters":{"requirements":{"asset":"GqD4CyuJhggoXpnhzK14cjgQKg3o3C2u5itsVREXrXsv","amount":"1000000","pay_to":"EuhMhFpWGKHenUBZsehZ4QPb3W7yEp6XEH1fgXK5Lprw","extra":{"fee_payer":"3m8q4EK2PRBFQSZrpnqB7xFAn5ovhhxYG6kCUwjhe4xF"}},"transaction":{"version":0,"instructions":[{"kind":"transfer_checked","token_program":"token-2022","source":"AgkwPo8kExfn2LE16knS9E4cGnLNTr4JndynqiEy3eKD","mint":"GqD4CyuJhggoXpnhzK14cjgQKg3o3C2u5itsVREXrXsv","destination":"H6Rg1aU5iPZoMBp6iZg4wquRGCaqARBZHmcxaEk8zCu2","authority":"EuhMhFpWGKHenUBZsehZ4QPb3W7yEp6XEH1fgXK5Lprw","amount":"1000000","decimals":6}]},"mint":{"token_program":"token-2022","decimals":6}}}
Verify before trusting: call `verify_execution_hash` on mcp.ainumbers.co (https://mcp.ainumbers.co/mcp) with the parameter `claimed_hash` set to the returned `execution_hash`, passing the full artifact the run returned (the object containing `policy_parameters` + `output_payload` + `execution_hash`; equivalently `policy_parameters` + `output_payload` with `claimed_hash`), not the bare hash string.
Return the ledger link https://ledger.ainumbers.co/ so a human can re-verify without contacting us.
PII rule: All inputs are processed locally in your browser. No data is transmitted. Do not enter real personal data — use synthetic or anonymised inputs only.
Over MCP, the run happens on the AINumbers worker. No AINumbers server stores your inputs.
Open the tool with the sample prefilled: https://ainumbers.co/chaingraph/art-781-x402-svm-payment-outcome.html#p=v1.H4sIAAAAAAAA_wF4Aof9eyJyZXF1aXJlbWVudHMiOnsiYXNzZXQiOiJHcUQ0Q3l1SmhnZ29YcG5oeksxNGNqZ1FLZzNvM0MydTVpdHNWUkVYclhzdiIsImFtb3VudCI6IjEwMDAwMDAiLCJwYXlfdG8iOiJFdWhNaEZwV0dLSGVuVUJac2VoWjRRUGIzVzd5RXA2WEVIMWZnWEs1THBydyIsImV4dHJhIjp7ImZlZV9wYXllciI6IjNtOHE0RUsyUFJCRlFTWnJwbnFCN3hGQW41b3ZoaHhZRzZrQ1V3amhlNHhGIn19LCJ0cmFuc2FjdGlvbiI6eyJ2ZXJzaW9uIjowLCJpbnN0cnVjdGlvbnMiOlt7ImtpbmQiOiJ0cmFuc2Zlcl9jaGVja2VkIiwidG9rZW5fcHJvZ3JhbSI6InRva2VuLTIwMjIiLCJzb3VyY2UiOiJBZ2t3UG84a0V4Zm4yTEUxNmtuUzlFNGNHbkxOVHI0Sm5keW5xaUV5M2VLRCIsIm1pbnQiOiJHcUQ0Q3l1SmhnZ29YcG5oeksxNGNqZ1FLZzNvM0MydTVpdHNWUkVYclhzdiIsImRlc3RpbmF0aW9uIjoiSDZSZzFhVTVpUFpvTUJwNmlaZzR3cXVSR0NhcUFSQlpIbWN4YUVrOHpDdTIiLCJhdXRob3JpdHkiOiJFdWhNaEZwV0dLSGVuVUJac2VoWjRRUGIzVzd5RXA2WEVIMWZnWEs1THBydyIsImFtb3VudCI6IjEwMDAwMDAiLCJkZWNpbWFscyI6Nn1dfSwibWludCI6eyJ0b2tlbl9wcm9ncmFtIjoidG9rZW4tMjAyMiIsImRlY2ltYWxzIjo2fX2Dq-dGeAIAAA