child-inscription
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseChild 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:
- (required) — Parent inscription ID, e.g.
--parent-idabc123...i0 - (required) — MIME type, e.g.
--content-typeortext/plainimage/png - (required) — Content as a UTF-8 string (base64-encoded internally)
--content - (optional) — Fee rate in sat/vB; defaults to current mempool medium fee
--fee-rate
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>选项:
- (必填)—— 父铭文ID,例如
--parent-idabc123...i0 - (必填)—— MIME类型,例如
--content-type或text/plainimage/png - (必填)—— UTF-8字符串格式的内容(内部会进行base64编码)
--content - (可选)—— 手续费率,单位为sat/vB;默认使用当前内存池中等手续费率
--fee-rate
输出:
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 .
revealbun run child-inscription/child-inscription.ts inscribe \
--parent-id <inscription-id> \
--content-type <mime> \
--content <string> \
[--fee-rate <sats-per-vbyte>]Options:
- (required) — Parent inscription ID. Your wallet must own this inscription (verified on-chain).
--parent-id - (required) — MIME type of the child content.
--content-type - (required) — Child content as a UTF-8 string.
--content - (optional) — Fee rate:
--fee-rate,fast,medium, or an integer in sat/vB (default:slow).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地址。待该交易确认后,执行命令。
revealbun run child-inscription/child-inscription.ts inscribe \
--parent-id <inscription-id> \
--content-type <mime> \
--content <string> \
[--fee-rate <sats-per-vbyte>]选项:
- (必填)—— 父铭文ID。你的钱包必须持有该铭文(会通过链上验证)。
--parent-id - (必填)—— 子内容的MIME类型。
--content-type - (必填)—— UTF-8字符串格式的子内容。
--content - (可选)—— 手续费率:
--fee-rate(快速)、fast(中等)、medium(慢速),或整数(单位sat/vB);默认值为slow。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:
- (required) — Txid of the confirmed commit transaction (from the
--commit-txidstep).inscribe - (required) — Output index of the commit transaction (almost always
--vout).0
Note: Content, content-type, parent-id, and reveal-amount are read from the file written by the subcommand.
.child-inscription-state.jsoninscribeOutput:
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>选项:
- (必填)—— 已确认的提交交易的Txid(来自
--commit-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 first to understand total cost before committing funds.
estimate - The subcommand writes a
inscribefile in the current working directory. Do not delete it before running.child-inscription-state.json.reveal - The parent inscription must remain at your Taproot address between the and
inscribesteps. Do not transfer the parent during this window.reveal - 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 (first).
bun run wallet/wallet.ts unlock - All operations target Bitcoin mainnet by default (controlled by the environment variable).
NETWORK
- 请始终先运行命令,在投入资金前了解总成本。
estimate - 子命令会在当前工作目录生成一个
inscribe文件。在运行.child-inscription-state.json前请勿删除该文件。reveal - 在和
inscribe步骤之间,父铭文必须保持在你的Taproot地址中。在此期间请勿转移父铭文。reveal - 内容会以UTF-8编码并进行base64编码后传递给MCP工具。二进制内容(如图片等)需预先编码。
- 钱包操作需要解锁钱包(先执行)。
bun run wallet/wallet.ts unlock - 默认所有操作针对比特币主网(由环境变量控制)。
NETWORK