@atomicfinance/bitcoin-ddk-provider 4.1.12 → 4.2.0
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +27 -0
- package/dist/BitcoinDdkProvider.d.ts +28 -23
- package/dist/BitcoinDdkProvider.js +219 -349
- package/dist/BitcoinDdkProvider.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/Utils.d.ts +66 -1
- package/dist/utils/Utils.js +255 -0
- package/dist/utils/Utils.js.map +1 -1
- package/lib/BitcoinDdkProvider.ts +394 -449
- package/lib/index.ts +1 -0
- package/lib/utils/Utils.ts +332 -0
- package/package.json +5 -5
package/dist/utils/Utils.js
CHANGED
|
@@ -8,7 +8,18 @@ exports.generateSerialId = generateSerialId;
|
|
|
8
8
|
exports.generateSerialIds = generateSerialIds;
|
|
9
9
|
exports.checkTypes = checkTypes;
|
|
10
10
|
exports.outputsToPayouts = outputsToPayouts;
|
|
11
|
+
exports.orderPubkeysLexicographically = orderPubkeysLexicographically;
|
|
12
|
+
exports.createP2WSHMultisig = createP2WSHMultisig;
|
|
13
|
+
exports.createP2MSMultisig = createP2MSMultisig;
|
|
14
|
+
exports.createP2WSHMultisigFromOrdered = createP2WSHMultisigFromOrdered;
|
|
15
|
+
exports.createMultisigScript = createMultisigScript;
|
|
16
|
+
exports.ensureBuffer = ensureBuffer;
|
|
17
|
+
exports.ensureDerSignature = ensureDerSignature;
|
|
18
|
+
exports.ensureCompactSignature = ensureCompactSignature;
|
|
19
|
+
exports.computeContractId = computeContractId;
|
|
20
|
+
exports.sortFundingInputsBySerialId = sortFundingInputsBySerialId;
|
|
11
21
|
const messaging_1 = require("@node-dlc/messaging");
|
|
22
|
+
const bitcoinjs_lib_1 = require("bitcoinjs-lib");
|
|
12
23
|
const randombytes_1 = __importDefault(require("randombytes"));
|
|
13
24
|
const asyncForEach = async (
|
|
14
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -79,4 +90,248 @@ function outputsToPayouts(outputs, rValuesMessagesList, localCollateral, remoteC
|
|
|
79
90
|
});
|
|
80
91
|
return { payouts, messagesList };
|
|
81
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Orders public keys lexicographically for consistent multisig script creation.
|
|
95
|
+
* This ensures deterministic ordering regardless of which party creates the script.
|
|
96
|
+
*
|
|
97
|
+
* @param pubkey1 First public key buffer
|
|
98
|
+
* @param pubkey2 Second public key buffer
|
|
99
|
+
* @returns Array of public keys in lexicographic order [smaller, larger]
|
|
100
|
+
*/
|
|
101
|
+
function orderPubkeysLexicographically(pubkey1, pubkey2) {
|
|
102
|
+
return Buffer.compare(pubkey1, pubkey2) === -1
|
|
103
|
+
? [pubkey1, pubkey2]
|
|
104
|
+
: [pubkey2, pubkey1];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a 2-of-2 P2WSH multisig payment variant with lexicographically ordered pubkeys.
|
|
108
|
+
* This is the standard pattern used for DLC funding scripts.
|
|
109
|
+
*
|
|
110
|
+
* @param pubkey1 First public key buffer
|
|
111
|
+
* @param pubkey2 Second public key buffer
|
|
112
|
+
* @param network Bitcoin network
|
|
113
|
+
* @returns Payment variant with P2WSH multisig script
|
|
114
|
+
*/
|
|
115
|
+
function createP2WSHMultisig(pubkey1, pubkey2, network) {
|
|
116
|
+
const orderedPubkeys = orderPubkeysLexicographically(pubkey1, pubkey2);
|
|
117
|
+
const p2ms = bitcoinjs_lib_1.payments.p2ms({
|
|
118
|
+
m: 2,
|
|
119
|
+
pubkeys: orderedPubkeys,
|
|
120
|
+
network,
|
|
121
|
+
});
|
|
122
|
+
return bitcoinjs_lib_1.payments.p2wsh({
|
|
123
|
+
redeem: p2ms,
|
|
124
|
+
network,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function createP2MSMultisig(pubkey1, pubkey2, network) {
|
|
128
|
+
const orderedPubkeys = orderPubkeysLexicographically(pubkey1, pubkey2);
|
|
129
|
+
return bitcoinjs_lib_1.payments.p2ms({
|
|
130
|
+
m: 2,
|
|
131
|
+
pubkeys: orderedPubkeys,
|
|
132
|
+
network,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Creates a 2-of-2 P2WSH multisig payment variant from pre-ordered pubkeys.
|
|
137
|
+
* Use this when you already have the pubkeys in the correct order.
|
|
138
|
+
*
|
|
139
|
+
* @param orderedPubkeys Array of public key buffers in the desired order
|
|
140
|
+
* @param network Bitcoin network
|
|
141
|
+
* @returns Payment variant with P2WSH multisig script
|
|
142
|
+
*/
|
|
143
|
+
function createP2WSHMultisigFromOrdered(orderedPubkeys, network) {
|
|
144
|
+
const p2ms = bitcoinjs_lib_1.payments.p2ms({
|
|
145
|
+
m: 2,
|
|
146
|
+
pubkeys: orderedPubkeys,
|
|
147
|
+
network,
|
|
148
|
+
});
|
|
149
|
+
return bitcoinjs_lib_1.payments.p2wsh({
|
|
150
|
+
redeem: p2ms,
|
|
151
|
+
network,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Creates a 2-of-2 multisig script (P2MS) from lexicographically ordered pubkeys.
|
|
156
|
+
* Returns just the multisig script, not wrapped in P2WSH.
|
|
157
|
+
*
|
|
158
|
+
* @param pubkey1 First public key buffer
|
|
159
|
+
* @param pubkey2 Second public key buffer
|
|
160
|
+
* @param network Bitcoin network
|
|
161
|
+
* @returns Multisig payment script
|
|
162
|
+
*/
|
|
163
|
+
function createMultisigScript(pubkey1, pubkey2, network) {
|
|
164
|
+
const orderedPubkeys = orderPubkeysLexicographically(pubkey1, pubkey2);
|
|
165
|
+
return bitcoinjs_lib_1.payments.p2ms({
|
|
166
|
+
m: 2,
|
|
167
|
+
pubkeys: orderedPubkeys,
|
|
168
|
+
network,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Helper function to ensure we have a Buffer object
|
|
173
|
+
* Handles cases where Buffer objects have been serialized/deserialized
|
|
174
|
+
*/
|
|
175
|
+
function ensureBuffer(bufferLike) {
|
|
176
|
+
if (Buffer.isBuffer(bufferLike)) {
|
|
177
|
+
return bufferLike;
|
|
178
|
+
}
|
|
179
|
+
if (bufferLike && bufferLike.type === 'Buffer' && bufferLike.data) {
|
|
180
|
+
return Buffer.from(bufferLike.data);
|
|
181
|
+
}
|
|
182
|
+
return bufferLike;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Detect if signature is in compact format (64 bytes) or DER format
|
|
186
|
+
* and convert compact to DER if needed, adding SIGHASH_ALL flag
|
|
187
|
+
*/
|
|
188
|
+
function ensureDerSignature(signature) {
|
|
189
|
+
// If signature is 64 bytes, it's likely compact format (32-byte r + 32-byte s)
|
|
190
|
+
if (signature.length === 64) {
|
|
191
|
+
// Convert compact signature to DER format
|
|
192
|
+
const r = signature.subarray(0, 32);
|
|
193
|
+
const s = signature.subarray(32, 64);
|
|
194
|
+
// Create DER encoding manually
|
|
195
|
+
// DER format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
|
|
196
|
+
// Remove leading zeros from r and s, but keep at least one byte
|
|
197
|
+
let rBytes = r;
|
|
198
|
+
while (rBytes.length > 1 &&
|
|
199
|
+
rBytes[0] === 0x00 &&
|
|
200
|
+
(rBytes[1] & 0x80) === 0) {
|
|
201
|
+
rBytes = rBytes.subarray(1);
|
|
202
|
+
}
|
|
203
|
+
let sBytes = s;
|
|
204
|
+
while (sBytes.length > 1 &&
|
|
205
|
+
sBytes[0] === 0x00 &&
|
|
206
|
+
(sBytes[1] & 0x80) === 0) {
|
|
207
|
+
sBytes = sBytes.subarray(1);
|
|
208
|
+
}
|
|
209
|
+
// Add padding byte if high bit is set (to keep numbers positive)
|
|
210
|
+
if ((rBytes[0] & 0x80) !== 0) {
|
|
211
|
+
rBytes = Buffer.concat([Buffer.from([0x00]), rBytes]);
|
|
212
|
+
}
|
|
213
|
+
if ((sBytes[0] & 0x80) !== 0) {
|
|
214
|
+
sBytes = Buffer.concat([Buffer.from([0x00]), sBytes]);
|
|
215
|
+
}
|
|
216
|
+
const totalLength = 2 + rBytes.length + 2 + sBytes.length;
|
|
217
|
+
const derSignature = Buffer.concat([
|
|
218
|
+
Buffer.from([0x30, totalLength]), // SEQUENCE tag and total length
|
|
219
|
+
Buffer.from([0x02, rBytes.length]), // INTEGER tag and R length
|
|
220
|
+
rBytes,
|
|
221
|
+
Buffer.from([0x02, sBytes.length]), // INTEGER tag and S length
|
|
222
|
+
sBytes,
|
|
223
|
+
Buffer.from([0x01]), // SIGHASH_ALL flag
|
|
224
|
+
]);
|
|
225
|
+
return derSignature;
|
|
226
|
+
}
|
|
227
|
+
// If it's already DER format, check if it has SIGHASH flag
|
|
228
|
+
if (signature.length > 0 && signature[0] === 0x30) {
|
|
229
|
+
// Check if it already has a SIGHASH flag (last byte should be 0x01 for SIGHASH_ALL)
|
|
230
|
+
if (signature[signature.length - 1] !== 0x01) {
|
|
231
|
+
// Add SIGHASH_ALL flag
|
|
232
|
+
return Buffer.concat([signature, Buffer.from([0x01])]);
|
|
233
|
+
}
|
|
234
|
+
return signature;
|
|
235
|
+
}
|
|
236
|
+
// For other formats, return as-is
|
|
237
|
+
return signature;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Detect if signature is in DER format and convert to compact format (64 bytes)
|
|
241
|
+
* by extracting r and s values, removing SIGHASH flag if present
|
|
242
|
+
*/
|
|
243
|
+
function ensureCompactSignature(signature) {
|
|
244
|
+
// If signature is already 64 bytes, it's likely already compact format
|
|
245
|
+
if (signature.length === 64) {
|
|
246
|
+
return signature;
|
|
247
|
+
}
|
|
248
|
+
// Check if it's DER format (starts with 0x30)
|
|
249
|
+
if (signature.length > 6 && signature[0] === 0x30) {
|
|
250
|
+
let derSig = signature;
|
|
251
|
+
// Remove SIGHASH flag if present (last byte is typically 0x01 for SIGHASH_ALL)
|
|
252
|
+
if (signature[signature.length - 1] === 0x01) {
|
|
253
|
+
derSig = signature.subarray(0, -1);
|
|
254
|
+
}
|
|
255
|
+
// Parse DER format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]
|
|
256
|
+
if (derSig[0] !== 0x30) {
|
|
257
|
+
throw new Error('Invalid DER signature: missing SEQUENCE tag');
|
|
258
|
+
}
|
|
259
|
+
const totalLength = derSig[1];
|
|
260
|
+
if (derSig.length < totalLength + 2) {
|
|
261
|
+
throw new Error('Invalid DER signature: length mismatch');
|
|
262
|
+
}
|
|
263
|
+
let offset = 2;
|
|
264
|
+
// Parse R value
|
|
265
|
+
if (derSig[offset] !== 0x02) {
|
|
266
|
+
throw new Error('Invalid DER signature: missing INTEGER tag for R');
|
|
267
|
+
}
|
|
268
|
+
offset++;
|
|
269
|
+
const rLength = derSig[offset];
|
|
270
|
+
offset++;
|
|
271
|
+
if (offset + rLength > derSig.length) {
|
|
272
|
+
throw new Error('Invalid DER signature: R length exceeds signature length');
|
|
273
|
+
}
|
|
274
|
+
let rBytes = derSig.subarray(offset, offset + rLength);
|
|
275
|
+
offset += rLength;
|
|
276
|
+
// Parse S value
|
|
277
|
+
if (derSig[offset] !== 0x02) {
|
|
278
|
+
throw new Error('Invalid DER signature: missing INTEGER tag for S');
|
|
279
|
+
}
|
|
280
|
+
offset++;
|
|
281
|
+
const sLength = derSig[offset];
|
|
282
|
+
offset++;
|
|
283
|
+
if (offset + sLength > derSig.length) {
|
|
284
|
+
throw new Error('Invalid DER signature: S length exceeds signature length');
|
|
285
|
+
}
|
|
286
|
+
let sBytes = derSig.subarray(offset, offset + sLength);
|
|
287
|
+
// Remove leading zero padding from r and s (DER may pad to prevent negative interpretation)
|
|
288
|
+
while (rBytes.length > 1 && rBytes[0] === 0x00) {
|
|
289
|
+
rBytes = rBytes.subarray(1);
|
|
290
|
+
}
|
|
291
|
+
while (sBytes.length > 1 && sBytes[0] === 0x00) {
|
|
292
|
+
sBytes = sBytes.subarray(1);
|
|
293
|
+
}
|
|
294
|
+
// Pad to 32 bytes each (compact format requires exactly 32 bytes for r and s)
|
|
295
|
+
while (rBytes.length < 32) {
|
|
296
|
+
rBytes = Buffer.concat([Buffer.from([0x00]), rBytes]);
|
|
297
|
+
}
|
|
298
|
+
while (sBytes.length < 32) {
|
|
299
|
+
sBytes = Buffer.concat([Buffer.from([0x00]), sBytes]);
|
|
300
|
+
}
|
|
301
|
+
if (rBytes.length !== 32 || sBytes.length !== 32) {
|
|
302
|
+
throw new Error('Invalid signature values: r or s exceeds 32 bytes');
|
|
303
|
+
}
|
|
304
|
+
// Combine r and s into 64-byte compact format
|
|
305
|
+
return Buffer.concat([rBytes, sBytes]);
|
|
306
|
+
}
|
|
307
|
+
// For other formats, throw error as we can't convert
|
|
308
|
+
throw new Error('Unable to convert signature to compact format: unknown format');
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Compute contract ID from fund transaction ID, output index, and temporary contract ID
|
|
312
|
+
* Matches the Rust implementation in rust-dlc
|
|
313
|
+
*/
|
|
314
|
+
function computeContractId(fundTxId, fundOutputIndex, temporaryContractId) {
|
|
315
|
+
if (fundTxId.length !== 32) {
|
|
316
|
+
throw new Error('Fund transaction ID must be 32 bytes');
|
|
317
|
+
}
|
|
318
|
+
if (temporaryContractId.length !== 32) {
|
|
319
|
+
throw new Error('Temporary contract ID must be 32 bytes');
|
|
320
|
+
}
|
|
321
|
+
if (fundOutputIndex > 0xffff) {
|
|
322
|
+
throw new Error('Fund output index must fit in 16 bits');
|
|
323
|
+
}
|
|
324
|
+
const result = Buffer.alloc(32);
|
|
325
|
+
// XOR fund_tx_id with temporary_id, with byte order reversal for fund_tx_id
|
|
326
|
+
for (let i = 0; i < 32; i++) {
|
|
327
|
+
result[i] = fundTxId[31 - i] ^ temporaryContractId[i];
|
|
328
|
+
}
|
|
329
|
+
// XOR the fund output index into the last two bytes
|
|
330
|
+
result[30] ^= (fundOutputIndex >> 8) & 0xff; // High byte
|
|
331
|
+
result[31] ^= fundOutputIndex & 0xff; // Low byte
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
function sortFundingInputsBySerialId(inputs) {
|
|
335
|
+
return inputs.sort((a, b) => Number(a.inputSerialId) - Number(b.inputSerialId));
|
|
336
|
+
}
|
|
82
337
|
//# sourceMappingURL=Utils.js.map
|
package/dist/utils/Utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../lib/utils/Utils.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../lib/utils/Utils.ts"],"names":[],"mappings":";;;;;;AA0BA,4CAEC;AAED,8CAEC;AAED,gCA0BC;AAED,4CAiCC;AAoCD,sEAOC;AAWD,kDAiBC;AAED,gDAYC;AAUD,wEAcC;AAWD,oDAYC;AAMD,oCAUC;AAMD,gDA+DC;AAMD,wDA0FC;AAMD,8CA2BC;AAED,kEAMC;AAhcD,mDAQ6B;AAE7B,iDAAyC;AAEzC,8DAAsC;AAE/B,MAAM,YAAY,GAAG,KAAK;AAC/B,8DAA8D;AAC9D,KAAU;AACV,8DAA8D;AAC9D,QAAa,EACE,EAAE;IACjB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAClD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC,CAAC;AATW,QAAA,YAAY,gBASvB;AAEF,SAAgB,gBAAgB;IAC9B,OAAO,IAAA,qBAAW,EAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AACnE,C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