child-inscription

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Child Inscription Skill

子铭文处理工具

Creates parent-child Ordinals inscriptions per the Ordinals provenance spec. The inscription owner spends the parent UTXO in the reveal transaction, embedding a pointer that establishes on-chain provenance for the child.
  • estimate — Read-only fee calculation, no wallet required.
  • inscribe — Step 1 commit transaction, requires an unlocked wallet with BTC.
  • reveal — Step 2 reveal transaction, requires the commit tx to be confirmed.
根据Ordinals溯源规范创建Ordinals父子铭文。铭文持有者在披露交易中花费父UTXO,嵌入指针以建立子铭文的链上溯源关系。
  • estimate(估算) — 只读手续费计算,无需钱包。
  • inscribe(铭刻) — 第一步:提交交易,需要存有BTC的解锁钱包。
  • reveal(披露) — 第二步:披露交易,需等待提交交易确认完成。

Usage

使用方法

bun run child-inscription/child-inscription.ts <subcommand> [options]
bun run child-inscription/child-inscription.ts <subcommand> [options]

Subcommands

子命令

estimate

estimate(估算)

Calculate the total cost (commit fee + reveal amount) for a child inscription without broadcasting anything.
bun run child-inscription/child-inscription.ts estimate \
  --parent-id <inscription-id> \
  --content-type <mime> \
  --content <string>
Options:
  • --parent-id
    (required) — Parent inscription ID, e.g.
    abc123...i0
  • --content-type
    (required) — MIME type, e.g.
    text/plain
    or
    image/png
  • --content
    (required) — Content as a UTF-8 string (base64-encoded internally)
  • --fee-rate
    (optional) — Fee rate in sat/vB; defaults to current mempool medium fee
Output:
json
{
  "parentId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "feeRate": 12,
  "fees": {
    "commitFee": 1440,
    "revealFee": 2100,
    "revealAmount": 3394,
    "totalCost": 4834
  },
  "breakdown": "Commit tx: 1440 sats | Reveal amount: 3394 sats (includes 2100 reveal fee) | Total: 4834 sats"
}
计算子铭文的总成本(提交手续费+披露金额),无需广播任何交易。
bun run child-inscription/child-inscription.ts estimate \
  --parent-id <inscription-id> \
  --content-type <mime> \
  --content <string>
选项:
  • --parent-id
    (必填)—— 父铭文ID,例如
    abc123...i0
  • --content-type
    (必填)—— MIME类型,例如
    text/plain
    image/png
  • --content
    (必填)—— UTF-8字符串格式的内容(内部会进行base64编码)
  • --fee-rate
    (可选)—— 手续费率,单位为sat/vB;默认使用当前内存池中等手续费率
输出:
json
{
  "parentId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "feeRate": 12,
  "fees": {
    "commitFee": 1440,
    "revealFee": 2100,
    "revealAmount": 3394,
    "totalCost": 4834
  },
  "breakdown": "Commit tx: 1440 sats | Reveal amount: 3394 sats (includes 2100 reveal fee) | Total: 4834 sats"
}

inscribe

inscribe(铭刻)

Broadcast the commit transaction (Step 1). The commit locks funds into a pay-to-taproot address encoding the inscription script. After this confirms, run
reveal
.
bun run child-inscription/child-inscription.ts inscribe \
  --parent-id <inscription-id> \
  --content-type <mime> \
  --content <string> \
  [--fee-rate <sats-per-vbyte>]
Options:
  • --parent-id
    (required) — Parent inscription ID. Your wallet must own this inscription (verified on-chain).
  • --content-type
    (required) — MIME type of the child content.
  • --content
    (required) — Child content as a UTF-8 string.
  • --fee-rate
    (optional) — Fee rate:
    fast
    ,
    medium
    ,
    slow
    , or an integer in sat/vB (default:
    medium
    ).
Output:
json
{
  "status": "commit_broadcast",
  "commitTxid": "deadbeef...",
  "commitExplorerUrl": "https://mempool.space/tx/deadbeef...",
  "revealAddress": "bc1p...",
  "revealAmount": 3394,
  "commitFee": 1440,
  "feeRate": 12,
  "parentInscriptionId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "nextStep": "After commit confirms, call reveal with commitTxid and revealAmount from this response."
}
广播提交交易(第一步)。提交操作会将资金锁定到一个编码了铭文脚本的Pay-to-Taproot地址。待该交易确认后,执行
reveal
命令。
bun run child-inscription/child-inscription.ts inscribe \
  --parent-id <inscription-id> \
  --content-type <mime> \
  --content <string> \
  [--fee-rate <sats-per-vbyte>]
