utxo-lib 1.1.3 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/address.d.ts.map +1 -1
- package/dist/src/address.js +1 -11
- package/dist/src/addressFormat.d.ts +1 -1
- package/dist/src/addressFormat.d.ts.map +1 -1
- package/dist/src/addressFormat.js +1 -1
- package/dist/src/bitgo/Musig2.d.ts +17 -115
- package/dist/src/bitgo/Musig2.d.ts.map +1 -1
- package/dist/src/bitgo/Musig2.js +101 -283
- package/dist/src/bitgo/UtxoPsbt.d.ts +49 -173
- package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/UtxoPsbt.js +112 -634
- package/dist/src/bitgo/bbc/DashPsbt.d.ts +12 -0
- package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashPsbt.js +27 -0
- package/dist/src/bitgo/bbc/DashTransaction.d.ts +39 -0
- package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashTransaction.js +109 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +14 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +1 -0
- package/dist/src/bitgo/bbc/DashTransactionBuilder.js +28 -0
- package/dist/src/bitgo/bbc/index.d.ts +4 -0
- package/dist/src/bitgo/bbc/index.d.ts.map +1 -0
- package/dist/src/bitgo/{litecoin → bbc}/index.js +4 -4
- package/dist/src/bitgo/bitcoincash/address.js +2 -2
- package/dist/src/bitgo/index.d.ts +0 -10
- package/dist/src/bitgo/index.d.ts.map +1 -1
- package/dist/src/bitgo/index.js +2 -5
- package/dist/src/bitgo/outputScripts.d.ts +1 -3
- package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
- package/dist/src/bitgo/outputScripts.js +10 -18
- package/dist/src/bitgo/parseInput.d.ts +20 -49
- package/dist/src/bitgo/parseInput.d.ts.map +1 -1
- package/dist/src/bitgo/parseInput.js +24 -108
- package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
- package/dist/src/bitgo/psbt/fromHalfSigned.js +6 -9
- package/dist/src/bitgo/signature.d.ts +3 -3
- package/dist/src/bitgo/signature.d.ts.map +1 -1
- package/dist/src/bitgo/signature.js +16 -48
- package/dist/src/bitgo/transaction.d.ts +3 -18
- package/dist/src/bitgo/transaction.d.ts.map +1 -1
- package/dist/src/bitgo/transaction.js +15 -28
- package/dist/src/bitgo/types.d.ts +0 -2
- package/dist/src/bitgo/types.d.ts.map +1 -1
- package/dist/src/bitgo/types.js +1 -1
- package/dist/src/bitgo/wallet/Psbt.d.ts +12 -90
- package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Psbt.js +71 -221
- package/dist/src/bitgo/wallet/Unspent.d.ts +0 -28
- package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/Unspent.js +68 -173
- package/dist/src/bitgo/wallet/chains.d.ts +2 -2
- package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
- package/dist/src/bitgo/wallet/chains.js +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
- package/dist/src/bitgo/zcash/ZcashPsbt.js +3 -4
- package/dist/src/networks.d.ts +2 -1
- package/dist/src/networks.d.ts.map +1 -1
- package/dist/src/networks.js +29 -22
- package/dist/src/noble_ecc.d.ts.map +1 -1
- package/dist/src/noble_ecc.js +2 -6
- package/dist/src/payments/p2tr.d.ts.map +1 -1
- package/dist/src/payments/p2tr.js +9 -15
- package/dist/src/taproot.d.ts +0 -16
- package/dist/src/taproot.d.ts.map +1 -1
- package/dist/src/taproot.js +2 -44
- package/dist/src/testutil/index.d.ts +0 -2
- package/dist/src/testutil/index.d.ts.map +1 -1
- package/dist/src/testutil/index.js +1 -3
- package/dist/src/testutil/mock.d.ts +1 -1
- package/dist/src/testutil/mock.d.ts.map +1 -1
- package/dist/src/testutil/mock.js +4 -12
- package/package.json +3 -5
- package/dist/src/bitgo/PsbtUtil.d.ts +0 -54
- package/dist/src/bitgo/PsbtUtil.d.ts.map +0 -1
- package/dist/src/bitgo/PsbtUtil.js +0 -79
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +0 -10
- package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinPsbt.js +0 -17
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +0 -16
- package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinTransaction.js +0 -46
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +0 -10
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +0 -1
- package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +0 -15
- package/dist/src/bitgo/litecoin/index.d.ts +0 -4
- package/dist/src/bitgo/litecoin/index.d.ts.map +0 -1
- package/dist/src/testutil/psbt.d.ts +0 -71
- package/dist/src/testutil/psbt.d.ts.map +0 -1
- package/dist/src/testutil/psbt.js +0 -147
- package/dist/src/testutil/transaction.d.ts +0 -61
- package/dist/src/testutil/transaction.d.ts.map +0 -1
- package/dist/src/testutil/transaction.js +0 -107
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG5E,OAAO,EAA2B,OAAO,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,SAAS,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG5E,OAAO,EAA2B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9D,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAK/E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKxE;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKrF;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAKpF;AAED,eAAO,MAAQ,UAAU,uCAAE,QAAQ,mCAAsB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/src/address.js
CHANGED
@@ -5,20 +5,10 @@ exports.toBech32 = exports.fromBech32 = exports.fromBase58Check = exports.toBase
|
|
5
5
|
const bitcoinjs = require("bitcoinjs-lib");
|
6
6
|
const zcashAddress = require("../src/bitgo/zcash/address");
|
7
7
|
const networks_1 = require("./networks");
|
8
|
-
const index_1 = require("./index");
|
9
8
|
function fromOutputScript(outputScript, network) {
|
10
9
|
if (networks_1.isValidNetwork(network) && networks_1.isZcash(network)) {
|
11
10
|
return zcashAddress.fromOutputScript(outputScript, network);
|
12
11
|
}
|
13
|
-
// We added p2tr payments from our forked bitcoinjs-lib to utxo-lib instead. Our bitcoinjs fork will no longer have
|
14
|
-
// p2tr support so utxo-lib should take care of retrieving a p2tr address from outputScript and bitcoinjs-lib can
|
15
|
-
// handle the other type of payments.
|
16
|
-
try {
|
17
|
-
return index_1.p2trPayments.p2tr({ output: outputScript, network }).address;
|
18
|
-
}
|
19
|
-
catch (e) {
|
20
|
-
// noop. try the bitcoinjs method
|
21
|
-
}
|
22
12
|
return bitcoinjs.address.fromOutputScript(outputScript, network);
|
23
13
|
}
|
24
14
|
exports.fromOutputScript = fromOutputScript;
|
@@ -44,4 +34,4 @@ function fromBase58Check(address, network) {
|
|
44
34
|
}
|
45
35
|
exports.fromBase58Check = fromBase58Check;
|
46
36
|
_a = bitcoinjs.address, exports.fromBech32 = _a.fromBech32, exports.toBech32 = _a.toBech32;
|
47
|
-
//# sourceMappingURL=data:application/json;base64,
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSwyQ0FBMkM7QUFHM0MsMkRBQTJEO0FBQzNELHlDQUE4RDtBQUU5RCxTQUFnQixnQkFBZ0IsQ0FBQyxZQUFvQixFQUFFLE9BQWdCO0lBQ3JFLElBQUkseUJBQWMsQ0FBQyxPQUFPLENBQUMsSUFBSSxrQkFBTyxDQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQy9DLE9BQU8sWUFBWSxDQUFDLGdCQUFnQixDQUFDLFlBQVksRUFBRSxPQUFPLENBQUMsQ0FBQztLQUM3RDtJQUNELE9BQU8sU0FBUyxDQUFDLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxZQUFZLEVBQUUsT0FBNEIsQ0FBQyxDQUFDO0FBQ3hGLENBQUM7QUFMRCw0Q0FLQztBQUVELFNBQWdCLGNBQWMsQ0FBQyxPQUFlLEVBQUUsT0FBZ0I7SUFDOUQsSUFBSSx5QkFBYyxDQUFDLE9BQU8sQ0FBQyxJQUFJLGtCQUFPLENBQUMsT0FBTyxDQUFDLEVBQUU7UUFDL0MsT0FBTyxZQUFZLENBQUMsY0FBYyxDQUFDLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQztLQUN0RDtJQUNELE9BQU8sU0FBUyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsT0FBTyxFQUFFLE9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RkcmVzcy50b0Jhc2U1OENoZWNrKGhhc2gsIHZlcnNpb24pO1xuICB9XG4gIHJldHVybiBiaXRjb2luanMuYWRkcmVzcy50b0Jhc2U1OENoZWNrKGhhc2gsIHZlcnNpb24pO1xufVxuXG5leHBvcnQgZnVuY3Rpb24gZnJvbUJhc2U1OENoZWNrKGFkZHJlc3M6IHN0cmluZywgbmV0d29yazogTmV0d29yayk6IEJhc2U1OENoZWNrUmVzdWx0IHtcbiAgaWYgKGlzVmFsaWROZXR3b3JrKG5ldHdvcmspICYmIGlzWmNhc2gobmV0d29yaykpIHtcbiAgICByZXR1cm4gemNhc2hBZGRyZXNzLmZyb21CYXNlNThDaGVjayhhZGRyZXNzKTtcbiAgfVxuICByZXR1cm4gYml0Y29pbmpzLmFkZHJlc3MuZnJvbUJhc2U1OENoZWNrKGFkZHJlc3MpO1xufVxuXG5leHBvcnQgY29uc3QgeyBmcm9tQmVjaDMyLCB0b0JlY2gzMiB9ID0gYml0Y29pbmpzLmFkZHJlc3M7XG5cbmV4cG9ydCB7IEJhc2U1OENoZWNrUmVzdWx0LCBCZWNoMzJSZXN1bHQgfTtcbiJdfQ==
|
@@ -7,7 +7,7 @@
|
|
7
7
|
*/
|
8
8
|
import { Network } from './networks';
|
9
9
|
export declare const addressFormats: readonly ["default", "cashaddr"];
|
10
|
-
export declare type AddressFormat =
|
10
|
+
export declare type AddressFormat = typeof addressFormats[number];
|
11
11
|
/**
|
12
12
|
* @param format
|
13
13
|
* @param network
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addressFormat.d.ts","sourceRoot":"","sources":["../../src/addressFormat.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,EAA8B,OAAO,EAAY,MAAM,YAAY,CAAC;AAK3E,eAAO,MAAM,cAAc,kCAAmC,CAAC;AAE/D,oBAAY,aAAa,GAAG,
|
1
|
+
{"version":3,"file":"addressFormat.d.ts","sourceRoot":"","sources":["../../src/addressFormat.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;AACH,OAAO,EAA8B,OAAO,EAAY,MAAM,YAAY,CAAC;AAK3E,eAAO,MAAM,cAAc,kCAAmC,CAAC;AAE/D,oBAAY,aAAa,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAQzF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAYhH;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAYzG;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,aAAa,EAAE,GACxB,CAAC,aAAa,EAAE,MAAM,CAAC,CAczB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,GAAG,MAAM,CAG7G;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3E"}
|
@@ -107,4 +107,4 @@ function toCanonicalFormat(address, network) {
|
|
107
107
|
return address_1.fromOutputScript(toOutputScriptTryFormats(address, network), network);
|
108
108
|
}
|
109
109
|
exports.toCanonicalFormat = toCanonicalFormat;
|
110
|
-
//# sourceMappingURL=data:application/json;base64,
|
110
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzc0Zvcm1hdC5qcyIsInNvdXJjZ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FRyeUZvcm1hdHMoYWRkcmVzczogc3RyaW5nLCBuZXR3b3JrOiBOZXR3b3JrLCBmb3JtYXRzPzogQWRkcmVzc0Zvcm1hdFtdKTogQnVmZmVyIHtcbiAgY29uc3QgWywgb3V0cHV0U2NyaXB0XSA9IHRvT3V0cHV0U2NyaXB0QW5kRm9ybWF0KGFkZHJlc3MsIG5ldHdvcmssIGZvcm1hdHMpO1xuICByZXR1cm4gb3V0cHV0U2NyaXB0O1xufVxuXG4vKipcbiAqIEBwYXJhbSBhZGRyZXNzXG4gKiBAcGFyYW0gbmV0d29ya1xuICogQHJldHVybiBhZGRyZXNzIGluIGNhbm9uaWNhbCBmb3JtYXRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHRvQ2Fub25pY2FsRm9ybWF0KGFkZHJlc3M6IHN0cmluZywgbmV0d29yazogTmV0d29yayk6IHN0cmluZyB7XG4gIHJldHVybiBmcm9tT3V0cHV0U2NyaXB0KHRvT3V0cHV0U2NyaXB0VHJ5Rm9ybWF0cyhhZGRyZXNzLCBuZXR3b3JrKSwgbmV0d29yayk7XG59XG4iXX0=
|
@@ -1,149 +1,51 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import {
|
2
|
+
import { ProprietaryKeyValueData, UtxoPsbt } from './UtxoPsbt';
|
3
|
+
import { BIP32Interface } from 'bip32';
|
3
4
|
import { Tuple } from './types';
|
4
|
-
import { PsbtInput } from 'bip174/src/lib/interfaces';
|
5
|
-
import { ProprietaryKeyValue } from './PsbtUtil';
|
6
5
|
/**
|
7
6
|
* Participant key value object.
|
8
7
|
*/
|
9
|
-
export interface
|
8
|
+
export interface PsbtMusig2ParticipantsKeyValueData {
|
10
9
|
tapOutputKey: Buffer;
|
11
10
|
tapInternalKey: Buffer;
|
12
11
|
participantPubKeys: Tuple<Buffer>;
|
13
12
|
}
|
14
|
-
export interface PsbtMusig2DeterministicParams {
|
15
|
-
privateKey: Buffer;
|
16
|
-
otherNonce: Buffer;
|
17
|
-
publicKeys: Tuple<Buffer>;
|
18
|
-
internalPubKey: Buffer;
|
19
|
-
tapTreeRoot: Buffer;
|
20
|
-
hash: Buffer;
|
21
|
-
}
|
22
13
|
/**
|
23
14
|
* Nonce key value object.
|
24
15
|
*/
|
25
|
-
export interface
|
16
|
+
export interface PsbtMusig2NoncesKeyValueData {
|
26
17
|
participantPubKey: Buffer;
|
27
18
|
tapOutputKey: Buffer;
|
28
|
-
|
29
|
-
}
|
30
|
-
/**
|
31
|
-
* Partial signature key value object.
|
32
|
-
*/
|
33
|
-
export interface PsbtMusig2PartialSig {
|
34
|
-
participantPubKey: Buffer;
|
35
|
-
tapOutputKey: Buffer;
|
36
|
-
partialSig: Buffer;
|
37
|
-
}
|
38
|
-
/**
|
39
|
-
* Because musig uses reference-equal buffers to cache nonces, we wrap it here to allow using
|
40
|
-
* nonces that are byte-equal but not reference-equal.
|
41
|
-
*/
|
42
|
-
export declare class Musig2NonceStore {
|
43
|
-
private nonces;
|
44
|
-
/**
|
45
|
-
* Get original Buffer instance for nonce (which may be a copy).
|
46
|
-
* @return byte-equal buffer that is reference-equal to what was stored earlier in createMusig2Nonce
|
47
|
-
*/
|
48
|
-
getRef(nonce: Uint8Array): Uint8Array;
|
49
|
-
/**
|
50
|
-
* Creates musig2 nonce and stores buffer reference.
|
51
|
-
* tapInternalkey, tapMerkleRoot, tapBip32Derivation for rootWalletKey are required per p2trMusig2 key path input.
|
52
|
-
* Also participant keys are required from psbt proprietary key values.
|
53
|
-
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
54
|
-
* @param privateKey - signer private key
|
55
|
-
* @param publicKey - signer xy public key
|
56
|
-
* @param xOnlyPublicKey - tweaked aggregated key (tapOutputKey)
|
57
|
-
* @param sessionId Additional entropy. If provided it must either be a counter unique to this secret key,
|
58
|
-
* (converted to an array of 32 bytes), or 32 uniformly random bytes.
|
59
|
-
*/
|
60
|
-
createMusig2Nonce(privateKey: Uint8Array, publicKey: Uint8Array, xOnlyPublicKey: Uint8Array, txHash: Uint8Array, sessionId?: Buffer): Uint8Array;
|
19
|
+
pubNonces: Buffer;
|
61
20
|
}
|
62
21
|
/**
|
63
22
|
* Psbt proprietary key val util function for participants pub keys. SubType is 0x01
|
64
23
|
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
65
24
|
* @return x-only tapOutputKey||tapInternalKey as sub keydata, plain sigining participant keys as valuedata
|
66
25
|
*/
|
67
|
-
export declare function
|
26
|
+
export declare function encodePsbtMusig2ParticipantsKeyValData(participantsKeyValData: PsbtMusig2ParticipantsKeyValueData): ProprietaryKeyValueData;
|
68
27
|
/**
|
69
28
|
* Psbt proprietary key val util function for pub nonce. SubType is 0x02
|
70
29
|
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
71
30
|
* @return plain-participantPubKey||x-only-tapOutputKey as sub keydata, 66 bytes of 2 pub nonces as valuedata
|
72
31
|
*/
|
73
|
-
export declare function
|
74
|
-
export declare function encodePsbtMusig2PartialSig(partialSig: PsbtMusig2PartialSig): ProprietaryKeyValue;
|
32
|
+
export declare function encodePsbtMusig2PubNonceKeyValData(noncesKeyValueData: PsbtMusig2NoncesKeyValueData): ProprietaryKeyValueData;
|
75
33
|
/**
|
76
34
|
* Decodes proprietary key value data for participant pub keys
|
77
35
|
* @param kv
|
78
36
|
*/
|
79
|
-
export declare function
|
80
|
-
/**
|
81
|
-
* Decodes proprietary key value data for musig2 nonce
|
82
|
-
* @param kv
|
83
|
-
*/
|
84
|
-
export declare function decodePsbtMusig2Nonce(kv: ProprietaryKeyValue): PsbtMusig2PubNonce;
|
85
|
-
/**
|
86
|
-
* Decodes proprietary key value data for musig2 partial sig
|
87
|
-
* @param kv
|
88
|
-
*/
|
89
|
-
export declare function decodePsbtMusig2PartialSig(kv: ProprietaryKeyValue): PsbtMusig2PartialSig;
|
37
|
+
export declare function decodePsbtMusig2ParticipantsKeyValData(kv: ProprietaryKeyValueData): PsbtMusig2ParticipantsKeyValueData;
|
90
38
|
export declare function createTapInternalKey(plainPubKeys: Buffer[]): Buffer;
|
91
39
|
export declare function createTapOutputKey(internalPubKey: Buffer, tapTreeRoot: Buffer): Buffer;
|
92
|
-
export declare function createAggregateNonce(pubNonces: Tuple<Buffer>): Buffer;
|
93
|
-
export declare function createTapTweak(tapInternalKey: Buffer, tapMerkleRoot: Buffer): Buffer;
|
94
|
-
export declare function musig2PartialSign(privateKey: Buffer, publicNonce: Uint8Array, sessionKey: SessionKey, nonceStore: Musig2NonceStore): Buffer;
|
95
|
-
export declare function musig2PartialSigVerify(sig: Buffer, publicKey: Buffer, publicNonce: Buffer, sessionKey: SessionKey): boolean;
|
96
|
-
export declare function musig2AggregateSigs(sigs: Buffer[], sessionKey: SessionKey): Buffer;
|
97
|
-
/** @return session key that can be used to reference the session later */
|
98
|
-
export declare function createMusig2SigningSession(sessionArgs: {
|
99
|
-
pubNonces: Tuple<Buffer>;
|
100
|
-
txHash: Buffer;
|
101
|
-
pubKeys: Tuple<Buffer>;
|
102
|
-
internalPubKey: Buffer;
|
103
|
-
tapTreeRoot: Buffer;
|
104
|
-
}): SessionKey;
|
105
|
-
/**
|
106
|
-
* @returns psbt proprietary key for musig2 participant key value data
|
107
|
-
* If no key value exists, undefined is returned.
|
108
|
-
*/
|
109
|
-
export declare function parsePsbtMusig2Participants(input: PsbtInput): PsbtMusig2Participants | undefined;
|
110
40
|
/**
|
111
|
-
*
|
112
|
-
*
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
* @
|
117
|
-
* If
|
118
|
-
|
119
|
-
export declare function parsePsbtMusig2PartialSigs(input: PsbtInput): PsbtMusig2PartialSig[] | undefined;
|
120
|
-
/**
|
121
|
-
* Assert musig2 participant key value data with tapInternalKey and tapMerkleRoot.
|
122
|
-
* <tapOutputKey><tapInputKey> => <participantKey1><participantKey2>
|
123
|
-
* Using tapMerkleRoot and 2 participant keys, the tapInputKey is validated and using tapMerkleRoot and tapInputKey,
|
124
|
-
* the tapOutputKey is validated.
|
125
|
-
*/
|
126
|
-
export declare function assertPsbtMusig2Participants(participantKeyValData: PsbtMusig2Participants, tapInternalKey: Buffer, tapMerkleRoot: Buffer): void;
|
127
|
-
/**
|
128
|
-
* Assert musig2 public nonce key value data with participant key value data
|
129
|
-
* (refer assertPsbtMusig2ParticipantsKeyValData).
|
130
|
-
* <participantKey1><tapOutputKey> => <pubNonce1>
|
131
|
-
* <participantKey2><tapOutputKey> => <pubNonce2>
|
132
|
-
* Checks against participant keys and tapOutputKey
|
133
|
-
*/
|
134
|
-
export declare function assertPsbtMusig2Nonces(noncesKeyValData: PsbtMusig2PubNonce[], participantKeyValData: PsbtMusig2Participants): void;
|
135
|
-
/**
|
136
|
-
* @returns Input object but sig hash type data is taken out from partialSig field.
|
137
|
-
* If sig hash type is not common for all sigs, error out, otherwise returns the modified object and single hash type.
|
41
|
+
* Generates and sets Musig2 nonces to p2trMusig2 key path spending inputs.
|
42
|
+
* tapInternalkey, tapMerkleRoot, tapBip32Derivation for rootWalletKey are required per p2trMusig2 key path input.
|
43
|
+
* Also participant keys are required from psbt proprietary key values.
|
44
|
+
* Ref: https://gist.github.com/sanket1729/4b525c6049f4d9e034d27368c49f28a6
|
45
|
+
* @param psbt
|
46
|
+
* @param rootWalletKey
|
47
|
+
* @param sessionId If provided it must either be a counter unique to this secret key,
|
48
|
+
* (converted to an array of 32 bytes), or 32 uniformly random bytes.
|
138
49
|
*/
|
139
|
-
export declare function
|
140
|
-
partialSigs: PsbtMusig2PartialSig[];
|
141
|
-
sigHashType: number;
|
142
|
-
};
|
143
|
-
export declare function createMusig2DeterministicNonce(params: PsbtMusig2DeterministicParams): Buffer;
|
144
|
-
export declare function musig2DeterministicSign(params: PsbtMusig2DeterministicParams): {
|
145
|
-
sig: Buffer;
|
146
|
-
sessionKey: SessionKey;
|
147
|
-
publicNonce: Buffer;
|
148
|
-
};
|
50
|
+
export declare function setMusig2Nonces(psbt: UtxoPsbt, rootWalletKey: BIP32Interface, sessionId?: Buffer): void;
|
149
51
|
//# sourceMappingURL=Musig2.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Musig2.d.ts","sourceRoot":"","sources":["../../../src/bitgo/Musig2.ts"],"names":[],"mappings":";AAAA,OAAO,
|
1
|
+
{"version":3,"file":"Musig2.d.ts","sourceRoot":"","sources":["../../../src/bitgo/Musig2.ts"],"names":[],"mappings":";AAAA,OAAO,EAA+B,uBAAuB,EAAE,QAAQ,EAAyB,MAAM,YAAY,CAAC;AAEnH,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKhC;;GAEG;AACH,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,sCAAsC,CACpD,sBAAsB,EAAE,kCAAkC,GACzD,uBAAuB,CAWzB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAChD,kBAAkB,EAAE,4BAA4B,GAC/C,uBAAuB,CAczB;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,EAAE,EAAE,uBAAuB,GAC1B,kCAAkC,CAuBpC;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CAGnE;AAED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKtF;AA6FD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAavG"}
|