mcpField
C
child-inscription

child-inscription

github.com/aibtcdevその他11144 回インストール1 日前に更新
リポジトリ

child-inscription について

オンチェーンの来歴を持つ親子 Ordinals インスクリプションを作成するコマンドラインスキルです。手数料を見積もり、commit と reveal に分けて実行し、reveal では親 UTXO と commit 出力を同時に使用します。

主な機能

  1. 01子インスクリプション費用の見積もり
  2. 02commit トランザクションの送信
  3. 03子インスクリプションのreveal
  4. 04親インスクリプションの所有権確認
  5. 05親をウォレットへ返却

活用シーン

  1. 01資金を投入する前の手数料計画
  2. 02親に紐づく子インスクリプションの作成
  3. 03確認済みcommitのreveal完了

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/aibtcdev/skills --skill child-inscription

インストール後、Claude Code で/child-inscriptionを入力して読み込まれたか確認します。

同梱ファイルAGENT.mdchild-inscription.ts

詳細

子インスクリプションスキル

Ordinals の来歴仕様に従って、親子 Ordinals インスクリプションを作成します。インスクリプションの所有者は、リビールトランザクションで親 UTXO を使用し、子のオンチェーン上の来歴を確立するポインターを埋め込みます。

  • estimate — 読み取り専用の手数料計算です。ウォレットは不要です。
  • inscribe — ステップ 1 のコミットトランザクションです。BTC が入ったロック解除済みウォレットが必要です。
  • reveal — ステップ 2 のリビールトランザクションです。コミットトランザクションが承認済みである必要があります。

使用方法

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

サブコマンド

estimate

何もブロードキャストせずに、子インスクリプションの合計コスト(コミット手数料+リビール額)を計算します。

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 単位の手数料率。デフォルトは現在のメンプールの中程度の手数料率です

出力:

{
  "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

コミットトランザクション(ステップ 1)をブロードキャストします。コミットにより、インスクリプションスクリプトをエンコードした 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)。

出力:

{
  "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."
}
reveal

リビールトランザクション(ステップ 2)をブロードキャストします。これによりコミットの出力と親 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 ファイルから読み取られます。

出力:

{
  "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..."
}

注意事項

  • 資金をコミットする前に、合計コストを把握するため、必ず最初に estimate を実行してください。
  • inscribe サブコマンドは、現在の作業ディレクトリに .child-inscription-state.json ファイルを書き込みます。reveal を実行する前に削除しないでください。
  • inscribe と reveal の間、親インスクリプションは Taproot アドレスに置いておく必要があります。この間、親を移転しないでください。
  • コンテンツは UTF-8 としてエンコードされ、MCP ツールに渡す前に base64 エンコードされます。バイナリコンテンツ(画像など)は、あらかじめエンコードしたものを指定してください。
  • ウォレット操作には、ロック解除済みのウォレットが必要です(最初に bun run wallet/wallet.ts unlock を実行してください)。
  • すべての操作はデフォルトで Bitcoin メインネットを対象とします(NETWORK 環境変数で制御されます)。

コメント