选项:
  • --parent-id
    (必填)—— 父铭文ID。你的钱包必须持有该铭文(会通过链上验证)。
  • --content-type
    (必填)—— 子内容的MIME类型。
  • --content
    (必填)—— UTF-8字符串格式的子内容。
  • --fee-rate
    (可选)—— 手续费率:
    fast
    (快速)、
    medium
    (中等)、
    slow
    (慢速),或整数(单位sat/vB);默认值为
    medium
输出:
json
{
  "status": "commit_broadcast",
  "commitTxid": "deadbeef...",
  "commitExplorerUrl": "https://mempool.space/tx/deadbeef...",
  "revealAddress": "bc1p...",
  "revealAmount": 3394,
  "commitFee": 1440,
  "feeRate": 12,
  "parentInscriptionId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "nextStep": "待提交交易确认后,使用本返回结果中的commitTxid和revealAmount调用reveal命令。"
}

reveal

reveal(披露)

Broadcast the reveal transaction (Step 2). This spends the commit output and the parent UTXO simultaneously, creating the child inscription and returning the parent to your address.
Wait for the commit tx to confirm before calling this.
bun run child-inscription/child-inscription.ts reveal \
  --commit-txid <txid> \
  --vout <num>
Options:
  • --commit-txid
    (required) — Txid of the confirmed commit transaction (from the
    inscribe
    step).
  • --vout
    (required) — Output index of the commit transaction (almost always
    0
    ).
Note: Content, content-type, parent-id, and reveal-amount are read from the
.child-inscription-state.json
file written by the
inscribe
subcommand.
Output:
json
{
  "status": "success",
  "inscriptionId": "revealthash...i0",
  "parentInscriptionId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "commit": {
    "txid": "deadbeef...",
    "explorerUrl": "https://mempool.space/tx/deadbeef..."
  },
  "reveal": {
    "txid": "revealthash...",
    "fee": 2100,
    "explorerUrl": "https://mempool.space/tx/revealthash..."
  },
  "recipientAddress": "bc1p..."
}
广播披露交易(第二步)。该操作同时花费提交交易的输出和父UTXO,生成子铭文并将父铭文返还至你的地址。
请等待提交交易确认后再调用本命令。
bun run child-inscription/child-inscription.ts reveal \
  --commit-txid <txid> \
  --vout <num>
选项:
  • --commit-txid
    (必填)—— 已确认的提交交易的Txid(来自
    inscribe
    步骤的输出)。
  • --vout
    (必填)—— 提交交易的输出索引(几乎总是
    0
    )。
注意:内容、内容类型、父ID和披露金额会从
inscribe
子命令生成的
.child-inscription-state.json
文件中读取。
输出:
json
{
  "status": "success",
  "inscriptionId": "revealthash...i0",
  "parentInscriptionId": "abc123...i0",
  "contentType": "text/plain",
  "contentSize": 42,
  "commit": {
    "txid": "deadbeef...",
    "explorerUrl": "https://mempool.space/tx/deadbeef..."
  },
  "reveal": {
    "txid": "revealthash...",
    "fee": 2100,
    "explorerUrl": "https://mempool.space/tx/revealthash..."
  },
  "recipientAddress": "bc1p..."
}

Notes

注意事项

  • Always run
    estimate
    first to understand total cost before committing funds.
  • The
    inscribe
    subcommand writes a
    .child-inscription-state.json
    file in the current working directory. Do not delete it before running
    reveal
    .
  • The parent inscription must remain at your Taproot address between the
    inscribe
    and
    reveal
    steps. Do not transfer the parent during this window.
  • Content is encoded as UTF-8 and base64-encoded before being passed to the MCP tool. Binary content (images etc.) should be supplied pre-encoded.
  • Wallet operations require an unlocked wallet (
    bun run wallet/wallet.ts unlock
    first).
  • All operations target Bitcoin mainnet by default (controlled by the
    NETWORK
    environment variable).
  • 请始终先运行
    estimate
    命令,在投入资金前了解总成本。
  • inscribe
    子命令会在当前工作目录生成一个
    .child-inscription-state.json
    文件。在运行
    reveal
    前请勿删除该文件。
  • inscribe
    reveal
    步骤之间,父铭文必须保持在你的Taproot地址中。在此期间请勿转移父铭文。
  • 内容会以UTF-8编码并进行base64编码后传递给MCP工具。二进制内容(如图片等)需预先编码。
  • 钱包操作需要解锁钱包(先执行
    bun run wallet/wallet.ts unlock
    )。
  • 默认所有操作针对比特币主网(由
    NETWORK
    环境变量控制)。