@aibtc/mcp-server 1.31.0 → 1.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/child-inscription.tools.d.ts +15 -0
- package/dist/tools/child-inscription.tools.d.ts.map +1 -0
- package/dist/tools/child-inscription.tools.js +338 -0
- package/dist/tools/child-inscription.tools.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/transactions/child-inscription-builder.d.ts +112 -0
- package/dist/transactions/child-inscription-builder.d.ts.map +1 -0
- package/dist/transactions/child-inscription-builder.js +261 -0
- package/dist/transactions/child-inscription-builder.js.map +1 -0
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child inscription tools
|
|
3
|
+
*
|
|
4
|
+
* Parent-child inscriptions per the Ordinals provenance spec.
|
|
5
|
+
* The owner of a parent inscription creates child inscriptions,
|
|
6
|
+
* establishing on-chain provenance.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - estimate_child_inscription_fee: Calculate cost for a child inscription
|
|
10
|
+
* - inscribe_child: Step 1 - Broadcast commit tx for child inscription
|
|
11
|
+
* - inscribe_child_reveal: Step 2 - Broadcast reveal tx after commit confirms
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
export declare function registerChildInscriptionTools(server: McpServer): void;
|
|
15
|
+
//# sourceMappingURL=child-inscription.tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-inscription.tools.d.ts","sourceRoot":"","sources":["../../src/tools/child-inscription.tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAwBpE,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6arE"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Child inscription tools
|
|
3
|
+
*
|
|
4
|
+
* Parent-child inscriptions per the Ordinals provenance spec.
|
|
5
|
+
* The owner of a parent inscription creates child inscriptions,
|
|
6
|
+
* establishing on-chain provenance.
|
|
7
|
+
*
|
|
8
|
+
* Tools:
|
|
9
|
+
* - estimate_child_inscription_fee: Calculate cost for a child inscription
|
|
10
|
+
* - inscribe_child: Step 1 - Broadcast commit tx for child inscription
|
|
11
|
+
* - inscribe_child_reveal: Step 2 - Broadcast reveal tx after commit confirms
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
import { NETWORK } from "../config/networks.js";
|
|
15
|
+
import { P2WPKH_INPUT_VBYTES, P2WPKH_OUTPUT_VBYTES, P2TR_OUTPUT_VBYTES, P2TR_INPUT_BASE_VBYTES, TX_OVERHEAD_VBYTES, DUST_THRESHOLD, WITNESS_OVERHEAD_VBYTES, } from "../config/bitcoin-constants.js";
|
|
16
|
+
import { createJsonResponse, createErrorResponse } from "../utils/index.js";
|
|
17
|
+
import { MempoolApi, getMempoolTxUrl } from "../services/mempool-api.js";
|
|
18
|
+
import { getWalletManager } from "../services/wallet-manager.js";
|
|
19
|
+
import { signBtcTransaction } from "../transactions/bitcoin-builder.js";
|
|
20
|
+
import { buildChildCommitTransaction, buildChildRevealTransaction, deriveChildRevealScript, lookupParentInscription, } from "../transactions/child-inscription-builder.js";
|
|
21
|
+
export function registerChildInscriptionTools(server) {
|
|
22
|
+
// Estimate child inscription fee
|
|
23
|
+
server.registerTool("estimate_child_inscription_fee", {
|
|
24
|
+
description: "Calculate the total cost (in satoshis) for creating a child inscription. " +
|
|
25
|
+
"Accounts for the extra parent UTXO input and parent return output in the reveal transaction. " +
|
|
26
|
+
"Content should be provided as base64-encoded string.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
contentType: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe("MIME type (e.g., 'text/plain', 'image/png')"),
|
|
31
|
+
contentBase64: z
|
|
32
|
+
.string()
|
|
33
|
+
.describe("Content as base64-encoded string"),
|
|
34
|
+
feeRate: z
|
|
35
|
+
.number()
|
|
36
|
+
.positive()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe("Fee rate in sat/vB (optional, defaults to current medium fee)"),
|
|
39
|
+
},
|
|
40
|
+
}, async ({ contentType, contentBase64, feeRate }) => {
|
|
41
|
+
try {
|
|
42
|
+
const body = Buffer.from(contentBase64, "base64");
|
|
43
|
+
let actualFeeRate = feeRate;
|
|
44
|
+
if (!actualFeeRate) {
|
|
45
|
+
const mempoolApi = new MempoolApi(NETWORK);
|
|
46
|
+
const fees = await mempoolApi.getFeeEstimates();
|
|
47
|
+
actualFeeRate = fees.halfHourFee;
|
|
48
|
+
}
|
|
49
|
+
// Commit tx size (assuming 1-2 inputs)
|
|
50
|
+
const commitInputs = 2;
|
|
51
|
+
const commitSize = TX_OVERHEAD_VBYTES +
|
|
52
|
+
commitInputs * P2WPKH_INPUT_VBYTES +
|
|
53
|
+
P2TR_OUTPUT_VBYTES +
|
|
54
|
+
P2WPKH_OUTPUT_VBYTES;
|
|
55
|
+
const commitFee = Math.ceil(commitSize * actualFeeRate);
|
|
56
|
+
// Reveal tx size: 2 inputs (commit + parent), 2 outputs (parent return + child)
|
|
57
|
+
const revealWitnessSize = Math.ceil((body.length / 4) * 1.25) + WITNESS_OVERHEAD_VBYTES;
|
|
58
|
+
const revealSize = TX_OVERHEAD_VBYTES +
|
|
59
|
+
P2TR_INPUT_BASE_VBYTES + // commit input (script-path)
|
|
60
|
+
P2TR_INPUT_BASE_VBYTES + // parent input (key-path)
|
|
61
|
+
revealWitnessSize +
|
|
62
|
+
P2TR_OUTPUT_VBYTES * 2; // parent return + child output
|
|
63
|
+
const revealFee = Math.ceil(revealSize * actualFeeRate);
|
|
64
|
+
// Amount locked in reveal output
|
|
65
|
+
const revealAmount = revealFee + DUST_THRESHOLD * 2 + 1000;
|
|
66
|
+
const totalCost = commitFee + revealAmount;
|
|
67
|
+
return createJsonResponse({
|
|
68
|
+
contentType,
|
|
69
|
+
contentSize: body.length,
|
|
70
|
+
feeRate: actualFeeRate,
|
|
71
|
+
fees: {
|
|
72
|
+
commitFee,
|
|
73
|
+
revealFee,
|
|
74
|
+
revealAmount,
|
|
75
|
+
totalCost,
|
|
76
|
+
},
|
|
77
|
+
breakdown: `Commit tx: ${commitFee} sats | Reveal amount: ${revealAmount} sats (includes ${revealFee} reveal fee) | Total: ${totalCost} sats`,
|
|
78
|
+
note: "This is an estimate. Actual fees may vary based on UTXO selection. Includes extra cost for parent UTXO input and parent return output.",
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
return createErrorResponse(error);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
// Create child inscription - Step 1: Commit
|
|
86
|
+
server.registerTool("inscribe_child", {
|
|
87
|
+
description: "Create a child inscription - STEP 1: Broadcast commit transaction.\n\n" +
|
|
88
|
+
"Creates a child inscription linked to a parent, establishing on-chain provenance " +
|
|
89
|
+
"per the Ordinals provenance spec. You must own the parent inscription.\n\n" +
|
|
90
|
+
"This broadcasts the commit tx and returns immediately. After it confirms " +
|
|
91
|
+
"(typically 10-60 min), use `inscribe_child_reveal` to complete.\n\n" +
|
|
92
|
+
"Returns: commitTxid, revealAddress, revealAmount, parentInscriptionId, feeRate",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
contentType: z
|
|
95
|
+
.string()
|
|
96
|
+
.describe("MIME type (e.g., 'text/plain', 'image/png', 'text/html')"),
|
|
97
|
+
contentBase64: z
|
|
98
|
+
.string()
|
|
99
|
+
.describe("Content as base64-encoded string"),
|
|
100
|
+
parentInscriptionId: z
|
|
101
|
+
.string()
|
|
102
|
+
.describe("Parent inscription ID (e.g., 'abc123...i0'). You must own this inscription."),
|
|
103
|
+
feeRate: z
|
|
104
|
+
.union([z.enum(["fast", "medium", "slow"]), z.number().positive()])
|
|
105
|
+
.optional()
|
|
106
|
+
.describe("Fee rate: 'fast' (~10 min), 'medium' (~30 min), 'slow' (~1 hr), or number in sat/vB (default: medium)"),
|
|
107
|
+
},
|
|
108
|
+
}, async ({ contentType, contentBase64, parentInscriptionId, feeRate }) => {
|
|
109
|
+
try {
|
|
110
|
+
// Check wallet session
|
|
111
|
+
const walletManager = getWalletManager();
|
|
112
|
+
const sessionInfo = walletManager.getSessionInfo();
|
|
113
|
+
if (!sessionInfo) {
|
|
114
|
+
return createErrorResponse(new Error("Wallet not unlocked. Use wallet_unlock first."));
|
|
115
|
+
}
|
|
116
|
+
if (!sessionInfo.btcAddress || !sessionInfo.taprootAddress) {
|
|
117
|
+
return createErrorResponse(new Error("Wallet doesn't have Bitcoin addresses. Use a managed wallet."));
|
|
118
|
+
}
|
|
119
|
+
const account = walletManager.getAccount();
|
|
120
|
+
if (!account ||
|
|
121
|
+
!account.btcPrivateKey ||
|
|
122
|
+
!account.btcPublicKey ||
|
|
123
|
+
!account.taprootPrivateKey ||
|
|
124
|
+
!account.taprootPublicKey) {
|
|
125
|
+
return createErrorResponse(new Error("Bitcoin and Taproot keys not available. Wallet may not be unlocked."));
|
|
126
|
+
}
|
|
127
|
+
// Look up parent inscription and validate ownership
|
|
128
|
+
const parentInfo = await lookupParentInscription(parentInscriptionId);
|
|
129
|
+
if (parentInfo.address !== sessionInfo.taprootAddress) {
|
|
130
|
+
return createErrorResponse(new Error(`Parent inscription is owned by ${parentInfo.address}, but your Taproot address is ${sessionInfo.taprootAddress}. You must own the parent inscription.`));
|
|
131
|
+
}
|
|
132
|
+
// Decode content
|
|
133
|
+
const body = Buffer.from(contentBase64, "base64");
|
|
134
|
+
const inscription = { contentType, body };
|
|
135
|
+
// Get fee rate
|
|
136
|
+
const mempoolApi = new MempoolApi(NETWORK);
|
|
137
|
+
let actualFeeRate;
|
|
138
|
+
if (typeof feeRate === "string") {
|
|
139
|
+
const fees = await mempoolApi.getFeeEstimates();
|
|
140
|
+
switch (feeRate) {
|
|
141
|
+
case "fast":
|
|
142
|
+
actualFeeRate = fees.fastestFee;
|
|
143
|
+
break;
|
|
144
|
+
case "slow":
|
|
145
|
+
actualFeeRate = fees.hourFee;
|
|
146
|
+
break;
|
|
147
|
+
default:
|
|
148
|
+
actualFeeRate = fees.halfHourFee;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
actualFeeRate =
|
|
153
|
+
feeRate || (await mempoolApi.getFeeEstimates()).halfHourFee;
|
|
154
|
+
}
|
|
155
|
+
// Get UTXOs for funding (from BIP84 address)
|
|
156
|
+
const utxos = await mempoolApi.getUtxos(sessionInfo.btcAddress);
|
|
157
|
+
if (utxos.length === 0) {
|
|
158
|
+
return createErrorResponse(new Error(`No UTXOs available for address ${sessionInfo.btcAddress}. Send some BTC first.`));
|
|
159
|
+
}
|
|
160
|
+
// Build and broadcast commit transaction
|
|
161
|
+
const commitResult = buildChildCommitTransaction({
|
|
162
|
+
utxos,
|
|
163
|
+
inscription,
|
|
164
|
+
parentInscriptionId,
|
|
165
|
+
feeRate: actualFeeRate,
|
|
166
|
+
senderPubKey: account.btcPublicKey,
|
|
167
|
+
senderAddress: sessionInfo.btcAddress,
|
|
168
|
+
network: NETWORK,
|
|
169
|
+
});
|
|
170
|
+
const commitSigned = signBtcTransaction(commitResult.tx, account.btcPrivateKey);
|
|
171
|
+
const commitTxid = await mempoolApi.broadcastTransaction(commitSigned.txHex);
|
|
172
|
+
const commitExplorerUrl = getMempoolTxUrl(commitTxid, NETWORK);
|
|
173
|
+
return createJsonResponse({
|
|
174
|
+
status: "commit_broadcast",
|
|
175
|
+
message: "Child inscription commit transaction broadcast successfully. " +
|
|
176
|
+
"Wait for confirmation (typically 10-60 min), then call inscribe_child_reveal to complete.",
|
|
177
|
+
commitTxid,
|
|
178
|
+
commitExplorerUrl,
|
|
179
|
+
revealAddress: commitResult.revealAddress,
|
|
180
|
+
revealAmount: commitResult.revealAmount,
|
|
181
|
+
commitFee: commitResult.fee,
|
|
182
|
+
feeRate: actualFeeRate,
|
|
183
|
+
parentInscriptionId,
|
|
184
|
+
parentUtxo: {
|
|
185
|
+
txid: parentInfo.txid,
|
|
186
|
+
vout: parentInfo.vout,
|
|
187
|
+
value: parentInfo.value,
|
|
188
|
+
},
|
|
189
|
+
contentType,
|
|
190
|
+
contentSize: body.length,
|
|
191
|
+
nextStep: "After commit confirms, call inscribe_child_reveal with the same contentType, contentBase64, " +
|
|
192
|
+
"parentInscriptionId, plus commitTxid and revealAmount from this response.",
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
return createErrorResponse(error);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
// Complete child inscription - Step 2: Reveal
|
|
200
|
+
server.registerTool("inscribe_child_reveal", {
|
|
201
|
+
description: "Complete a child inscription - STEP 2: Broadcast reveal transaction.\n\n" +
|
|
202
|
+
"Call this AFTER the commit transaction from `inscribe_child` has confirmed.\n" +
|
|
203
|
+
"You must provide the same contentType, contentBase64, and parentInscriptionId " +
|
|
204
|
+
"used in the commit step.\n\n" +
|
|
205
|
+
"The reveal tx spends both the commit output and the parent inscription UTXO, " +
|
|
206
|
+
"returning the parent to your address and creating the child inscription.\n\n" +
|
|
207
|
+
"Returns: inscriptionId ({revealTxid}i0), parentInscriptionId on success",
|
|
208
|
+
inputSchema: {
|
|
209
|
+
commitTxid: z
|
|
210
|
+
.string()
|
|
211
|
+
.length(64)
|
|
212
|
+
.describe("Transaction ID of the confirmed commit transaction (from inscribe_child)"),
|
|
213
|
+
revealAmount: z
|
|
214
|
+
.number()
|
|
215
|
+
.positive()
|
|
216
|
+
.describe("Amount in the commit output (from inscribe_child response)"),
|
|
217
|
+
contentType: z
|
|
218
|
+
.string()
|
|
219
|
+
.describe("MIME type (must match the commit step)"),
|
|
220
|
+
contentBase64: z
|
|
221
|
+
.string()
|
|
222
|
+
.describe("Content as base64-encoded string (must match the commit step)"),
|
|
223
|
+
parentInscriptionId: z
|
|
224
|
+
.string()
|
|
225
|
+
.describe("Parent inscription ID (must match the commit step)"),
|
|
226
|
+
feeRate: z
|
|
227
|
+
.union([z.enum(["fast", "medium", "slow"]), z.number().positive()])
|
|
228
|
+
.optional()
|
|
229
|
+
.describe("Fee rate for reveal tx (default: medium)"),
|
|
230
|
+
},
|
|
231
|
+
}, async ({ commitTxid, revealAmount, contentType, contentBase64, parentInscriptionId, feeRate, }) => {
|
|
232
|
+
try {
|
|
233
|
+
// Check wallet session
|
|
234
|
+
const walletManager = getWalletManager();
|
|
235
|
+
const sessionInfo = walletManager.getSessionInfo();
|
|
236
|
+
if (!sessionInfo) {
|
|
237
|
+
return createErrorResponse(new Error("Wallet not unlocked. Use wallet_unlock first."));
|
|
238
|
+
}
|
|
239
|
+
if (!sessionInfo.taprootAddress) {
|
|
240
|
+
return createErrorResponse(new Error("Wallet doesn't have Taproot address. Use a managed wallet."));
|
|
241
|
+
}
|
|
242
|
+
const account = walletManager.getAccount();
|
|
243
|
+
if (!account ||
|
|
244
|
+
!account.btcPrivateKey ||
|
|
245
|
+
!account.btcPublicKey ||
|
|
246
|
+
!account.taprootPrivateKey ||
|
|
247
|
+
!account.taprootPublicKey) {
|
|
248
|
+
return createErrorResponse(new Error("Bitcoin and Taproot keys not available. Wallet may not be unlocked."));
|
|
249
|
+
}
|
|
250
|
+
// Look up parent inscription fresh (may have moved since commit)
|
|
251
|
+
const parentInfo = await lookupParentInscription(parentInscriptionId);
|
|
252
|
+
if (parentInfo.address !== sessionInfo.taprootAddress) {
|
|
253
|
+
return createErrorResponse(new Error(`Parent inscription is no longer owned by your wallet. Current owner: ${parentInfo.address}`));
|
|
254
|
+
}
|
|
255
|
+
// Reconstruct the inscription and child reveal script
|
|
256
|
+
const body = Buffer.from(contentBase64, "base64");
|
|
257
|
+
const inscription = { contentType, body };
|
|
258
|
+
// Get fee rate
|
|
259
|
+
const mempoolApi = new MempoolApi(NETWORK);
|
|
260
|
+
let actualFeeRate;
|
|
261
|
+
if (typeof feeRate === "string") {
|
|
262
|
+
const fees = await mempoolApi.getFeeEstimates();
|
|
263
|
+
switch (feeRate) {
|
|
264
|
+
case "fast":
|
|
265
|
+
actualFeeRate = fees.fastestFee;
|
|
266
|
+
break;
|
|
267
|
+
case "slow":
|
|
268
|
+
actualFeeRate = fees.hourFee;
|
|
269
|
+
break;
|
|
270
|
+
default:
|
|
271
|
+
actualFeeRate = fees.halfHourFee;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
actualFeeRate =
|
|
276
|
+
feeRate || (await mempoolApi.getFeeEstimates()).halfHourFee;
|
|
277
|
+
}
|
|
278
|
+
// Derive the child reveal script deterministically
|
|
279
|
+
const p2trReveal = deriveChildRevealScript({
|
|
280
|
+
inscription,
|
|
281
|
+
parentInscriptionId,
|
|
282
|
+
senderPubKey: account.btcPublicKey,
|
|
283
|
+
network: NETWORK,
|
|
284
|
+
});
|
|
285
|
+
// Build child reveal transaction
|
|
286
|
+
const revealResult = buildChildRevealTransaction({
|
|
287
|
+
commitTxid,
|
|
288
|
+
commitVout: 0,
|
|
289
|
+
commitAmount: revealAmount,
|
|
290
|
+
revealScript: p2trReveal,
|
|
291
|
+
parentUtxo: {
|
|
292
|
+
txid: parentInfo.txid,
|
|
293
|
+
vout: parentInfo.vout,
|
|
294
|
+
value: parentInfo.value,
|
|
295
|
+
},
|
|
296
|
+
parentOwnerTaprootInternalPubKey: account.taprootPublicKey,
|
|
297
|
+
recipientAddress: sessionInfo.taprootAddress,
|
|
298
|
+
feeRate: actualFeeRate,
|
|
299
|
+
network: NETWORK,
|
|
300
|
+
});
|
|
301
|
+
// Sign both inputs:
|
|
302
|
+
// Input[0] (commit output): script-path → btcPrivateKey
|
|
303
|
+
// Input[1] (parent UTXO): key-path → taprootPrivateKey
|
|
304
|
+
// @scure/btc-signer matches keys to inputs automatically
|
|
305
|
+
revealResult.tx.sign(account.btcPrivateKey);
|
|
306
|
+
revealResult.tx.sign(account.taprootPrivateKey);
|
|
307
|
+
revealResult.tx.finalize();
|
|
308
|
+
const revealTxHex = revealResult.tx.hex;
|
|
309
|
+
const revealTxid = await mempoolApi.broadcastTransaction(revealTxHex);
|
|
310
|
+
const inscriptionId = `${revealTxid}i0`;
|
|
311
|
+
const revealExplorerUrl = getMempoolTxUrl(revealTxid, NETWORK);
|
|
312
|
+
const commitExplorerUrl = getMempoolTxUrl(commitTxid, NETWORK);
|
|
313
|
+
return createJsonResponse({
|
|
314
|
+
status: "success",
|
|
315
|
+
message: "Child inscription created successfully!",
|
|
316
|
+
inscriptionId,
|
|
317
|
+
parentInscriptionId,
|
|
318
|
+
contentType,
|
|
319
|
+
contentSize: body.length,
|
|
320
|
+
commit: {
|
|
321
|
+
txid: commitTxid,
|
|
322
|
+
explorerUrl: commitExplorerUrl,
|
|
323
|
+
},
|
|
324
|
+
reveal: {
|
|
325
|
+
txid: revealTxid,
|
|
326
|
+
fee: revealResult.fee,
|
|
327
|
+
explorerUrl: revealExplorerUrl,
|
|
328
|
+
},
|
|
329
|
+
recipientAddress: sessionInfo.taprootAddress,
|
|
330
|
+
note: "Child inscription will appear at the recipient address once the reveal transaction confirms. The parent inscription has been returned to your address.",
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
return createErrorResponse(error);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=child-inscription.tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-inscription.tools.js","sourceRoot":"","sources":["../../src/tools/child-inscription.tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,oBAAo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AC,GAAG,CAAC;YACxC,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;YAEtE,MAAM,aAAa,GAAG,GAAG,UAAU,IAAI,CAAC;YACxC,MAAM,iBAAiB,GAAG,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAC/D,MAAM,iBAAiB,GAAG,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAE/D,OAAO,kBAAkB,CAAC;gBACxB,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,yCAAyC;gBAClD,aAAa;gBACb,mBAAmB;gBACnB,WAAW;gBACX,WAAW,EAAE,IAAI,CAAC,MAAM;gBACxB,MAAM,EAAE;oBACN,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,UAAU;oBAChB,GAAG,EAAE,YAAY,CAAC,GAAG;oBACrB,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,gBAAgB,EAAE,WAAW,CAAC,cAAc;gBAC5C,IAAI,EAAE,wJAAwJ;aAC/J,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAuCpE;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoDxD"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Layer 1: Bitcoin L1 (Primary)
|
|
2
2
|
import { registerBitcoinTools } from "./bitcoin.tools.js";
|
|
3
3
|
import { registerOrdinalsTools } from "./ordinals.tools.js";
|
|
4
|
+
import { registerChildInscriptionTools } from "./child-inscription.tools.js";
|
|
4
5
|
import { registerPsbtTools } from "./psbt.tools.js";
|
|
5
6
|
import { registerWalletTools } from "./wallet.tools.js";
|
|
6
7
|
import { registerWalletManagementTools } from "./wallet-management.tools.js";
|
|
@@ -46,6 +47,7 @@ export function registerAllTools(server) {
|
|
|
46
47
|
// =========================================================================
|
|
47
48
|
registerBitcoinTools(server);
|
|
48
49
|
registerOrdinalsTools(server);
|
|
50
|
+
registerChildInscriptionTools(server);
|
|
49
51
|
registerPsbtTools(server);
|
|
50
52
|
registerWalletTools(server);
|
|
51
53
|
registerWalletManagementTools(server);
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAEA,gCAAgC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,iCAAiC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,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CAAC,CAAC;IAC5B,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAElC,4EAA4E;IAC5E,4BAA4B;IAC5B,sDAAsD;IACtD,4EAA4E;IAC5E,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAChC,wBAAwB,CAAC,MAAM,CAAC,CAAC;IACjC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,4BAA4B,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-child inscription transaction building
|
|
3
|
+
*
|
|
4
|
+
* Implements the commit/reveal pattern for child inscriptions per the
|
|
5
|
+
* Ordinals provenance spec (https://docs.ordinals.com/inscriptions/provenance.html).
|
|
6
|
+
*
|
|
7
|
+
* The owner of a parent inscription creates child inscriptions, establishing
|
|
8
|
+
* on-chain provenance. Uses micro-ordinals parent tag (tag 3) support.
|
|
9
|
+
*/
|
|
10
|
+
import * as btc from "@scure/btc-signer";
|
|
11
|
+
import type { Network } from "../config/networks.js";
|
|
12
|
+
import type { UTXO } from "../services/mempool-api.js";
|
|
13
|
+
import type { InscriptionData } from "./inscription-builder.js";
|
|
14
|
+
/**
|
|
15
|
+
* Parent inscription info from Xverse API lookup
|
|
16
|
+
*/
|
|
17
|
+
export interface ParentInscriptionInfo {
|
|
18
|
+
txid: string;
|
|
19
|
+
vout: number;
|
|
20
|
+
value: number;
|
|
21
|
+
address: string;
|
|
22
|
+
output: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options for deriving a child reveal script
|
|
26
|
+
*/
|
|
27
|
+
export interface DeriveChildRevealScriptOptions {
|
|
28
|
+
inscription: InscriptionData;
|
|
29
|
+
parentInscriptionId: string;
|
|
30
|
+
senderPubKey: Uint8Array;
|
|
31
|
+
network: Network;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for building a child commit transaction
|
|
35
|
+
*/
|
|
36
|
+
export interface BuildChildCommitTransactionOptions {
|
|
37
|
+
utxos: UTXO[];
|
|
38
|
+
inscription: InscriptionData;
|
|
39
|
+
parentInscriptionId: string;
|
|
40
|
+
feeRate: number;
|
|
41
|
+
senderPubKey: Uint8Array;
|
|
42
|
+
senderAddress: string;
|
|
43
|
+
network: Network;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Result from building a child commit transaction
|
|
47
|
+
*/
|
|
48
|
+
export interface BuildChildCommitTransactionResult {
|
|
49
|
+
tx: btc.Transaction;
|
|
50
|
+
fee: number;
|
|
51
|
+
revealAddress: string;
|
|
52
|
+
revealAmount: number;
|
|
53
|
+
revealScript: ReturnType<typeof btc.p2tr>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Options for building a child reveal transaction
|
|
57
|
+
*/
|
|
58
|
+
export interface BuildChildRevealTransactionOptions {
|
|
59
|
+
commitTxid: string;
|
|
60
|
+
commitVout: number;
|
|
61
|
+
commitAmount: number;
|
|
62
|
+
revealScript: ReturnType<typeof btc.p2tr>;
|
|
63
|
+
parentUtxo: {
|
|
64
|
+
txid: string;
|
|
65
|
+
vout: number;
|
|
66
|
+
value: number;
|
|
67
|
+
};
|
|
68
|
+
parentOwnerTaprootInternalPubKey: Uint8Array;
|
|
69
|
+
recipientAddress: string;
|
|
70
|
+
feeRate: number;
|
|
71
|
+
network: Network;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Result from building a child reveal transaction
|
|
75
|
+
*/
|
|
76
|
+
export interface BuildChildRevealTransactionResult {
|
|
77
|
+
tx: btc.Transaction;
|
|
78
|
+
fee: number;
|
|
79
|
+
outputAmount: number;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Derive the Taproot P2TR reveal script for a child inscription.
|
|
83
|
+
*
|
|
84
|
+
* Same as deriveRevealScript but includes the parent inscription ID tag,
|
|
85
|
+
* establishing provenance per the Ordinals spec.
|
|
86
|
+
*/
|
|
87
|
+
export declare function deriveChildRevealScript(options: DeriveChildRevealScriptOptions): ReturnType<typeof btc.p2tr>;
|
|
88
|
+
/**
|
|
89
|
+
* Build a commit transaction for a child inscription.
|
|
90
|
+
*
|
|
91
|
+
* Same logic as buildCommitTransaction but accounts for the extra input
|
|
92
|
+
* (parent UTXO) and extra output (parent return) in the reveal tx fee estimate.
|
|
93
|
+
*/
|
|
94
|
+
export declare function buildChildCommitTransaction(options: BuildChildCommitTransactionOptions): BuildChildCommitTransactionResult;
|
|
95
|
+
/**
|
|
96
|
+
* Build a child reveal transaction.
|
|
97
|
+
*
|
|
98
|
+
* 2 inputs, 2 outputs:
|
|
99
|
+
* Input[0]: Commit output (P2TR script-path spend with inscription witness)
|
|
100
|
+
* Input[1]: Parent UTXO (P2TR key-path spend)
|
|
101
|
+
* Output[0]: Parent return → owner's P2TR address (546 sats dust)
|
|
102
|
+
* Output[1]: Child inscription → recipient P2TR address (remaining sats)
|
|
103
|
+
*/
|
|
104
|
+
export declare function buildChildRevealTransaction(options: BuildChildRevealTransactionOptions): BuildChildRevealTransactionResult;
|
|
105
|
+
/**
|
|
106
|
+
* Look up a parent inscription's current UTXO location via Xverse API.
|
|
107
|
+
*
|
|
108
|
+
* @param inscriptionId - Inscription ID (e.g., "abc123...i0")
|
|
109
|
+
* @returns Parent inscription UTXO info
|
|
110
|
+
*/
|
|
111
|
+
export declare function lookupParentInscription(inscriptionId: string): Promise<ParentInscriptionInfo>;
|
|
112
|
+
//# sourceMappingURL=child-inscription-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-inscription-builder.d.ts","sourceRoot":"","sources":["../../src/transactions/child-inscription-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,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OAAO,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1C,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,gCAAgC,EAAE,UAAU,CAAC;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,EAAE,EAAE,GAAG,CAAC,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,8BAA8B,GACtC,UAAU,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CA6B7B;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,kCAAkC,GAC1C,iCAAiC,CAmJnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,kCAAkC,GAC1C,iCAAiC,CAmGnC;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,qBAAqB,CAAC,CAkChC"}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parent-child inscription transaction building
|
|
3
|
+
*
|
|
4
|
+
* Implements the commit/reveal pattern for child inscriptions per the
|
|
5
|
+
* Ordinals provenance spec (https://docs.ordinals.com/inscriptions/provenance.html).
|
|
6
|
+
*
|
|
7
|
+
* The owner of a parent inscription creates child inscriptions, establishing
|
|
8
|
+
* on-chain provenance. Uses micro-ordinals parent tag (tag 3) support.
|
|
9
|
+
*/
|
|
10
|
+
import * as btc from "@scure/btc-signer";
|
|
11
|
+
import { p2tr_ord_reveal } from "micro-ordinals";
|
|
12
|
+
import { P2WPKH_INPUT_VBYTES, P2WPKH_OUTPUT_VBYTES, P2TR_OUTPUT_VBYTES, P2TR_INPUT_BASE_VBYTES, TX_OVERHEAD_VBYTES, DUST_THRESHOLD, WITNESS_OVERHEAD_VBYTES, } from "../config/bitcoin-constants.js";
|
|
13
|
+
import { getBtcNetwork } from "./bitcoin-builder.js";
|
|
14
|
+
/**
|
|
15
|
+
* Derive the Taproot P2TR reveal script for a child inscription.
|
|
16
|
+
*
|
|
17
|
+
* Same as deriveRevealScript but includes the parent inscription ID tag,
|
|
18
|
+
* establishing provenance per the Ordinals spec.
|
|
19
|
+
*/
|
|
20
|
+
export function deriveChildRevealScript(options) {
|
|
21
|
+
const { inscription, parentInscriptionId, senderPubKey, network } = options;
|
|
22
|
+
const btcNetwork = getBtcNetwork(network);
|
|
23
|
+
// micro-ordinals handles parent tag encoding (tag 3) including txid byte
|
|
24
|
+
// reversal and index serialization. At runtime, TagCoders.parent.encode()
|
|
25
|
+
// accepts a string inscription ID, but the TS types resolve parent to
|
|
26
|
+
// Coder<string, Uint8Array> due to UnwrapCoder not unwrapping asymmetric coders.
|
|
27
|
+
const inscriptionData = {
|
|
28
|
+
tags: {
|
|
29
|
+
contentType: inscription.contentType,
|
|
30
|
+
parent: parentInscriptionId,
|
|
31
|
+
},
|
|
32
|
+
body: inscription.body,
|
|
33
|
+
};
|
|
34
|
+
// Convert compressed pubkey (33 bytes) to x-only pubkey (32 bytes) for Taproot
|
|
35
|
+
const xOnlyPubkey = senderPubKey.slice(1);
|
|
36
|
+
const revealScriptData = p2tr_ord_reveal(xOnlyPubkey, [inscriptionData]);
|
|
37
|
+
// Create P2TR output for script-path spending
|
|
38
|
+
const p2trReveal = btc.p2tr(xOnlyPubkey, revealScriptData, btcNetwork, true);
|
|
39
|
+
if (!p2trReveal.address) {
|
|
40
|
+
throw new Error("Failed to generate child reveal address");
|
|
41
|
+
}
|
|
42
|
+
return p2trReveal;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build a commit transaction for a child inscription.
|
|
46
|
+
*
|
|
47
|
+
* Same logic as buildCommitTransaction but accounts for the extra input
|
|
48
|
+
* (parent UTXO) and extra output (parent return) in the reveal tx fee estimate.
|
|
49
|
+
*/
|
|
50
|
+
export function buildChildCommitTransaction(options) {
|
|
51
|
+
const { utxos, inscription, parentInscriptionId, feeRate, senderPubKey, senderAddress, network, } = options;
|
|
52
|
+
if (utxos.length === 0) {
|
|
53
|
+
throw new Error("No UTXOs provided");
|
|
54
|
+
}
|
|
55
|
+
if (feeRate <= 0) {
|
|
56
|
+
throw new Error("Fee rate must be positive");
|
|
57
|
+
}
|
|
58
|
+
if (!inscription.contentType) {
|
|
59
|
+
throw new Error("Content type is required");
|
|
60
|
+
}
|
|
61
|
+
if (!inscription.body || inscription.body.length === 0) {
|
|
62
|
+
throw new Error("Content body is required");
|
|
63
|
+
}
|
|
64
|
+
if (senderPubKey.length !== 33) {
|
|
65
|
+
throw new Error("Sender public key must be 33 bytes (compressed)");
|
|
66
|
+
}
|
|
67
|
+
// Sort UTXOs by value descending for better coin selection
|
|
68
|
+
const sortedUtxos = [...utxos]
|
|
69
|
+
.filter((utxo) => utxo.status.confirmed)
|
|
70
|
+
.sort((a, b) => b.value - a.value);
|
|
71
|
+
if (sortedUtxos.length === 0) {
|
|
72
|
+
throw new Error("No confirmed UTXOs available");
|
|
73
|
+
}
|
|
74
|
+
// Derive the child reveal script
|
|
75
|
+
const p2trReveal = deriveChildRevealScript({
|
|
76
|
+
inscription,
|
|
77
|
+
parentInscriptionId,
|
|
78
|
+
senderPubKey,
|
|
79
|
+
network,
|
|
80
|
+
});
|
|
81
|
+
const btcNetwork = getBtcNetwork(network);
|
|
82
|
+
// Estimate reveal tx size: 2 inputs, 2 outputs
|
|
83
|
+
// Input[0]: commit output (Taproot script-path with inscription witness)
|
|
84
|
+
// Input[1]: parent UTXO (Taproot key-path: P2TR_INPUT_BASE_VBYTES)
|
|
85
|
+
// Output[0]: parent return (P2TR: P2TR_OUTPUT_VBYTES)
|
|
86
|
+
// Output[1]: child inscription recipient (P2TR: P2TR_OUTPUT_VBYTES)
|
|
87
|
+
const revealInputSize = P2TR_INPUT_BASE_VBYTES; // commit input
|
|
88
|
+
const parentInputSize = P2TR_INPUT_BASE_VBYTES; // parent key-path input
|
|
89
|
+
const revealWitnessSize = Math.ceil((inscription.body.length / 4) * 1.25) + WITNESS_OVERHEAD_VBYTES;
|
|
90
|
+
const revealTxSize = TX_OVERHEAD_VBYTES +
|
|
91
|
+
revealInputSize +
|
|
92
|
+
parentInputSize +
|
|
93
|
+
revealWitnessSize +
|
|
94
|
+
P2TR_OUTPUT_VBYTES * 2; // parent return + child output
|
|
95
|
+
const revealFee = Math.ceil(revealTxSize * feeRate);
|
|
96
|
+
// Amount to send to reveal address must cover reveal fee + dust for both outputs
|
|
97
|
+
const revealAmount = revealFee + DUST_THRESHOLD * 2 + 1000;
|
|
98
|
+
// Calculate total available
|
|
99
|
+
const totalAvailable = sortedUtxos.reduce((sum, utxo) => sum + utxo.value, 0);
|
|
100
|
+
// Estimate commit transaction size with change output
|
|
101
|
+
const estimatedVsize = TX_OVERHEAD_VBYTES +
|
|
102
|
+
sortedUtxos.length * P2WPKH_INPUT_VBYTES +
|
|
103
|
+
P2TR_OUTPUT_VBYTES + // Reveal output
|
|
104
|
+
P2WPKH_OUTPUT_VBYTES; // Change output
|
|
105
|
+
const estimatedFee = Math.ceil(estimatedVsize * feeRate);
|
|
106
|
+
const requiredTotal = revealAmount + estimatedFee;
|
|
107
|
+
if (totalAvailable < requiredTotal) {
|
|
108
|
+
throw new Error(`Insufficient funds: have ${totalAvailable} sats, need ${requiredTotal} sats (${revealAmount} reveal + ${estimatedFee} commit fee)`);
|
|
109
|
+
}
|
|
110
|
+
// Select UTXOs
|
|
111
|
+
let selectedTotal = 0;
|
|
112
|
+
const selectedUtxos = [];
|
|
113
|
+
for (const utxo of sortedUtxos) {
|
|
114
|
+
selectedUtxos.push(utxo);
|
|
115
|
+
selectedTotal += utxo.value;
|
|
116
|
+
if (selectedTotal >= requiredTotal) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// Final calculation
|
|
121
|
+
const finalVsize = TX_OVERHEAD_VBYTES +
|
|
122
|
+
selectedUtxos.length * P2WPKH_INPUT_VBYTES +
|
|
123
|
+
P2TR_OUTPUT_VBYTES +
|
|
124
|
+
P2WPKH_OUTPUT_VBYTES;
|
|
125
|
+
const finalFee = Math.ceil(finalVsize * feeRate);
|
|
126
|
+
const changeAmount = selectedTotal - revealAmount - finalFee;
|
|
127
|
+
if (selectedTotal < revealAmount + finalFee) {
|
|
128
|
+
throw new Error(`Insufficient funds after UTXO selection: have ${selectedTotal} sats, need ${revealAmount + finalFee} sats`);
|
|
129
|
+
}
|
|
130
|
+
if (changeAmount < DUST_THRESHOLD) {
|
|
131
|
+
throw new Error(`Change amount ${changeAmount} is below dust threshold (${DUST_THRESHOLD} sats). Need more UTXOs or lower fee rate.`);
|
|
132
|
+
}
|
|
133
|
+
// Build the commit transaction
|
|
134
|
+
const tx = new btc.Transaction();
|
|
135
|
+
const senderP2wpkh = btc.p2wpkh(senderPubKey, btcNetwork);
|
|
136
|
+
for (const utxo of selectedUtxos) {
|
|
137
|
+
tx.addInput({
|
|
138
|
+
txid: utxo.txid,
|
|
139
|
+
index: utxo.vout,
|
|
140
|
+
witnessUtxo: {
|
|
141
|
+
script: senderP2wpkh.script,
|
|
142
|
+
amount: BigInt(utxo.value),
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
// Reveal output (Taproot address from child reveal script)
|
|
147
|
+
tx.addOutputAddress(p2trReveal.address, BigInt(revealAmount), btcNetwork);
|
|
148
|
+
// Change output
|
|
149
|
+
tx.addOutputAddress(senderAddress, BigInt(changeAmount), btcNetwork);
|
|
150
|
+
return {
|
|
151
|
+
tx,
|
|
152
|
+
fee: finalFee,
|
|
153
|
+
revealAddress: p2trReveal.address,
|
|
154
|
+
revealAmount,
|
|
155
|
+
revealScript: p2trReveal,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Build a child reveal transaction.
|
|
160
|
+
*
|
|
161
|
+
* 2 inputs, 2 outputs:
|
|
162
|
+
* Input[0]: Commit output (P2TR script-path spend with inscription witness)
|
|
163
|
+
* Input[1]: Parent UTXO (P2TR key-path spend)
|
|
164
|
+
* Output[0]: Parent return → owner's P2TR address (546 sats dust)
|
|
165
|
+
* Output[1]: Child inscription → recipient P2TR address (remaining sats)
|
|
166
|
+
*/
|
|
167
|
+
export function buildChildRevealTransaction(options) {
|
|
168
|
+
const { commitTxid, commitVout, commitAmount, revealScript, parentUtxo, parentOwnerTaprootInternalPubKey, recipientAddress, feeRate, network, } = options;
|
|
169
|
+
if (!commitTxid || commitTxid.length !== 64) {
|
|
170
|
+
throw new Error("Invalid commit transaction ID");
|
|
171
|
+
}
|
|
172
|
+
if (commitVout < 0) {
|
|
173
|
+
throw new Error("Invalid commit output index");
|
|
174
|
+
}
|
|
175
|
+
if (commitAmount <= 0) {
|
|
176
|
+
throw new Error("Commit amount must be positive");
|
|
177
|
+
}
|
|
178
|
+
if (feeRate <= 0) {
|
|
179
|
+
throw new Error("Fee rate must be positive");
|
|
180
|
+
}
|
|
181
|
+
// Estimate reveal transaction size
|
|
182
|
+
const revealInputSize = P2TR_INPUT_BASE_VBYTES; // commit input
|
|
183
|
+
const parentInputSize = P2TR_INPUT_BASE_VBYTES; // parent key-path input
|
|
184
|
+
const revealWitnessSize = Math.ceil((revealScript.script?.byteLength || 0) / 4);
|
|
185
|
+
const revealTxSize = TX_OVERHEAD_VBYTES +
|
|
186
|
+
revealInputSize +
|
|
187
|
+
parentInputSize +
|
|
188
|
+
revealWitnessSize +
|
|
189
|
+
P2TR_OUTPUT_VBYTES * 2; // parent return + child output
|
|
190
|
+
const revealFee = Math.ceil(revealTxSize * feeRate);
|
|
191
|
+
// Total available from commit output + parent UTXO value
|
|
192
|
+
const totalInput = commitAmount + parentUtxo.value;
|
|
193
|
+
const parentReturnAmount = DUST_THRESHOLD; // 546 sats back to parent owner
|
|
194
|
+
const childOutputAmount = totalInput - revealFee - parentReturnAmount;
|
|
195
|
+
if (childOutputAmount < DUST_THRESHOLD) {
|
|
196
|
+
throw new Error(`Child output amount ${childOutputAmount} is below dust threshold (${DUST_THRESHOLD} sats)`);
|
|
197
|
+
}
|
|
198
|
+
// Build the reveal transaction
|
|
199
|
+
const btcNetwork = getBtcNetwork(network);
|
|
200
|
+
const tx = new btc.Transaction({
|
|
201
|
+
allowUnknownOutputs: true,
|
|
202
|
+
allowUnknownInputs: true,
|
|
203
|
+
});
|
|
204
|
+
// Input[0]: Commit output (script-path spend with inscription witness)
|
|
205
|
+
tx.addInput({
|
|
206
|
+
txid: commitTxid,
|
|
207
|
+
index: commitVout,
|
|
208
|
+
witnessUtxo: {
|
|
209
|
+
script: revealScript.script,
|
|
210
|
+
amount: BigInt(commitAmount),
|
|
211
|
+
},
|
|
212
|
+
tapLeafScript: revealScript.tapLeafScript,
|
|
213
|
+
});
|
|
214
|
+
// Input[1]: Parent UTXO (key-path spend)
|
|
215
|
+
const parentP2tr = btc.p2tr(parentOwnerTaprootInternalPubKey, undefined, btcNetwork);
|
|
216
|
+
tx.addInput({
|
|
217
|
+
txid: parentUtxo.txid,
|
|
218
|
+
index: parentUtxo.vout,
|
|
219
|
+
witnessUtxo: {
|
|
220
|
+
script: parentP2tr.script,
|
|
221
|
+
amount: BigInt(parentUtxo.value),
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
// Output[0]: Parent return → owner's P2TR address (dust)
|
|
225
|
+
tx.addOutputAddress(parentP2tr.address, BigInt(parentReturnAmount), btcNetwork);
|
|
226
|
+
// Output[1]: Child inscription → recipient P2TR address
|
|
227
|
+
tx.addOutputAddress(recipientAddress, BigInt(childOutputAmount), btcNetwork);
|
|
228
|
+
return {
|
|
229
|
+
tx,
|
|
230
|
+
fee: revealFee,
|
|
231
|
+
outputAmount: childOutputAmount,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Look up a parent inscription's current UTXO location via Xverse API.
|
|
236
|
+
*
|
|
237
|
+
* @param inscriptionId - Inscription ID (e.g., "abc123...i0")
|
|
238
|
+
* @returns Parent inscription UTXO info
|
|
239
|
+
*/
|
|
240
|
+
export async function lookupParentInscription(inscriptionId) {
|
|
241
|
+
const url = `https://api-3.xverse.app/v1/ordinals/inscriptions/${inscriptionId}`;
|
|
242
|
+
const response = await fetch(url);
|
|
243
|
+
if (!response.ok) {
|
|
244
|
+
throw new Error(`Failed to look up inscription ${inscriptionId}: ${response.status} ${response.statusText}`);
|
|
245
|
+
}
|
|
246
|
+
const data = (await response.json());
|
|
247
|
+
if (!data.tx_id || !data.output || data.value === undefined || !data.address) {
|
|
248
|
+
throw new Error(`Inscription ${inscriptionId} not found or missing UTXO data`);
|
|
249
|
+
}
|
|
250
|
+
// Xverse returns output as "txid:vout" — parse vout from it
|
|
251
|
+
const outputParts = data.output.split(":");
|
|
252
|
+
const vout = parseInt(outputParts[1], 10);
|
|
253
|
+
return {
|
|
254
|
+
txid: data.tx_id,
|
|
255
|
+
vout,
|
|
256
|
+
value: data.value,
|
|
257
|
+
address: data.address,
|
|
258
|
+
output: data.output,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=child-inscription-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child-inscription-builder.js","sourceRoot":"","sources":["../../src/transactions/child-inscription-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EACd,uBAAuB,GACxB,MA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EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.1",
|
|
4
4
|
"description": "Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.",
|
|
5
5
|
"mcpName": "io.github.aibtcdev/mcp-server",
|
|
6
6
|
"type": "module",
|
package/skill/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Bitcoin L1 wallet for agents - check balances, send BTC, manage UTX
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: aibtcdev
|
|
7
|
-
version: 1.
|
|
7
|
+
version: 1.32.1 # x-release-please-version
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|