{
  "version": "1.1.0",
  "scheme": "tx-hash",
  "network": "testnet",
  "chain": {
    "name": "MultiversX",
    "chainId": "T",
    "apiUrl": "https://testnet-api.multiversx.com",
    "explorerUrl": "https://testnet-explorer.multiversx.com"
  },
  "chains_supported": [
    {
      "chain": "MVX",
      "name": "MultiversX",
      "chainId": "T",
      "apiUrl": "https://testnet-api.multiversx.com",
      "explorerUrl": "https://testnet-explorer.multiversx.com",
      "native_token": "EGLD",
      "verifier": "observer-tx"
    },
    {
      "chain": "BASE",
      "name": "Base Sepolia",
      "chainId": "84532",
      "apiUrl": "https://sepolia.base.org",
      "explorerUrl": "https://sepolia.basescan.org",
      "native_token": "ETH",
      "verifier": "evm-receipt",
      "accepted_erc20": [
        {
          "symbol": "USDC",
          "address": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
          "decimals": 6,
          "note": "Stablecoin. 1 USDC = 1 USD. amount_raw is in 10^-6 USDC."
        }
      ]
    }
  ],
  "flow": {
    "call_endpoint_template": "https://testnet.mcpay.network/mcp/{slug}/{tool}",
    "discovery": {
      "catalog": "https://testnet.mcpay.network/api/catalog",
      "per_mcp_card": "https://testnet.mcpay.network/mcp/{slug}/.card"
    },
    "steps": [
      "POST /mcp/{slug}/{tool} with your input JSON. No auth header.",
      "Receive HTTP 402 with a challenge body matching `challenge_schema`. The body lists multiple chains in `accepts[]`.",
      "Pick whichever entry from `accepts[]` you can pay. MVX entries are native EGLD; BASE entries are ERC-20 transfers (e.g. USDC).",
      "For MVX: broadcast a tx with value=amount_raw, receiver=payto, data=data_tag. For BASE: send an ERC-20 `transfer(payto, amount_raw)` to `token_contract`.",
      "Retry the same POST with header `x-payment: base64(JSON(envelope))`. Set `chain` in the envelope to whichever leg you paid; default is MVX for backward-compat.",
      "Receive 200 with the tool result. Gateway verifies the tx + replay-protects the nonce on a single shared spent-table across chains."
    ],
    "nonce_replay_window_seconds": 3600,
    "clock_skew_seconds": 300
  },
  "accepted_tokens": [
    {
      "chain": "MVX",
      "symbol": "EGLD",
      "decimals": 18,
      "kind": "native",
      "note": "Native MVX token. amount_raw is wei (10^-18 EGLD)."
    },
    {
      "chain": "BASE",
      "symbol": "USDC",
      "decimals": 6,
      "kind": "erc20",
      "contract": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
      "note": "ERC-20 transfer to the receiving address. amount_raw is in 10^-6 USDC."
    }
  ],
  "data_tag_format": "mcpay:x402:<nonce>",
  "challenge_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "price",
      "currency_base",
      "accepts",
      "nonce",
      "expires_at",
      "data_tag"
    ],
    "additionalProperties": false,
    "properties": {
      "price": {
        "type": "string",
        "description": "Decimal USD price, e.g. \"0.0008\"."
      },
      "currency_base": {
        "const": "USD"
      },
      "accepts": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "object",
          "required": [
            "chain",
            "token",
            "payto",
            "amount_raw"
          ],
          "additionalProperties": true,
          "properties": {
            "chain": {
              "type": "string",
              "enum": [
                "MVX",
                "BASE"
              ],
              "description": "Which chain this leg targets."
            },
            "token": {
              "type": "string",
              "description": "e.g. \"EGLD\" on MVX, \"USDC\" on BASE."
            },
            "payto": {
              "type": "string",
              "description": "Recipient address. erd1 bech32 for MVX; 0x-hex for BASE / EVM."
            },
            "amount_raw": {
              "type": "string",
              "pattern": "^[0-9]+$",
              "description": "Integer string. For MVX/EGLD: wei (1e-18). For BASE/USDC: 1e-6."
            },
            "rate_x10k_per_unit": {
              "type": "number",
              "description": "Informational — USD × 10^4 per 1 whole token unit."
            },
            "token_contract": {
              "type": "string",
              "description": "EVM ERC-20 contract address. Present only when chain is non-MVX."
            }
          }
        }
      },
      "nonce": {
        "type": "string",
        "description": "UUID or similar."
      },
      "expires_at": {
        "type": "integer",
        "description": "Unix seconds."
      },
      "mcp": {
        "type": "string"
      },
      "tool": {
        "type": "string"
      },
      "data_tag": {
        "type": "string",
        "description": "For MVX: exactly what the agent must put in tx.data (UTF-8). Format: \"mcpay:x402:<nonce>\". For BASE/EVM: ignored — replay protection comes from the (nonce, tx_hash) pair.",
        "pattern": "^mcpay:x402:[^:]+$"
      }
    }
  },
  "envelope_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "tx_hash",
      "nonce",
      "from"
    ],
    "additionalProperties": false,
    "properties": {
      "tx_hash": {
        "type": "string",
        "oneOf": [
          {
            "pattern": "^[0-9a-f]{64}$",
            "description": "MVX tx hash (bare 64-hex)."
          },
          {
            "pattern": "^0x[0-9a-f]{64}$",
            "description": "EVM tx hash (0x-prefixed 64-hex)."
          }
        ]
      },
      "nonce": {
        "type": "string",
        "description": "Must match the challenge nonce."
      },
      "from": {
        "type": "string",
        "description": "Informational — payer's wallet. Authority comes from the on-chain tx.sender, not this field."
      },
      "chain": {
        "type": "string",
        "enum": [
          "MVX",
          "BASE"
        ],
        "description": "Which chain the tx_hash is on. Defaults to 'MVX' for backward-compat."
      }
    }
  },
  "example": {
    "challenge": {
      "price": "0.0008",
      "currency_base": "USD",
      "accepts": [
        {
          "chain": "MVX",
          "token": "EGLD",
          "payto": "erd1qqqqqqqqqqqqqpgqdemo…",
          "amount_raw": "32000000000000",
          "rate_x10k_per_unit": 250000
        },
        {
          "chain": "BASE",
          "token": "USDC",
          "payto": "0x6ea64a8036b6873e425c739720c6911473e1ff3f",
          "amount_raw": "800",
          "rate_x10k_per_unit": 10000,
          "token_contract": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
        }
      ],
      "nonce": "f3cc5e68-…",
      "expires_at": 1776940800,
      "mcp": "mvx-chain-data",
      "tool": "getBlockHeight",
      "data_tag": "mcpay:x402:f3cc5e68-…"
    },
    "envelope_mvx": {
      "tx_hash": "060145dff00884cebe5773739c7d72828624ef4cab266b65d16978a4991276be",
      "nonce": "f3cc5e68-…",
      "from": "erd1rdzvn6aa…",
      "chain": "MVX"
    },
    "envelope_base": {
      "tx_hash": "0xabc1234567890def1234567890abcdef1234567890abcdef1234567890abcdef",
      "nonce": "f3cc5e68-…",
      "from": "0x3784264056c31a05fa84dff53c6a9846424ca0c1",
      "chain": "BASE"
    }
  },
  "links": [
    {
      "rel": "catalog",
      "href": "https://testnet.mcpay.network/api/catalog"
    },
    {
      "rel": "agent-skills-index",
      "href": "https://testnet.mcpay.network/.well-known/agent-skills/index.json"
    },
    {
      "rel": "mcp-server-card",
      "href": "https://testnet.mcpay.network/.well-known/mcp/server-card.json"
    },
    {
      "rel": "mcpay-manifest",
      "href": "https://testnet.mcpay.network/.well-known/mcpay.json"
    },
    {
      "rel": "openapi",
      "href": "https://testnet.mcpay.network/api/openapi.json"
    },
    {
      "rel": "llm-summary",
      "href": "https://testnet.mcpay.network/llms.txt"
    }
  ]
}