当前位置: 首页 > Skill >

Ordiscan

Ordiscan

Ordiscan

通过 Ordiscan API 在比特币上铭刻内容,使用 x402 协议在 Base 上以 USDC 按请求付费。

0.0.2 2026.11.15 298
获取Skill文件查看使用说明
作 者:许辰 许可证: 更新时间:2026.11.15
本文目录展开

Ordiscan API

Inscribe content and query Ordinals data via the Ordiscan API. Every request is paid with USDC on Base using the x402 payment protocol -- no API key needed.

What this skill can do

  • Inscribe content on Bitcoin -- text, images, HTML, SVG, and any other file type. The server builds and broadcasts the Bitcoin transactions for you. You only pay USDC on Base.
  • Query Ordinals data -- look up inscriptions, addresses, runes, BRC-20 tokens, rare sats, and more.

Setup

Two payment modes are supported. Use the signing script by default. Only use awal if it's already installed and authenticated.

Default -- Signing script

Requires node and the X402_PRIVATE_KEY environment variable (an Ethereum private key with USDC on Base).

If X402_PRIVATE_KEY is not already set, check if ~/.evm-wallet.json exists (created by the evm-wallet skill). If it does, read the private key from it:

X402_PRIVATE_KEY=$(node -e "console.log(JSON.parse(require('fs').readFileSync(require('os').homedir()+'/.evm-wallet.json','utf8')).privateKey)")

If neither the env var nor the wallet file is available, suggest using the awal wallet.

# Install dependencies (only once)
npm install --prefix <skill-dir>

# Verify connectivity
X402_PRIVATE_KEY=$X402_PRIVATE_KEY node <skill-dir>/scripts/x402-sign.mjs balance

Alternative -- Coinbase Agentic Wallet (awal)

If awal is already installed and authenticated, it can be used instead. One command handles the full x402 negotiate-sign-pay flow.

# Check if awal is already available and authenticated
which awal && npx awal status

Making requests with signing script

This is a 3-step flow: request -> sign -> retry. The example below inscribes text, but the same pattern works for any endpoint.

Step 1: Send the request (get 402 + payment header)

CONTENT=$(echo -n "Hello from OpenClaw!" | base64)
BODY="{"contentType":"text/plain","base64_content":"$CONTENT","recipientAddress":"bc1p..."}"

HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' 
  -X POST -H "Content-Type: application/json" 
  -d "$BODY" 
  "https://api.ordiscan.com/v1/inscribe")

Check the price before paying:

cat /tmp/x402_body.json

For GET requests (e.g. querying data), omit -X POST and -d.

Step 2: Sign the payment

PAYMENT=$(X402_PRIVATE_KEY=$X402_PRIVATE_KEY node <skill-dir>/scripts/x402-sign.mjs sign "$HEADER")

The script reads the base64-encoded Payment-Required header, signs an ERC-3009 TransferWithAuthorization, and outputs the base64-encoded Payment-Signature header to stdout. Diagnostics go to stderr.

Step 3: Retry with payment

curl -s -X POST 
  -H "Content-Type: application/json" 
  -H "Payment-Signature: $PAYMENT" 
  -d "$BODY" 
  "https://api.ordiscan.com/v1/inscribe"

Making requests with awal

If awal is already available, it handles the full x402 flow in one command:

Querying data

npx awal x402 pay "https://api.ordiscan.com/v1/inscription/0"

Inscribing content

npx awal x402 pay "https://api.ordiscan.com/v1/inscribe" 
  --method POST 
  --data '{"contentType":"text/plain","base64_content":"SGVsbG8gd29ybGQ=","recipientAddress":"bc1p..."}' 
  --max-amount 5000000

The --max-amount flag caps the payment in USDC base units (6 decimals). 5000000 = $5.00 USDC.

Preparing content for inscription

When the user asks to inscribe something, follow these steps:

1. Determine the content and MIME type

  • User provides text (e.g. "inscribe 'Hello world'"): use text/plain
  • User provides a file path: detect the MIME type from the extension:
    Extension Content type
    .txt text/plain
    .html, .htm text/html
    .svg image/svg+xml
    .json application/json
    .png image/png
    .jpg, .jpeg image/jpeg
    .gif image/gif
    .webp image/webp
    .mp3 audio/mpeg
    .mp4 video/mp4
    .pdf application/pdf

2. Base64-encode the content

For text:

CONTENT=$(echo -n 'Hello world' | base64)

For a file:

CONTENT=$(base64 -w0 path/to/file)

-w0 disables line wrapping (important -- the API expects a single unbroken base64 string). On macOS, base64 doesn't wrap by default, so -w0 can be omitted.

3. Get the recipient Bitcoin address

Ask the user for their Bitcoin address if not already provided. This is the address that will own the inscription.

4. Call the inscribe endpoint

See the worked examples below.

Inscribe endpoint (deep dive)

POST /v1/inscribe creates a Bitcoin inscription. The server builds and broadcasts the commit + reveal transactions.

Request body

Field Type Required Description
contentType string yes MIME type (e.g. text/plain, image/png, text/html)
base64_content string yes Base64-encoded content (max 400KB decoded)
recipientAddress string yes Bitcoin address to receive the inscription
feeRate number no Custom fee rate in sat/vB (defaults to medium)

402 response (no payment)

When called without payment, the server returns 402 with dynamic pricing:

{
  "error": { "message": "Payment required..." },
  "priceUsdc": 1.23,
  "totalSats": 4567,
  "feeRate": 12,
  "btcPriceUsd": 100000
}

