Skill: jolestar/mempool-space-openapi-skill (version 1.0.0)

--- name: mempool-space-openapi-skill description: Operate mempool.space public Bitcoin and Lightning explorer APIs through UXC with a curated OpenAPI schema, no-auth setup, and read-first guardrails. --- # mempool.space API Skill Use this skill to run mempool.space public Bitcoin and Lightning explorer operations through `uxc` + OpenAPI. Reuse the `uxc` skill for shared execution, auth, and error-handling guidance. ## Prerequisites - `uxc` is installed and available in `PATH`. - Network access to `https://mempool.space/api`. - Access to the curated OpenAPI schema URL: - `https://raw.githubusercontent.com/holon-run/uxc/main/skills/mempool-space-openapi-skill/references/mempool-space-public.openapi.json` ## Scope This skill covers a read-first mempool.space surface for: - Bitcoin fee estimation and mempool state reads - block tip height checks - address and transaction status reads - Lightning network search, statistics, node rankings, node detail, and channel reads This skill does **not** cover: - transaction broadcast or package submission - websocket subscriptions - internal or admin routes - every Esplora-compatible endpoint exposed by mempool.space ## Authentication mempool.space public reads in this skill do not require authentication. ## Core Workflow 1. Use the fixed link command by default: - `command -v mempool-space-openapi-cli` - If missing, create it: `uxc link mempool-space-openapi-cli https://mempool.space/api --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/mempool-space-openapi-skill/references/mempool-space-public.openapi.json` - `mempool-space-openapi-cli -h` 2. Inspect operation schema first: - `mempool-space-openapi-cli get:/v1/fees/recommended -h` - `mempool-space-openapi-cli get:/mempool -h` - `mempool-space-openapi-cli get:/address/{address} -h` - `mempool-space-openapi-cli get:/v1/lightning/search -h` - `mempool-space-openapi-cli get:/v1/lightning/channels/{short_id} -h` 3. Prefer narrow reads before broader scans: - `mempool-space-openapi-cli get:/v1/fees/recommended` - `mempool-space-openapi-cli get:/blocks/tip/height` - `mempool-space-openapi-cli get:/v1/lightning/statistics/latest` 4. Execute with key/value parameters: - `mempool-space-openapi-cli get:/address/{address} address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh` - `mempool-space-openapi-cli get:/tx/{txid}/status txid=4d5d7f2d5dc69aa68a51887db07dd6d906f31f9141320f9f0b4bab76d735a47f` - `mempool-space-openapi-cli get:/v1/lightning/search searchText=bfx` - `mempool-space-openapi-cli get:/v1/lightning/channels public_key=033d8656219478701227199cbd6f670335c8d408a92ae88b962c49d4dc0e83e025 status=active` - `mempool-space-openapi-cli get:/v1/lightning/channels/{short_id} short_id=835866331763769345` ## Operations - `get:/v1/fees/recommended` - `get:/mempool` - `get:/blocks/tip/height` - `get:/address/{address}` - `get:/tx/{txid}/status` - `get:/v1/lightning/statistics/latest` - `get:/v1/lightning/search` - `get:/v1/lightning/nodes/rankings` - `get:/v1/lightning/nodes/{public_key}` - `get:/v1/lightning/channels` - `get:/v1/lightning/channels/{short_id}` ## Guardrails - Keep automation on the JSON output envelope; do not use `--text`. - Parse stable fields first: `ok`, `kind`, `protocol`, `data`, `error`. - Treat this v1 skill as read-only. Do not use `tx/push`, package submission, or internal routes. - Prefer the curated fee, mempool, and Lightning reads here before dropping to the much larger generic Esplora surface. - `mempool.space` is a public explorer service, so mempool state and Lightning rankings can move quickly. Re-query instead of assuming cached values remain current. - For `get:/v1/lightning/channels/{short_id}`, mempool.space currently accepts the channel `id` string even though the route label says `short_id`; prefer values returned by search or node channel listing. - `mempool-space-openapi-cli <operation> ...` is equivalent to `uxc https://mempool.space/api --schema-url <mempool_space_openapi_schema> <operation> ...`. ## References - Usage patterns: `references/usage-patterns.md` - Curated OpenAPI schema: `references/mempool-space-public.openapi.json` - Official mempool repository: https://github.com/mempool/mempool

