OpenChainGraph Suite · ART-596 · AP2 / x402 Agent Commerce Correlation

AP2 x402 Cart Correlation

Correlates a built AP2 CartMandate (ART-595: cart_root, cart_items, merchant) against an x402_spend_evidence pack (assembled from the x402-spend-evidence chain): does the cart total (sum(quantity×unit_price) per currency), converted to the token's atomic units with the required token_decimals, equal authorization.value exactly; does merchant map to authorization.to. The cart hash-chain is independently re-verified here, never trusted from the CartMandate's own self-reported flag.

AP2 ↔ x402keccak256 + RFC 8785 canon (vendored, no hand-rolled crypto)Correlation, not verification
🔒 All inputs are processed locally in your browser. No data is transmitted. Do not enter real personal data — use synthetic or anonymised inputs only.
What This Does and Does Not Prove

Google has not shipped an AP2-compatible x402 extension. No kernel anywhere in this repo, and no published AP2 spec text, defines a cryptographic binding between an AP2 mandate and an x402 payment authorization. This tool observes that the cart total and merchant identity are consistent with the x402 authorization's amount and recipient. It does not cryptographically bind the two: no signature, hash, or on-chain reference ties this specific CartMandate to this specific x402 authorization. A party could present a valid CartMandate alongside an unrelated valid x402 authorization and this check would still report CORRELATED.

CartMandate Fields
Leave cart_root blank and use "Fill Worked Example" below to see a fully CORRELATED run.
Non-empty ordered array. Each item needs sku, description, quantity (positive number), unit_price (non-negative number), currency.
Required, 0–18. An EIP-3009 value is denominated in the token's atomic base units, so the cart total is converted with this exponent and the two sides are compared as exact integers. Without it a correct 1 USDC payment (value "1000000") against a 1.00 cart reads as a mismatch.
x402 Spend Evidence
Only authorization.to and authorization.value are read by this correlation check, and value must be a non-negative integer in the token's atomic units (a decimal figure is reported as indeterminate, never rounded). The rest of the pack (digest, domain checks, signer recovery) is the x402-spend-evidence chain's own concern, echoed here for reference only.
Checks
cart_chain_intact (independently re-derived)
cart_total_matches_authorization_value
cart_total_atomic
authorization_value_atomic
merchant_matches_authorization_to
Disclosure

Execution Hash (SHA-256)