{
  "version": "2.0",
  "publisher": {
    "name": "區塊勢",
    "url": "https://blocktrend.substack.com",
    "contact": "contact@blocktrend.today"
  },
  "protocol": {
    "name": "x402",
    "version": 2,
    "facilitator": "https://api.cdp.coinbase.com/platform/v2/x402"
  },
  "default_permission": "payment_required",
  "pricing": {
    "single_article": {
      "amount": "0.02",
      "currency": "USDC",
      "decimals": 6,
      "network": {
        "name": "Base",
        "chain_id": 8453,
        "rpc": "https://mainnet.base.org",
        "caip2": "eip155:8453"
      },
      "asset": {
        "symbol": "USDC",
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "name": "USD Coin"
      }
    },
    "bulk_access": {
      "type": "contact",
      "email": "contact@blocktrend.today",
      "description": "批量授權請聯繫我們討論定價"
    }
  },
  "allowed_purposes": [
    "research",
    "education",
    "commercial_with_license",
    "ai_training_with_license"
  ],
  "restrictions": [
    "no_redistribution_without_license",
    "no_derivative_works_without_license",
    "attribution_required"
  ],
  "endpoints": {
    "article_list": "/functions/v1/x402Article/list",
    "article_content": "/functions/v1/x402Article?articleId={id}",
    "license_certificate": "/functions/v1/x402Certificate?articleId={id}&wallet={wallet}"
  },
  "receipt": {
    "description": "Upon successful payment, a Receipt NFT is minted on Numbers Protocol as proof of authorization.",
    "nft": {
      "network": "Numbers Protocol",
      "contract": "0x0C8C81D6954db5bF8c49D58Cb81340E023D6f530",
      "explorer": "https://mainnet.num.network",
      "verify_url_template": "https://verify.numbersprotocol.io/asset-profile?nid={nid}"
    },
    "certificate": {
      "format": ["html", "json"],
      "endpoint": "/functions/v1/x402Certificate?articleId={id}&wallet={wallet}&format={format}"
    }
  },
  "agent_instructions": {
    "description": "This publication uses the x402 protocol (version 2) for content access. AI agents can discover articles via the list endpoint and pay for content using the standard x402 payment flow. Upon successful payment, agents receive a Receipt NFT and can download a license certificate.",
    "flow": [
      "1. Discover articles via GET /functions/v1/x402Article/list",
      "2. Request article via GET /functions/v1/x402Article?articleId={id}",
      "3. Receive HTTP 402 with X-Payment-Required header containing Base64-encoded PaymentRequirements",
      "4. Sign EIP-3009 TransferWithAuthorization for the specified amount",
      "5. Retry request with X-Payment header containing Base64-encoded payment payload",
      "6. Receive HTTP 200 with full article content, Receipt NFT info, and certificate URL in response"
    ],
    "headers": {
      "payment_request": "X-Payment-Required",
      "payment_signature": "X-Payment",
      "payment_response": "X-Payment-Response"
    },
    "response_schema": {
      "article": "Full article content",
      "payment": {
        "amount": "Payment amount in USDC",
        "txHash": "Base transaction hash"
      },
      "receipt": {
        "nft": {
          "tokenId": "Numbers Protocol NID",
          "verifyUrl": "URL to verify the NFT on Numbers Protocol"
        },
        "certificate": {
          "url": "URL to download the license certificate"
        }
      }
    },
    "example": {
      "list_endpoint": "/functions/v1/x402Article/list",
      "article_endpoint": "/functions/v1/x402Article?articleId=731",
      "certificate_endpoint": "/functions/v1/x402Certificate?articleId=731&wallet=0x..."
    }
  },
  "x402_config": {
    "version": 2,
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "timeout_seconds": 300
  }
}
