utxo-lib 1.0.7 → 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
package/dist/src/noble_ecc.js
CHANGED
@@ -8,8 +8,8 @@ const necc = require("@noble/secp256k1");
|
|
8
8
|
const bip32_1 = require("bip32");
|
9
9
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
10
10
|
// @ts-ignore base_crypto is exported as a subPath export, ignoring since compiler complains about importing like this
|
11
|
-
const baseCrypto = require("
|
12
|
-
const
|
11
|
+
const baseCrypto = require("./base_crypto");
|
12
|
+
const musig_1 = require("./musig");
|
13
13
|
necc.utils.sha256Sync = (...messages) => {
|
14
14
|
const sha256 = createHash('sha256');
|
15
15
|
for (const message of messages)
|
@@ -67,7 +67,7 @@ const ecc = {
|
|
67
67
|
const res = necc.utils.privateAdd(d, tweak);
|
68
68
|
// tiny-secp256k1 returns null rather than allowing a 0 private key to be returned
|
69
69
|
// ECPair.testEcc() requires that behavior.
|
70
|
-
if (res
|
70
|
+
if (res?.every((i) => i === 0))
|
71
71
|
return null;
|
72
72
|
return res;
|
73
73
|
}),
|
@@ -163,6 +163,6 @@ const ECPair = ecpair_1.ECPairFactory(ecc);
|
|
163
163
|
exports.ECPair = ECPair;
|
164
164
|
const bip32 = bip32_1.BIP32Factory(ecc);
|
165
165
|
exports.bip32 = bip32;
|
166
|
-
const musig =
|
166
|
+
const musig = musig_1.MuSigFactory(crypto);
|
167
167
|
exports.musig = musig;
|
168
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9ibGVfZWNjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL25vYmxlX2VjYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQ0FBMEM7QUFDMUMsMENBQTBDO0FBQzFDLG1DQUFtRTtBQUNuRSx5Q0FBeUM7QUFDekMsaUNBQStEO0FBQy9ELDZEQUE2RDtBQUM3RCxzSEFBc0g7QUFDdEgsa0VBQWtFO0FBQ2xFLGlEQUE4RDtBQUU5RCxJQUFJLENBQUMsS0FBSyxDQUFDLFVBQVUsR0FBRyxDQUFDLEdBQUcsUUFBc0IsRUFBYyxFQUFFO0lBQ2hFLE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQyxRQUFRLENBQUMsQ0FBQztJQUNwQyxLQUFLLE1BQU0sT0FBTyxJQUFJLFFBQVE7UUFBRSxNQUFNLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ3ZELE9BQU8sTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO0FBQ3pCLENBQUMsQ0FBQztBQUVGLElBQUksQ0FBQyxLQUFLLENBQUMsY0FBYyxHQUFHLENBQUMsR0FBZSxFQUFFLEdBQUcsUUFBc0IsRUFBYyxFQUFFO0lBQ3JGLE1BQU0sSUF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YWNlLCBiaXAzMiwgQklQMzJBUEksIEJJUDMySW50ZXJmYWNlLCBtdXNpZywgTXVTaWcgfTtcbiJdfQ==
|
@@ -33,7 +33,6 @@ function isPlainPubkeys(pubkeys) {
|
|
33
33
|
}
|
34
34
|
// output: OP_1 {witnessProgram}
|
35
35
|
function p2tr(a, opts) {
|
36
|
-
var _a, _b, _c, _d;
|
37
36
|
if (!a.address && !a.pubkey && !a.pubkeys && !(a.redeems && a.redeems.length) && !a.output && !a.witness) {
|
38
37
|
throw new TypeError('Not enough data');
|
39
38
|
}
|
@@ -110,7 +109,6 @@ function p2tr(a, opts) {
|
|
110
109
|
}
|
111
110
|
});
|
112
111
|
bitcoinjs_lib_1.lazy.prop(o, 'internalPubkey', () => {
|
113
|
-
var _a;
|
114
112
|
if (a.pubkey) {
|
115
113
|
// single pubkey
|
116
114
|
return a.pubkey;
|
@@ -126,7 +124,7 @@ function p2tr(a, opts) {
|
|
126
124
|
return Buffer.from(taproot.aggregateMuSigPubkeys(ecc, a.pubkeys));
|
127
125
|
}
|
128
126
|
else if (_parsedControlBlock()) {
|
129
|
-
return
|
127
|
+
return _parsedControlBlock()?.internalPubkey;
|
130
128
|
}
|
131
129
|
else {
|
132
130
|
// If there is no key path spending condition, we use an internal key with unknown secret key.
|
@@ -139,7 +137,6 @@ function p2tr(a, opts) {
|
|
139
137
|
}
|
140
138
|
});
|
141
139
|
const _taprootPubkey = bitcoinjs_lib_1.lazy.value(() => {
|
142
|
-
var _a;
|
143
140
|
const parsedControlBlock = _parsedControlBlock();
|
144
141
|
const parsedWitness = _parsedWitness();
|
145
142
|
// Refuse to create an unspendable key
|
@@ -161,8 +158,8 @@ function p2tr(a, opts) {
|
|
161
158
|
taptreeRoot = taproot.getTaptreeRoot(ecc, parsedControlBlock, tapscript);
|
162
159
|
}
|
163
160
|
if (!taptreeRoot && _taprootPaths())
|
164
|
-
taptreeRoot =
|
165
|
-
return taproot.tapTweakPubkey(ecc, o
|
161
|
+
taptreeRoot = _taprootPaths()?.root;
|
162
|
+
return taproot.tapTweakPubkey(ecc, o?.internalPubkey, taptreeRoot);
|
166
163
|
});
|
167
164
|
bitcoinjs_lib_1.lazy.prop(o, 'tapTree', () => {
|
168
165
|
if (!a.redeems)
|
@@ -185,8 +182,7 @@ function p2tr(a, opts) {
|
|
185
182
|
};
|
186
183
|
});
|
187
184
|
bitcoinjs_lib_1.lazy.prop(o, 'address', () => {
|
188
|
-
|
189
|
-
const pubkey = _outputPubkey() || (_taprootPubkey() && ((_a = _taprootPubkey()) === null || _a === void 0 ? void 0 : _a.xOnlyPubkey));
|
185
|
+
const pubkey = _outputPubkey() || (_taprootPubkey() && _taprootPubkey()?.xOnlyPubkey);
|
190
186
|
// only encode the 32 byte witness program as bech32m
|
191
187
|
const words = bech32m.toWords(pubkey);
|
192
188
|
words.unshift(0x01);
|
@@ -284,21 +280,21 @@ function p2tr(a, opts) {
|
|
284
280
|
throw new TypeError('Output is invalid');
|
285
281
|
}
|
286
282
|
// if we're passed both an output script and an address, ensure they match
|
287
|
-
if (a.address && _outputPubkey && !
|
283
|
+
if (a.address && _outputPubkey && !_outputPubkey()?.equals(_address()?.data)) {
|
288
284
|
throw new TypeError('mismatch between address & output');
|
289
285
|
}
|
290
|
-
if (taprootPubkey && _outputPubkey && !
|
286
|
+
if (taprootPubkey && _outputPubkey && !_outputPubkey()?.equals(taprootPubkey.xOnlyPubkey)) {
|
291
287
|
throw new TypeError('mismatch between output and taproot pubkey');
|
292
288
|
}
|
293
289
|
}
|
294
290
|
if (a.address) {
|
295
|
-
if (taprootPubkey && !
|
291
|
+
if (taprootPubkey && !_address()?.data.equals(taprootPubkey.xOnlyPubkey)) {
|
296
292
|
throw new TypeError('mismatch between address and taproot pubkey');
|
297
293
|
}
|
298
294
|
}
|
299
295
|
const parsedControlBlock = _parsedControlBlock();
|
300
296
|
if (parsedControlBlock) {
|
301
|
-
if (!parsedControlBlock.internalPubkey.equals(o
|
297
|
+
if (!parsedControlBlock.internalPubkey.equals(o?.internalPubkey)) {
|
302
298
|
throw new TypeError('Internal pubkey mismatch');
|
303
299
|
}
|
304
300
|
if (taprootPubkey && parsedControlBlock.parity !== taprootPubkey.parity) {
|
@@ -345,4 +341,4 @@ function p2tr(a, opts) {
|
|
345
341
|
return Object.assign(o, a);
|
346
342
|
}
|
347
343
|
exports.p2tr = p2tr;
|
348
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJ0ci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXltZW50cy9wMnRyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwyREFBMkQ7QUFDM0QsaUVBQWlFOzs7QUFFakUsMENBQXVDO0FBQ3ZDLGlEQUE4RTtBQUM5RSxzQ0FBc0M7QUFDdEMsNENBQXFDO0FBQ3JDLHlDQUF5QztBQUN6QyxNQUFNLEtBQUssR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDbkMsTUFBTSxHQUFHLEdBQUcsc0JBQU8sQ0FBQyxHQUFHLENBQUM7QUFFeEIsTUFBTSxFQUFFLE9BQU8sRUFBRSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUV0QyxNQUFNLGVBQWUsR0FBRyxtQkFBUSxDQUFDLE9BQU8sQ0FBQztBQUV6Qzs7O0dBR0c7QUFDSCxNQUFNLENBQUMsR0FBRyxNQUFNLENBQUMsSUFBSSxDQUFDLGtFQUFrRSxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQ2pHLE1BQU0sWUFBWSxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFFckMsU0FBUyxhQUFhLENBQUMsTUFBa0I7SUFDdkMsSUFBSSxNQUFNLENBQUMsTUFBTSxLQUFLLEVBQUU7UUFBRSxPQUFPLEtBQUssQ0FBQztJQUN2Qyx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bm5leCAmJiAhYS5hbm5leC5lcXVhbHMocGFyc2VkV2l0bmVzcy5hbm5leCkpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignYW5uZXggbWlzbWF0Y2gnKTtcbiAgICAgIH1cblxuICAgICAgaWYgKGNob3NlblJlZGVlbSAmJiBjaG9zZW5SZWRlZW0ub3V0cHV0ICYmICFjaG9zZW5SZWRlZW0ub3V0cHV0LmVxdWFscyhwYXJzZWRXaXRuZXNzLnRhcHNjcmlwdCkpIHtcbiAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcigndGFwc2NyaXB0IG1pc21hdGNoJyk7XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIE9iamVjdC5hc3NpZ24obywgYSk7XG59XG4iXX0=
|
@@ -62,10 +62,9 @@ function p2tr_ns(a, opts) {
|
|
62
62
|
return chunks.filter((_, index) => index % 2 === 0);
|
63
63
|
});
|
64
64
|
bitcoinjs_lib_1.lazy.prop(o, 'signatures', () => {
|
65
|
-
var _a;
|
66
65
|
if (!a.input)
|
67
66
|
return;
|
68
|
-
return
|
67
|
+
return bitcoinjs_lib_1.script.decompile(a.input)?.reverse();
|
69
68
|
});
|
70
69
|
bitcoinjs_lib_1.lazy.prop(o, 'input', () => {
|
71
70
|
if (!a.signatures)
|
@@ -131,4 +130,4 @@ function p2tr_ns(a, opts) {
|
|
131
130
|
return Object.assign(o, a);
|
132
131
|
}
|
133
132
|
exports.p2tr_ns = p2tr_ns;
|
134
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicDJ0cl9ucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYXltZW50cy9wMnRyX25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDBDQUF1QztBQUN2QyxpREFBcUY7QUFFckYsTUFBTSxHQUFHLEdBQUcsc0JBQU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