ordinals について
Bitcoin Ordinals 操作用のコマンドラインスキルで、インスクリプションの作成、転送、取得に対応します。作成は commit/reveal の2段階で行い、書き込みには Taproot 対応のロック解除済みウォレットが必要です。
主な機能
- 01インスクリプション手数料の見積もり
- 02commit/reveal による作成
- 03インスクリプションの転送
- 04インスクリプション内容の取得
- 05Taproot 受取アドレスの取得
活用シーン
- 01作成費用の見積もり
- 02Bitcoin へのコンテンツ刻印
- 03インスクリプションの送付
- 04reveal トランザクションからの内容取得
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ aibtcdev/ skills --skill ordinalsインストール後、Claude Code で/ordinalsを入力して読み込まれたか確認します。
同梱ファイルAGENT.mdordinals.ts
詳細
Ordinals スキル
micro-ordinals ライブラリ、mempool.space API、Unisat API を使用して、Bitcoin ordinals の操作を行います。インスクリプションの作成には、2 段階のコミット/リビール方式を使用します。まず inscribe がコミットトランザクションをブロードキャストし、その確認後に inscribe-reveal がリビールトランザクションをブロードキャストして、インスクリプションを確定します。
インスクリプションの転送では、Unisat API でインスクリプションの UTXO を検索し、混合入力トランザクション(P2TR インスクリプション + P2WPKH 手数料)を構築します。
すべての書き込み操作には、Taproot キーに対応した、ロック解除済みのウォレットが必要です。
使い方
bun run ordinals/ordinals.ts <subcommand> [options]
サブコマンド
get-taproot-address
インスクリプションの受け取りに使用する、ウォレットの Taproot(P2TR)アドレスを取得します。ロック解除済みのウォレットが必要です。
bun run ordinals/ordinals.ts get-taproot-address
estimate-fee
インスクリプションの作成にかかる合計コスト(satoshi 単位)を計算します。
bun run ordinals/ordinals.ts estimate-fee --content-type <type> --content-base64 <base64> [--fee-rate <rate>]
オプション:
--content-type(必須)— MIME タイプ(例:text/plain、image/png)--content-base64(必須)— base64 エンコードされた文字列としてのコンテンツ--fee-rate(任意)— sat/vB 単位の手数料率(デフォルト:現在の中程度の手数料率)
inscribe
Bitcoin インスクリプションを作成します — ステップ 1:コミットトランザクションをブロードキャストします。
bun run ordinals/ordinals.ts inscribe --content-type <type> --content-base64 <base64> [--fee-rate fast|medium|slow|<number>]
オプション:
--content-type(必須)— MIME タイプ--content-base64(必須)— base64 エンコードされた文字列としてのコンテンツ--fee-rate(任意)—fast、medium、slow、または sat/vB 単位の数値(デフォルト:medium)
inscribe-reveal
Bitcoin インスクリプションを完了します — ステップ 2:リビールトランザクションをブロードキャストします。
bun run ordinals/ordinals.ts inscribe-reveal \
--commit-txid <txid> \
--reveal-amount <satoshis> \
--content-type <type> \
--content-base64 <base64> \
[--fee-rate fast|medium|slow|<number>]
オプション:
--commit-txid(必須)— 確認済みコミットのトランザクション ID(64 桁の 16 進数)--reveal-amount(必須)— コミット出力の金額(satoshi)--content-type(必須)— MIME タイプ(コミットの手順と一致する必要があります)--content-base64(必須)— コンテンツ(コミットの手順と一致する必要があります)--fee-rate(任意)— リビールトランザクションの手数料率(デフォルト:medium)
transfer-inscription
インスクリプションを新しい所有者に転送します。Unisat 経由でインスクリプションの UTXO を検索し、手数料には SegWit アドレスの通常の UTXO を使用して、インスクリプションを受取人の Taproot アドレスに送ります。
bun run ordinals/ordinals.ts transfer-inscription \
--inscription-id <id> \
--recipient <bc1p...> \
[--fee-rate fast|medium|slow|<number>]
オプション:
--inscription-id(必須)— インスクリプション ID(例:abc123...i0)--recipient(必須)— 受取人の Taproot アドレス(bc1p... または tb1p...)--fee-rate(任意)— 手数料率(デフォルト:medium)
出力:
{
"success": true,
"txid": "def456...",
"explorerUrl": "https://mempool.space/tx/def456...",
"inscription": {
"id": "abc123...i0",
"contentType": "text/plain",
"output": "abc123...:0"
},
"recipient": "bc1p...",
"fee": { "satoshis": 1200, "rateUsed": "8 sat/vB" },
"change": { "satoshis": 5000 },
"network": "mainnet"
}
get-inscription
Bitcoin のリビールトランザクションからインスクリプションのコンテンツを取得して解析します。
bun run ordinals/ordinals.ts get-inscription --txid <txid>
オプション:
--txid(必須)— リビールトランザクションのトランザクション ID(64 桁の 16 進数)
2 段階のインスクリプションワークフロー
# Step 1: Inscribe (broadcasts commit tx)
CONTENT_B64=$(echo -n "Hello, Bitcoin!" | base64)
bun run ordinals/ordinals.ts inscribe --content-type text/plain --content-base64 "$CONTENT_B64"
# Wait for commit to confirm
# Step 2: Reveal (broadcasts reveal tx, creates inscription)
bun run ordinals/ordinals.ts inscribe-reveal \
--commit-txid <commitTxid> \
--reveal-amount <revealAmount> \
--content-type text/plain \
--content-base64 "$CONTENT_B64"
注意事項
inscribeとinscribe-revealには、bun run wallet/wallet.ts unlockでロック解除したウォレットが必要です- 資金調達には、SegWit(bc1q/tb1q)アドレスに BTC 残高が必要です
- インスクリプションは Taproot(bc1p/tb1p)アドレスで受け取ります
transfer-inscriptionでインスクリプションの UTXO を検索するには、UNISAT_API_KEYが必要です- メインネットとテストネットの両方で動作します(Unisat は両方に対応しています)