path: agents/openai.yaml
content: interface:
  display_name: "mempool.space Public API"
  short_description: "Operate mempool.space Bitcoin fee, mempool, address, transaction, and Lightning explorer reads via UXC + curated OpenAPI schema"
  default_prompt: "Use $mempool-space-openapi-skill to discover and execute mempool.space public Bitcoin and Lightning read-only operations through UXC with public no-auth access and explorer-focused guardrails."


path: references/mempool-space-public.openapi.json
content: {
  "openapi": "3.0.3",
  "info": {
    "title": "mempool.space Public API",
    "version": "1.0.0",
    "description": "Curated mempool.space public Bitcoin and Lightning explorer operations for UXC."
  },
  "servers": [
    {
      "url": "https://mempool.space/api"
    }
  ],
  "paths": {
    "/v1/fees/recommended": {
      "get": {
        "operationId": "getRecommendedFees",
        "summary": "Get recommended Bitcoin fee rates",
        "responses": {
          "200": {
            "description": "Recommended fee rates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/mempool": {
      "get": {
        "operationId": "getMempoolSummary",
        "summary": "Get aggregate mempool state",
        "responses": {
          "200": {
            "description": "Mempool summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/blocks/tip/height": {
      "get": {
        "operationId": "getBlockTipHeight",
        "summary": "Get the current block tip height",
        "responses": {
          "200": {
            "description": "Block tip height",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/address/{address}": {
      "get": {
        "operationId": "getAddressSummary",
        "summary": "Get Bitcoin address summary",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Address summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/tx/{txid}/status": {
      "get": {
        "operationId": "getTransactionStatus",
        "summary": "Get Bitcoin transaction confirmation status",
        "parameters": [
          {
            "name": "txid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transaction status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/statistics/latest": {
      "get": {
        "operationId": "getLatestLightningStatistics",
        "summary": "Get latest Lightning network statistics",
        "responses": {
          "200": {
            "description": "Lightning statistics snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/search": {
      "get": {
        "operationId": "searchLightningNodesAndChannels",
        "summary": "Search Lightning nodes and channels",
        "parameters": [
          {
            "name": "searchText",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lightning search results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/nodes/rankings": {
      "get": {
        "operationId": "getLightningNodeRankings",
        "summary": "Get top Lightning node rankings",
        "responses": {
          "200": {
            "description": "Lightning node rankings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/nodes/{public_key}": {
      "get": {
        "operationId": "getLightningNode",
        "summary": "Get one Lightning node by public key",
        "parameters": [
          {
            "name": "public_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lightning node detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/channels": {
      "get": {
        "operationId": "getLightningChannelsForNode",
        "summary": "Get Lightning channels for a node",
        "parameters": [
          {
            "name": "public_key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "index",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": -1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "active",
                "closed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lightning channels for node",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/lightning/channels/{short_id}": {
      "get": {
        "operationId": "getLightningChannel",
        "summary": "Get one Lightning channel by id",
        "parameters": [
          {
            "name": "short_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lightning channel detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {}
  }
}


path: references/usage-patterns.md
content: # mempool.space API Skill - Usage Patterns

## Link Setup

```bash
command -v mempool-space-openapi-cli
uxc link mempool-space-openapi-cli https://mempool.space/api \
  --schema-url https://raw.githubusercontent.com/holon-run/uxc/main/skills/mempool-space-openapi-skill/references/mempool-space-public.openapi.json
mempool-space-openapi-cli -h
```

## Read Examples

```bash
# Read current public fee recommendations
mempool-space-openapi-cli get:/v1/fees/recommended

# Read aggregate mempool state
mempool-space-openapi-cli get:/mempool

# Read the current block tip height
mempool-space-openapi-cli get:/blocks/tip/height

# Read summary stats for a Bitcoin address
mempool-space-openapi-cli get:/address/{address} \
  address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh

# Read whether a transaction is confirmed
mempool-space-openapi-cli get:/tx/{txid}/status \
  txid=4d5d7f2d5dc69aa68a51887db07dd6d906f31f9141320f9f0b4bab76d735a47f

# Read latest Lightning network statistics
mempool-space-openapi-cli get:/v1/lightning/statistics/latest

# Search Lightning nodes and channels by alias or id fragment
mempool-space-openapi-cli get:/v1/lightning/search \
  searchText=bfx

# Read top Lightning node rankings
mempool-space-openapi-cli get:/v1/lightning/nodes/rankings

# Read one Lightning node
mempool-space-openapi-cli get:/v1/lightning/nodes/{public_key} \
  public_key=033d8656219478701227199cbd6f670335c8d408a92ae88b962c49d4dc0e83e025

# Read active channels for a Lightning node
mempool-space-openapi-cli get:/v1/lightning/channels \
  public_key=033d8656219478701227199cbd6f670335c8d408a92ae88b962c49d4dc0e83e025 \
  status=active

# Read one Lightning channel by id
mempool-space-openapi-cli get:/v1/lightning/channels/{short_id} \
  short_id=835866331763769345
```

## Fallback Equivalence

- `mempool-space-openapi-cli <operation> ...` is equivalent to
  `uxc https://mempool.space/api --schema-url <mempool_space_openapi_schema> <operation> ...`.


path: scripts/validate.sh
content: #!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)"
SKILL_DIR="${ROOT_DIR}/skills/mempool-space-openapi-skill"
SKILL_FILE="${SKILL_DIR}/SKILL.md"
OPENAI_FILE="${SKILL_DIR}/agents/openai.yaml"
USAGE_FILE="${SKILL_DIR}/references/usage-patterns.md"
SCHEMA_FILE="${SKILL_DIR}/references/mempool-space-public.openapi.json"

fail() {
  printf '[validate] error: %s\n' "$*" >&2
  exit 1
}

need_cmd() {
  command -v "$1" >/dev/null 2>&1 || fail "required command not found: $1"
}

need_cmd jq
need_cmd rg

for file in "${SKILL_FILE}" "${OPENAI_FILE}" "${USAGE_FILE}" "${SCHEMA_FILE}"; do
  [[ -f "${file}" ]] || fail "missing required file: ${file}"
done

jq -e '.openapi and .paths and .components' "${SCHEMA_FILE}" >/dev/null 2>&1 || fail 'invalid OpenAPI schema JSON or missing .openapi/.paths/.components'
jq -e '.paths["/v1/fees/recommended"] and .paths["/mempool"] and .paths["/blocks/tip/height"] and .paths["/address/{address}"] and .paths["/tx/{txid}/status"]' "${SCHEMA_FILE}" >/dev/null 2>&1 || fail 'OpenAPI schema missing expected Bitcoin paths'
jq -e '.paths["/v1/lightning/statistics/latest"] and .paths["/v1/lightning/search"] and .paths["/v1/lightning/nodes/{public_key}"] and .paths["/v1/lightning/channels"] and .paths["/v1/lightning/channels/{short_id}"]' "${SCHEMA_FILE}" >/dev/null 2>&1 || fail 'OpenAPI schema missing expected Lightning paths'

rg -q '^name:\s*mempool-space-openapi-skill\s*$' "${SKILL_FILE}" || fail 'invalid skill name'
rg -q '^description:\s*.+' "${SKILL_FILE}" || fail 'missing description'
rg -q 'command -v mempool-space-openapi-cli' "${SKILL_FILE}" || fail 'missing link-first command check'
rg -q 'uxc link mempool-space-openapi-cli https://mempool.space/api --schema-url ' "${SKILL_FILE}" || fail 'missing fixed link create command with schema-url'
rg -F -q 'mempool-space-openapi-cli get:/v1/fees/recommended -h' "${SKILL_FILE}" || fail 'missing operation-level help example'
rg -q 'Treat this v1 skill as read-only' "${SKILL_FILE}" || fail 'missing read-only guardrail'
rg -q 'accepts the channel `id` string even though the route label says `short_id`' "${SKILL_FILE}" || fail 'missing channel id guardrail'

if rg -q -- "--args\\s+'\\{" "${SKILL_FILE}" "${USAGE_FILE}"; then
  fail 'found banned legacy JSON argument pattern'
fi

rg -q '^\s*display_name:\s*"mempool.space Public API"\s*$' "${OPENAI_FILE}" || fail 'missing display_name'
rg -q '^\s*short_description:\s*".+"\s*$' "${OPENAI_FILE}" || fail 'missing short_description'
rg -q '^\s*default_prompt:\s*".*\$mempool-space-openapi-skill.*"\s*$' "${OPENAI_FILE}" || fail 'default_prompt must mention $mempool-space-openapi-skill'

echo "skills/mempool-space-openapi-skill validation passed"


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)