{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vaultfire.example/schemas/x402-v2-onchain-payee-scan.schema.json",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema", "scope", "activation", "source", "paymentRail",
    "externalPayerFilter", "externalPayments", "externalPaymentCount",
    "externalAmountAtomic", "notProven", "nextStep"
  ],
  "properties": {
    "schema": { "const": "vaultfire.x402.v2-onchain-payee-scan.v1" },
    "scope": { "const": "owner-provided-raw-log-summary-onchain-only" },
    "activation": { "const": "fail-closed-no-route-or-request-receipt-correlation" },
    "source": { "type": "object" },
    "paymentRail": {
      "type": "object",
      "required": ["network", "chainId", "asset", "payee", "eventTopic0"],
      "properties": {
        "network": { "const": "eip155:8453" },
        "chainId": { "const": 8453 },
        "asset": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" },
        "payee": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" },
        "eventTopic0": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" }
      }
    },
    "externalPayerFilter": { "type": "array", "minItems": 1 },
    "externalPayments": { "type": "array" },
    "externalPaymentCount": { "type": "integer", "minimum": 0 },
    "externalAmountAtomic": { "type": "string", "pattern": "^[0-9]+$" },
    "notProven": { "type": "array", "minItems": 1 },
    "nextStep": { "type": "string", "minLength": 1 }
  }
}
