utxo-lib 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/base_crypto.d.ts +14 -0
- package/dist/src/base_crypto.d.ts.map +1 -0
- package/dist/src/base_crypto.js +215 -0
- package/dist/src/bitgo/Musig2.js +2 -3
- package/dist/src/bitgo/UtxoPsbt.js +12 -20
- package/dist/src/bitgo/UtxoTransaction.js +2 -2
- package/dist/src/bitgo/outputScripts.js +3 -3
- package/dist/src/bitgo/parseInput.js +2 -2
- package/dist/src/bitgo/psbt/scriptTypes.js +3 -3
- package/dist/src/bitgo/wallet/chains.d.ts +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +2 -3
- package/dist/src/bitgo/zcash/ZcashTransaction.js +2 -2
- package/dist/src/musig.d.ts +391 -0
- package/dist/src/musig.d.ts.map +1 -0
- package/dist/src/musig.js +461 -0
- package/dist/src/noble_ecc.d.ts +1 -1
- package/dist/src/noble_ecc.d.ts.map +1 -1
- package/dist/src/noble_ecc.js +5 -5
- package/dist/src/payments/p2tr.js +9 -13
- package/dist/src/payments/p2tr_ns.js +2 -3
- package/dist/src/taproot.js +2 -3
- package/dist/src/transaction_builder.js +2 -2
- package/package.json +1 -2
@@ -125,9 +125,8 @@ class UtxoPsbt extends __1.Psbt {
|
|
125
125
|
}
|
126
126
|
checkForSignatures(propName) {
|
127
127
|
this.data.inputs.forEach((input) => {
|
128
|
-
|
129
|
-
|
130
|
-
throw new Error(`Cannot modify ${propName !== null && propName !== void 0 ? propName : 'transaction'} - signatures exist.`);
|
128
|
+
if (input.tapScriptSig?.length || input.tapKeySig || input.partialSig?.length) {
|
129
|
+
throw new Error(`Cannot modify ${propName ?? 'transaction'} - signatures exist.`);
|
131
130
|
}
|
132
131
|
});
|
133
132
|
}
|
@@ -137,23 +136,21 @@ class UtxoPsbt extends __1.Psbt {
|
|
137
136
|
finalizeAllInputs() {
|
138
137
|
utils_1.checkForInput(this.data.inputs, 0); // making sure we have at least one
|
139
138
|
this.data.inputs.map((input, idx) => {
|
140
|
-
|
141
|
-
return ((_a = input.tapScriptSig) === null || _a === void 0 ? void 0 : _a.length) ? this.finalizeTaprootInput(idx) : this.finalizeInput(idx);
|
139
|
+
return input.tapScriptSig?.length ? this.finalizeTaprootInput(idx) : this.finalizeInput(idx);
|
142
140
|
});
|
143
141
|
return this;
|
144
142
|
}
|
145
143
|
finalizeTaprootInput(inputIndex) {
|
146
|
-
var _a, _b;
|
147
144
|
const input = utils_1.checkForInput(this.data.inputs, inputIndex);
|
148
145
|
// witness = control-block script first-sig second-sig
|
149
|
-
if (
|
146
|
+
if (input.tapLeafScript?.length !== 1) {
|
150
147
|
throw new Error('Only one leaf script supported for finalizing');
|
151
148
|
}
|
152
149
|
const { controlBlock, script } = input.tapLeafScript[0];
|
153
150
|
const witness = [script, controlBlock];
|
154
151
|
const [pubkey1, pubkey2] = parseInput_1.parsePubScript(script, 'p2tr').publicKeys;
|
155
152
|
for (const pk of [pubkey1, pubkey2]) {
|
156
|
-
const sig =
|
153
|
+
const sig = input.tapScriptSig?.find(({ pubkey }) => pubkey.equals(pk));
|
157
154
|
if (!sig) {
|
158
155
|
throw new Error('Could not find signatures in Script Sig.');
|
159
156
|
}
|
@@ -168,12 +165,11 @@ class UtxoPsbt extends __1.Psbt {
|
|
168
165
|
return this;
|
169
166
|
}
|
170
167
|
finalizeTapInputWithSingleLeafScriptAndSignature(inputIndex) {
|
171
|
-
var _a, _b;
|
172
168
|
const input = utils_1.checkForInput(this.data.inputs, inputIndex);
|
173
|
-
if (
|
169
|
+
if (input.tapLeafScript?.length !== 1) {
|
174
170
|
throw new Error('Only one leaf script supported for finalizing');
|
175
171
|
}
|
176
|
-
if (
|
172
|
+
if (input.tapScriptSig?.length !== 1) {
|
177
173
|
throw new Error('Could not find signatures in Script Sig.');
|
178
174
|
}
|
179
175
|
const { controlBlock, script } = input.tapLeafScript[0];
|
@@ -196,8 +192,7 @@ class UtxoPsbt extends __1.Psbt {
|
|
196
192
|
validateSignaturesOfAllInputs() {
|
197
193
|
utils_1.checkForInput(this.data.inputs, 0); // making sure we have at least one
|
198
194
|
const results = this.data.inputs.map((input, idx) => {
|
199
|
-
|
200
|
-
return ((_a = input.tapScriptSig) === null || _a === void 0 ? void 0 : _a.length)
|
195
|
+
return input.tapScriptSig?.length
|
201
196
|
? this.validateTaprootSignaturesOfInput(idx)
|
202
197
|
: this.validateSignaturesOfInput(idx, (p, m, s) => __1.ecc.verify(m, p, s));
|
203
198
|
});
|
@@ -243,10 +238,9 @@ class UtxoPsbt extends __1.Psbt {
|
|
243
238
|
* If no signature in the tx or no public key matching signature, the validation is considered as false.
|
244
239
|
*/
|
245
240
|
getSignatureValidationArray(inputIndex) {
|
246
|
-
var _a;
|
247
241
|
const noSigErrorMessages = ['No signatures to validate', 'No signatures for this pubkey'];
|
248
242
|
const input = utils_1.checkForInput(this.data.inputs, inputIndex);
|
249
|
-
const isP2tr =
|
243
|
+
const isP2tr = input.tapScriptSig?.length;
|
250
244
|
if (!this.data.globalMap.globalXpub) {
|
251
245
|
throw new Error('Cannot get signature validation array without global xpubs');
|
252
246
|
}
|
@@ -274,14 +268,13 @@ class UtxoPsbt extends __1.Psbt {
|
|
274
268
|
* Mostly copied from bitcoinjs-lib/ts_src/psbt.ts
|
275
269
|
*/
|
276
270
|
signAllInputsHD(hdKeyPair, sighashTypes = [__1.Transaction.SIGHASH_DEFAULT, __1.Transaction.SIGHASH_ALL]) {
|
277
|
-
var _a;
|
278
271
|
if (!hdKeyPair || !hdKeyPair.publicKey || !hdKeyPair.fingerprint) {
|
279
272
|
throw new Error('Need HDSigner to sign input');
|
280
273
|
}
|
281
274
|
const results = [];
|
282
275
|
for (let i = 0; i < this.data.inputs.length; i++) {
|
283
276
|
try {
|
284
|
-
if (
|
277
|
+
if (this.data.inputs[i].tapBip32Derivation?.length) {
|
285
278
|
this.signTaprootInputHD(i, hdKeyPair, sighashTypes);
|
286
279
|
}
|
287
280
|
else {
|
@@ -330,11 +323,10 @@ class UtxoPsbt extends __1.Psbt {
|
|
330
323
|
return this;
|
331
324
|
}
|
332
325
|
signTaprootInput(inputIndex, signer, leafHashes, sighashTypes = [__1.Transaction.SIGHASH_DEFAULT, __1.Transaction.SIGHASH_ALL]) {
|
333
|
-
var _a;
|
334
326
|
const pubkey = outputScripts_1.toXOnlyPublicKey(signer.publicKey);
|
335
327
|
const input = utils_1.checkForInput(this.data.inputs, inputIndex);
|
336
328
|
// Figure out if this is script path or not, if not, tweak the private key
|
337
|
-
if (!
|
329
|
+
if (!input.tapLeafScript?.length) {
|
338
330
|
// See BitGo/BitGoJS/modules/utxo_lib/src/transaction_builder.ts:trySign for how to support it.
|
339
331
|
throw new Error('Taproot key path signing is not supported.');
|
340
332
|
}
|
@@ -466,4 +458,4 @@ class UtxoPsbt extends __1.Psbt {
|
|
466
458
|
}
|
467
459
|
}
|
468
460
|
exports.UtxoPsbt = UtxoPsbt;
|
469
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXR4b1BzYnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYml0Z28vVXR4b1BzYnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsbUNBQTBDO0FBRTFDLGdEQUFxRDtBQUNyRCwrREFBc0U7QUFFdEUsMEJBVVk7QUFDWix1REFBb0Q7QUFDcEQsdUNBQWdEO0FBQ2hELG9EQUE4QztBQUM5QywwREFBK0M7QUFDL0MsbURBQW1EO0FBQ25ELDZDQUE4QztBQUM5QyxpQ0FBcUM7QUFDckMsdUNBQXVDO0FBQ3ZDLHdFQUE4RztBQUVqRyxRQUFBLDJCQUEyQixHQUFHLE9BQU8sQ0FBQztBQUVuRCxJQUFZLHFCQUlYO0FBSkQsV0FBWSxxQkFBcUI7SUFDL0IsdUdBQThCLENBQUE7SUFDOUIsK0dBQWtDLENBQUE7SUFDbEMseUZBQXVCLENBQUE7QUFDekIsQ0FBQy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gIGtleVNlYXJjaC5zdWJ0eXBlID09PSBrZXlWYWwua2V5LnN1YnR5cGUgJiZcbiAgICAgICAgICAoIUJ1ZmZlci5pc0J1ZmZlcihrZXlTZWFyY2gua2V5ZGF0YSkgfHwga2V5U2VhcmNoLmtleWRhdGEuZXF1YWxzKGtleVZhbC5rZXkua2V5ZGF0YSkpKVxuICAgICAgKTtcbiAgICB9KTtcbiAgfVxuXG4gIGNsb25lKCk6IHRoaXMge1xuICAgIHJldHVybiBzdXBlci5jbG9uZSgpIGFzIHRoaXM7XG4gIH1cbn1cbiJdfQ==
|
@@ -82,7 +82,7 @@ class UtxoTransaction extends bitcoinjs.Transaction {
|
|
82
82
|
return super.hashForSignature(inIndex, prevoutScript, hashType);
|
83
83
|
}
|
84
84
|
hashForSignature(inIndex, prevOutScript, hashType, value) {
|
85
|
-
value = value
|
85
|
+
value = value ?? this.ins[inIndex].value;
|
86
86
|
return this.hashForSignatureByNetwork(inIndex, prevOutScript, value, hashType);
|
87
87
|
}
|
88
88
|
clone(amountType) {
|
@@ -94,4 +94,4 @@ exports.UtxoTransaction = UtxoTransaction;
|
|
94
94
|
UtxoTransaction.SIGHASH_FORKID = 0x40;
|
95
95
|
/** @deprecated use SIGHASH_FORKID */
|
96
96
|
UtxoTransaction.SIGHASH_BITCOINCASHBIP143 = UtxoTransaction.SIGHASH_FORKID;
|
97
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVXR4b1RyYW5zYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2JpdGdvL1V0eG9UcmFuc2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBaUM7QUFDakMsMkNBQTJDO0FBQzNDLDJDQUEyQztBQUMzQyx1Q0FBc0M7QUFFdEMsMENBQTJFO0FBRTNFLFNBQWdCLFlBQVksQ0FBQyxLQUFhO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UeXBlKTtcbiAgfVxuXG4gIGhhc2hGb3JTaWduYXR1cmUoaW5JbmRleDogbnVtYmVyLCBwcmV2T3V0U2NyaXB0OiBCdWZmZXIsIGhhc2hUeXBlOiBudW1iZXIsIHZhbHVlPzogVE51bWJlcik6IEJ1ZmZlciB7XG4gICAgdmFsdWUgPSB2YWx1ZSA/PyAodGhpcy5pbnNbaW5JbmRleF0gYXMgYW55KS52YWx1ZTtcbiAgICByZXR1cm4gdGhpcy5oYXNoRm9yU2lnbmF0dXJlQnlOZXR3b3JrKGluSW5kZXgsIHByZXZPdXRTY3JpcHQsIHZhbHVlLCBoYXNoVHlwZSk7XG4gIH1cblxuICBjbG9uZTxUTjIgZXh0ZW5kcyBiaWdpbnQgfCBudW1iZXIgPSBUTnVtYmVyPihhbW91bnRUeXBlPzogJ251bWJlcicgfCAnYmlnaW50Jyk6IFV0eG9UcmFuc2FjdGlvbjxUTjI+IHtcbiAgICAvLyBObyBuZWVkIHRvIGNsb25lLiBFdmVyeXRoaW5nIGlzIGNvcGllZCBpbiB0aGUgY29uc3RydWN0b3IuXG4gICAgcmV0dXJuIG5ldyBVdHhvVHJhbnNhY3Rpb248VE4yPih0aGlzLm5ldHdvcmssIHRoaXMsIGFtb3VudFR5cGUpO1xuICB9XG59XG4iXX0=
|
@@ -132,8 +132,8 @@ function createOutputScript2of3(pubkeys, scriptType, network) {
|
|
132
132
|
assert(scriptPubKey.output);
|
133
133
|
return {
|
134
134
|
scriptPubKey: scriptPubKey.output,
|
135
|
-
redeemScript: redeemScript
|
136
|
-
witnessScript: witnessScript
|
135
|
+
redeemScript: redeemScript?.output,
|
136
|
+
witnessScript: witnessScript?.output,
|
137
137
|
};
|
138
138
|
}
|
139
139
|
exports.createOutputScript2of3 = createOutputScript2of3;
|
@@ -294,4 +294,4 @@ function createTaprootScript2of3(scriptType, pubkeys) {
|
|
294
294
|
scriptPubKey: output,
|
295
295
|
};
|
296
296
|
}
|
297
|
-
//# sourceMappingURL=data:application/json;base64,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