The Payment-Required header contains the base64-encoded x402 v2 payment details.

Use the 3-step signing script flow above to handle this. If using awal, it handles the 402 flow automatically.

Success response (200)

{
  "data": {
    "commitTxid": "abc123...",
    "revealTxid": "def456...",
    "inscriptionId": "def456...i0"
  }
}

After a successful inscription, always show the user a link to their inscription: https://ordiscan.com/inscription/{inscriptionId}

Worked example with signing script

CONTENT=$(echo -n "Hello Bitcoin!" | base64)
BODY="{"contentType":"text/plain","base64_content":"$CONTENT","recipientAddress":"bc1p..."}"

# Step 1: Get price and payment header
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' 
  -X POST -H "Content-Type: application/json" 
  -d "$BODY" 
  "https://api.ordiscan.com/v1/inscribe")

# Check the price
cat /tmp/x402_body.json

# Step 2: Sign
PAYMENT=$(X402_PRIVATE_KEY=$X402_PRIVATE_KEY node <skill-dir>/scripts/x402-sign.mjs sign "$HEADER")

# Step 3: Send with payment
curl -s -X POST 
  -H "Content-Type: application/json" 
  -H "Payment-Signature: $PAYMENT" 
  -d "$BODY" 
  "https://api.ordiscan.com/v1/inscribe"

Worked example with awal

CONTENT=$(echo -n "Hello Bitcoin!" | base64)

npx awal x402 pay "https://api.ordiscan.com/v1/inscribe" 
  --method POST 
  --data "{"contentType":"text/plain","base64_content":"$CONTENT","recipientAddress":"bc1p..."}" 
  --max-amount 5000000

Inscribing images

CONTENT=$(base64 -w0 image.png)

npx awal x402 pay "https://api.ordiscan.com/v1/inscribe" 
  --method POST 
  --data "{"contentType":"image/png","base64_content":"$CONTENT","recipientAddress":"bc1p..."}" 
  --max-amount 10000000

Inscribing HTML

CONTENT=$(echo -n '<html><body><h1>On-chain page</h1></body></html>' | base64)

npx awal x402 pay "https://api.ordiscan.com/v1/inscribe" 
  --method POST 
  --data "{"contentType":"text/html","base64_content":"$CONTENT","recipientAddress":"bc1p..."}" 
  --max-amount 5000000

API endpoint reference

See the Ordiscan API documentation

Response format

Success:

{ "data": { ... } }

Error:

{ "error": { "message": "..." } }

Error handling

Status Meaning Action
400 Bad request (invalid params) Fix the request body or parameters
402 Payment required Sign and send payment via x402
429 Rate limited Wait and retry (max 10 requests/min for inscribe)
503 Service unavailable Server issue, retry later

Tips

  • Payment mode: Use the signing script with X402_PRIVATE_KEY by default. Only use awal if it's already installed and authenticated (which awal succeeds).
  • GET requests cost ~$0.01 USDC each. Inscription requests vary based on content size and Bitcoin fee rates.
  • For inscriptions, always check the 402 response to see the price before paying. The priceUsdc field tells you the exact cost.
  • Content limit is 400KB (decoded). For images, keep them reasonable in size.
  • The inscribe endpoint returns commitTxid and revealTxid. Track them on https://mempool.space/tx/{txid} or https://ordiscan.com/inscription/{inscriptionId}.

External endpoints

Endpoint Method Data sent
https://api.ordiscan.com/v1/* GET Query parameters only
https://api.ordiscan.com/v1/inscribe POST Content type, base64-encoded content, recipient Bitcoin address

All requests are paid via x402 (USDC on Base). Payment is handled by awal or the signing script.

Security & Privacy

  • All data is sent to api.ordiscan.com over HTTPS.
  • GET requests send only query parameters (inscription IDs, addresses, etc.).
  • Inscription requests send the content you want to inscribe (base64-encoded) and a recipient Bitcoin address. This content is published on the Bitcoin blockchain and is permanently public.
  • Mode A (awal): No credentials are read beyond what awal manages for x402 payments. No data is stored locally.
  • Mode B (signing script): Reads X402_PRIVATE_KEY from the environment to sign USDC payments on Base. The private key is never sent over the network -- only the resulting EIP-3009 signature is transmitted. No data is stored locally.

By using this skill, your requests and inscription content are sent to Ordiscan. Only install if you trust Ordiscan.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,017
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,005
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,003
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,003
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,002
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,001
Skill 文件
  • SKILL.md
    • Ordiscan API
    • What this skill can do
    • Setup
      • Default -- Signing script
      • Alternative -- Coinbase Agentic Wallet (awal)
    • Making requests with signing script
      • Step 1: Send the request (get 402 + payment header)
      • Step 2: Sign the payment
      • Step 3: Retry with payment
    • Making requests with awal
      • Querying data
      • Inscribing content
    • Preparing content for inscription
      • 1. Determine the content and MIME type
      • 2. Base64-encode the content
      • 3. Get the recipient Bitcoin address
      • 4. Call the inscribe endpoint
    • Inscribe endpoint (deep dive)
      • Request body
      • 402 response (no payment)
      • Success response (200)
      • Worked example with signing script
      • Worked example with awal
      • Inscribing images
      • Inscribing HTML
    • API endpoint reference
    • Response format
    • Error handling
    • Tips
    • External endpoints
    • Security & Privacy
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期