OpenChainGraph Suite · OCG v0.8.13 · Agent Economy · Cluster ㉓

AP2 x402 Cart Correlation

Note (dated 2026-08-18): a chain composes independent computations performed in an analytical order. No step's output is carried into the next step by the execution model; each step computes from its own declared inputs. The terminal correlation step also takes a SECOND input beyond the CartMandate builder's output: a caller-assembled x402_spend_evidence pack from the separate x402-spend-evidence chain. A caller wires both inputs into the correlation call itself.

Builds an illustrative AP2 CartMandate whose credentialSubject carries a deterministic keccak256 hash-chain over its ordered cart line items, then checks whether that CartMandate's total and merchant plausibly correlate with a caller-supplied x402_spend_evidence pack. Google has not shipped an AP2-compatible x402 extension: no field or code path here implies a cryptographic binding between the two artifacts. The terminal step's verdict is CORRELATION_STATUS (CORRELATED / NOT_CORRELATED / INDETERMINATE): a plausibility check over two independently-produced artifacts, never proof they describe the same transaction.

OpenChainGraph · 2 Steps compliance control · Linear Hash-Anchored §4 chain_depth:2 Client-Side · Zero PII
CORRELATION, NOT VERIFICATION. This chain never cryptographically binds an AP2 CartMandate to an x402 authorization: no signature, hash, or on-chain reference ties one specific artifact to the other. A party could present a valid CartMandate alongside an unrelated valid x402 authorization and the terminal step would still report CORRELATED. Every input is caller-supplied: zero network calls, never a facilitator, proxy, gateway, or settlement relay.
Chain Topology (linear, one external input): CartMandate Hash-Chain Builder → Cart↔x402 Correlation Check (+ x402_spend_evidence)
§4 Execution Hash · Chain Definition Anchor
execution_hash:computing…
Chain Stages · 2 Steps · Linear (no decision gates)
1 ROOT node
AP2 CartMandate Hash-Chain Builder art-595-ap2-cartmandate-hashchain-builder
cart_root, cart_items, and merchant are the CartMandate fields the correlation step checks against a caller-supplied x402_spend_evidence pack.
MCP Call · build_ap2_cartmandate_hashchain
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "build_ap2_cartmandate_hashchain",
    "arguments": {
      "agent_id": "did:example:agent-001",
      "subject": "did:example:user-042",
      "merchant": "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667",
      "stage": "open",
      "cart_items": [
        { "sku": "SKU-100", "description": "Widget", "quantity": 2, "unit_price": 9.99, "currency": "USD" },
        { "sku": "SKU-200", "description": "Gadget", "quantity": 1, "unit_price": 24.5, "currency": "USD" }
      ]
    }
  },
  "id": 1
}
2 TERMINAL node
🔗 second input: x402_spend_evidence pack (from the x402-spend-evidence chain)
AP2 x402 Cart Correlation art-596-ap2-x402-cart-correlation
independently re-derives cart_chain_intact from cart_items and cart_root, then checks the cart total and merchant against the x402_spend_evidence pack's authorization.value and authorization.to, reporting CORRELATION_STATUS.
MCP Call · correlate_ap2_cartmandate_x402
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "correlate_ap2_cartmandate_x402",
    "arguments": {
      "cart_root": "0x2eeb01a35e5facd325ab3b60ba97fe4d26222584419fdf93106d3ca3575729fb",
      "cart_items": [
        { "sku": "SKU-100", "description": "Widget", "quantity": 2, "unit_price": 9.99, "currency": "USD" },
        { "sku": "SKU-200", "description": "Gadget", "quantity": 1, "unit_price": 24.5, "currency": "USD" }
      ],
      "merchant": "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667",
      "x402_spend_evidence": {
        "authorization": {
          "from": "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667",
          "to": "0x2a1530c4c41db0b0b2bb646cb5eb1a67b7158667",
          "value": "44.480000000000004",
          "validAfter": "0",
          "validBefore": "2000000000",
          "nonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
        },
        "digest": "0xb68e5d60d6169bad9739d30399af8f8c7378d464d25f4d971911ab65ef0b014b",
        "verdict": "AUTHORIZATION_VALID",
        "disclosure": "ev"
      }
    }
  },
  "id": 2
}
Illustrative correlation_status · §8 field shape
A worked composition of the two steps' fields above into the terminal step's output_payload shape. This preview is a static illustration reproduced from the kernel's own golden fixture vector (correlated-chain-intact-total-match-merchant-match); a caller assembles the live object itself from its two actual tool responses; the chain execution model does not pipe one step's output into the next (see the note above).
{
  "correlation_status": "CORRELATED",
  "cart_total_matches_authorization_value": true,
  "merchant_matches_authorization_to": true,
  "cart_chain_intact": true,
  "disclosure": "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.",
  "reasons": []
}
Export Chain Artifact
Download the §4 chain definition artifact (hash-anchored JSON). The artifact encodes the complete chain definition. Available after hash computation.