{"x402Version":2,"service":"ntt-x402","version":"0.1.0","resource":{"url":"https://ntt-x402.isurvivable.workers.dev/ntt","description":"Goldilocks NTT compute (forward and inverse), log2(n) <= 12 on the free tier","mimeType":"application/json"},"accepts":[{"scheme":"exact","network":"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","amount":"10000","asset":"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v","payTo":"6zP7sAnE1X6MuRcxPR7KQuABfTJTxacEGFvJ9LMtECY","maxTimeoutSeconds":300,"extra":{"feePayer":"BFK9TLC3edb13K6v4YyH3DwPb5DSUpkWvb7XnqCL9b4F"}}],"extensions":{
  "bazaar": {
    "info": {
      "input": {
        "type": "http",
        "method": "POST",
        "bodyType": "json",
        "body": {
          "field": "Goldilocks",
          "direction": "Forward",
          "degree_log2": 2,
          "coefficients": [1, 2, 3, 4]
        }
      },
      "output": {
        "type": "json",
        "example": {
          "output": ["10", "18446181119461163007", "18446744069414584319", "562949953421310"],
          "proof_of_execution": "9b7ce125998e0a8808e4cb07322cf79f51c691b34c58c30768cdd3bb71192525",
          "backend": "Wasm",
          "field": "Goldilocks",
          "direction": "Forward",
          "degree_log2": 2
        }
      }
    },
    "schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "required": ["input"],
      "properties": {
        "input": {
          "type": "object",
          "additionalProperties": false,
          "required": ["type", "method", "bodyType", "body"],
          "properties": {
            "type": {"const": "http"},
            "method": {"enum": ["POST", "PUT", "PATCH"]},
            "bodyType": {"enum": ["json", "form-data", "text"]},
            "body": {
              "type": "object",
              "additionalProperties": false,
              "required": ["field", "direction", "degree_log2", "coefficients"],
              "properties": {
                "field": {
                  "enum": ["Goldilocks", "BabyBear"],
                  "description": "The finite field for the NTT.  Goldilocks (p = 2^64 - 2^32 + 1) ships in v0.1; BabyBear lands in v0.2."
                },
                "direction": {
                  "enum": ["Forward", "Inverse"],
                  "description": "Forward (DFT) or Inverse (IDFT) transform direction."
                },
                "degree_log2": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12,
                  "description": "log2(n).  Free tier supports up to 12 (n = 4096); higher tiers unlock with paid plans."
                },
                "coefficients": {
                  "type": "array",
                  "items": {"type": "integer", "minimum": 0},
                  "description": "Polynomial coefficients as u64 integers.  Length must equal 2^degree_log2."
                }
              }
            }
          }
        },
        "output": {
          "type": "object",
          "required": ["type"],
          "properties": {
            "type": {"type": "string"},
            "example": {"type": "object"}
          }
        }
      }
    }
  }
}}