{
 "openapi": "3.1.0",
 "info": {
  "title": "Blockchain Fraud API",
  "version": "1.0.0",
  "description": "Crypto address screening from Blockchain Fraud (blockchainfraud.org), a crypto fraud investigation service operated by UnyKorn LLC (Wyoming). One paid x402 endpoint (address screen, $0.25 USDC on Base) and one free, rate-limited triage endpoint. Automated signals, not legal advice; a NO_MATCH is not a clearance.",
  "x-guidance": "To screen one crypto address against the OFAC SDN list (as imported) and the Blockchain Fraud scam-address registry, POST /api/x402/screen with JSON {\"address\": \"<address>\"}. An unpaid call returns HTTP 402 with x402 v2 accepts (scheme exact, USDC on Base (eip155:8453), amount 250000 atomic units = $0.25) in the JSON body and the PAYMENT-REQUIRED header. Retry the same POST with a PAYMENT-SIGNATURE header (v1 clients: X-PAYMENT). A paid request whose address format is not recognised is refused before settlement and not charged. Verdict is SANCTIONED, REGISTRY_MATCH or NO_MATCH; NO_MATCH is not a clearance. For free triage of a pasted message, link, address or transaction hash (pattern signals plus a sanctions, scam-list and domain screen), POST /api/check with {\"text\": \"...\"}; it is rate-limited to 40 requests per 10 minutes per IP.",
  "contact": {
   "name": "Blockchain Fraud (UnyKorn LLC)",
   "email": "cases@blockchainfraud.org",
   "url": "https://blockchainfraud.org"
  }
 },
 "servers": [
  {
   "url": "https://blockchainfraud.org"
  }
 ],
 "paths": {
  "/api/x402/screen": {
   "post": {
    "operationId": "screenAddress",
    "summary": "Address screen: OFAC SDN (as imported) + Blockchain Fraud registry + format checks",
    "tags": [
     "Screening"
    ],
    "x-payment-info": {
     "price": {
      "mode": "fixed",
      "currency": "USD",
      "amount": "0.250000"
     },
     "protocols": [
      {
       "x402": {}
      }
     ]
    },
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "address": {
          "type": "string",
          "minLength": 25,
          "maxLength": 65,
          "description": "One crypto address: EVM (0x + 40 hex), Bitcoin (1/3/bc1), Tron (T...), XRPL (r...) or Solana (base58). Extra fields are ignored."
         },
         "chain": {
          "type": "string",
          "maxLength": 20,
          "description": "Optional label echoed back as `chain`; defaults to the detected format. It does not change which lists are checked."
         }
        },
        "required": [
         "address"
        ]
       },
       "example": {
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Screen result (charged)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "false with `error` if the body could not be screened (e.g. invalid_json, address_format)"
          },
          "error": {
           "type": "string"
          },
          "address": {
           "type": "string"
          },
          "format": {
           "type": "string",
           "enum": [
            "evm",
            "bitcoin",
            "tron",
            "xrpl",
            "solana"
           ]
          },
          "chain": {
           "type": "string"
          },
          "verdict": {
           "type": "string",
           "enum": [
            "SANCTIONED",
            "REGISTRY_MATCH",
            "NO_MATCH"
           ]
          },
          "sanctions": {
           "type": [
            "object",
            "null"
           ],
           "description": "On an OFAC SDN match (list as imported): list, program, entity, refreshed."
          },
          "registry": {
           "type": [
            "object",
            "null"
           ],
           "description": "On a Blockchain Fraud registry match: chain, categories, confidence, case_count, sanctioned, first_flagged."
          },
          "note": {
           "type": "string"
          },
          "checked_at": {
           "type": "string",
           "format": "date-time"
          },
          "settlement": {
           "type": "object",
           "description": "x402 settlement for this call: transaction, network."
          }
         },
         "required": [
          "ok"
         ]
        },
        "example": {
         "ok": true,
         "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
         "format": "evm",
         "chain": "evm",
         "verdict": "NO_MATCH",
         "sanctions": null,
         "registry": null,
         "note": "NO_MATCH means not on the OFAC SDN list as imported and not in the Blockchain Fraud registry; it is not a clean bill of health."
        }
       }
      }
     },
     "400": {
      "description": "Paid request with an unrecognised address format: refused before settlement, not charged"
     },
     "402": {
      "description": "Payment Required: x402 v2 challenge (accepts[] with amount and maxAmountRequired, top-level resource) in the JSON body and the base64 PAYMENT-REQUIRED header"
     },
     "405": {
      "description": "GET carrying a payment is refused (not charged); use POST"
     }
    }
   }
  },
  "/api/check": {
   "post": {
    "operationId": "freeCheck",
    "summary": "Free scam triage of a pasted message, wallet address, transaction hash or link",
    "tags": [
     "Free"
    ],
    "security": [],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "text": {
          "type": "string",
          "minLength": 3,
          "description": "Message, wallet address, transaction hash or link. Input past 8000 characters is ignored."
         }
        },
        "required": [
         "text"
        ]
       },
       "example": {
        "text": "guaranteed 30% weekly returns, send USDT to activate your account"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Risk band, verdict, fired signals, address/tx/domain screen and first steps",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "rating": {
           "type": "string"
          },
          "band": {
           "type": "string"
          },
          "score": {
           "type": "number"
          },
          "verdict": {
           "type": "string"
          },
          "signals": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "screen": {
           "type": [
            "object",
            "null"
           ]
          },
          "first_steps": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "confidence": {
           "type": "string"
          },
          "evidence_type": {
           "type": "string"
          },
          "info": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "spoken": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Input too short"
     },
     "429": {
      "description": "Rate limited (40 per 10 minutes per IP)"
     },
     "500": {
      "description": "check_failed"
     }
    }
   }
  },
  "/.well-known/x402.json": {
   "get": {
    "operationId": "x402Manifest",
    "summary": "x402 manifest (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/.well-known/x402": {
   "get": {
    "operationId": "x402Discovery",
    "summary": "x402 discovery document (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/openapi.json": {
   "get": {
    "operationId": "openapi",
    "summary": "This OpenAPI document (free)",
    "security": [],
    "responses": {
     "200": {
      "description": "JSON document",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  }
 }
}