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.
Files changed (92) hide show
  1. package/dist/src/address.d.ts.map +1 -1
  2. package/dist/src/address.js +1 -11
  3. package/dist/src/addressFormat.d.ts +1 -1
  4. package/dist/src/addressFormat.d.ts.map +1 -1
  5. package/dist/src/addressFormat.js +1 -1
  6. package/dist/src/bitgo/Musig2.d.ts +17 -115
  7. package/dist/src/bitgo/Musig2.d.ts.map +1 -1
  8. package/dist/src/bitgo/Musig2.js +101 -283
  9. package/dist/src/bitgo/UtxoPsbt.d.ts +49 -173
  10. package/dist/src/bitgo/UtxoPsbt.d.ts.map +1 -1
  11. package/dist/src/bitgo/UtxoPsbt.js +112 -634
  12. package/dist/src/bitgo/bbc/DashPsbt.d.ts +12 -0
  13. package/dist/src/bitgo/bbc/DashPsbt.d.ts.map +1 -0
  14. package/dist/src/bitgo/bbc/DashPsbt.js +27 -0
  15. package/dist/src/bitgo/bbc/DashTransaction.d.ts +39 -0
  16. package/dist/src/bitgo/bbc/DashTransaction.d.ts.map +1 -0
  17. package/dist/src/bitgo/bbc/DashTransaction.js +109 -0
  18. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts +14 -0
  19. package/dist/src/bitgo/bbc/DashTransactionBuilder.d.ts.map +1 -0
  20. package/dist/src/bitgo/bbc/DashTransactionBuilder.js +28 -0
  21. package/dist/src/bitgo/bbc/index.d.ts +4 -0
  22. package/dist/src/bitgo/bbc/index.d.ts.map +1 -0
  23. package/dist/src/bitgo/{litecoin → bbc}/index.js +4 -4
  24. package/dist/src/bitgo/bitcoincash/address.js +2 -2
  25. package/dist/src/bitgo/index.d.ts +0 -10
  26. package/dist/src/bitgo/index.d.ts.map +1 -1
  27. package/dist/src/bitgo/index.js +2 -5
  28. package/dist/src/bitgo/outputScripts.d.ts +1 -3
  29. package/dist/src/bitgo/outputScripts.d.ts.map +1 -1
  30. package/dist/src/bitgo/outputScripts.js +10 -18
  31. package/dist/src/bitgo/parseInput.d.ts +20 -49
  32. package/dist/src/bitgo/parseInput.d.ts.map +1 -1
  33. package/dist/src/bitgo/parseInput.js +24 -108
  34. package/dist/src/bitgo/psbt/fromHalfSigned.d.ts.map +1 -1
  35. package/dist/src/bitgo/psbt/fromHalfSigned.js +6 -9
  36. package/dist/src/bitgo/signature.d.ts +3 -3
  37. package/dist/src/bitgo/signature.d.ts.map +1 -1
  38. package/dist/src/bitgo/signature.js +16 -48
  39. package/dist/src/bitgo/transaction.d.ts +3 -18
  40. package/dist/src/bitgo/transaction.d.ts.map +1 -1
  41. package/dist/src/bitgo/transaction.js +15 -28
  42. package/dist/src/bitgo/types.d.ts +0 -2
  43. package/dist/src/bitgo/types.d.ts.map +1 -1
  44. package/dist/src/bitgo/types.js +1 -1
  45. package/dist/src/bitgo/wallet/Psbt.d.ts +12 -90
  46. package/dist/src/bitgo/wallet/Psbt.d.ts.map +1 -1
  47. package/dist/src/bitgo/wallet/Psbt.js +71 -221
  48. package/dist/src/bitgo/wallet/Unspent.d.ts +0 -28
  49. package/dist/src/bitgo/wallet/Unspent.d.ts.map +1 -1
  50. package/dist/src/bitgo/wallet/Unspent.js +68 -173
  51. package/dist/src/bitgo/wallet/chains.d.ts +2 -2
  52. package/dist/src/bitgo/wallet/chains.d.ts.map +1 -1
  53. package/dist/src/bitgo/wallet/chains.js +1 -1
  54. package/dist/src/bitgo/zcash/ZcashPsbt.d.ts.map +1 -1
  55. package/dist/src/bitgo/zcash/ZcashPsbt.js +3 -4
  56. package/dist/src/networks.d.ts +2 -1
  57. package/dist/src/networks.d.ts.map +1 -1
  58. package/dist/src/networks.js +29 -22
  59. package/dist/src/noble_ecc.d.ts.map +1 -1
  60. package/dist/src/noble_ecc.js +2 -6
  61. package/dist/src/payments/p2tr.d.ts.map +1 -1
  62. package/dist/src/payments/p2tr.js +9 -15
  63. package/dist/src/taproot.d.ts +0 -16
  64. package/dist/src/taproot.d.ts.map +1 -1
  65. package/dist/src/taproot.js +2 -44
  66. package/dist/src/testutil/index.d.ts +0 -2
  67. package/dist/src/testutil/index.d.ts.map +1 -1
  68. package/dist/src/testutil/index.js +1 -3
  69. package/dist/src/testutil/mock.d.ts +1 -1
  70. package/dist/src/testutil/mock.d.ts.map +1 -1
  71. package/dist/src/testutil/mock.js +4 -12
  72. package/package.json +3 -5
  73. package/dist/src/bitgo/PsbtUtil.d.ts +0 -54
  74. package/dist/src/bitgo/PsbtUtil.d.ts.map +0 -1
  75. package/dist/src/bitgo/PsbtUtil.js +0 -79
  76. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts +0 -10
  77. package/dist/src/bitgo/litecoin/LitecoinPsbt.d.ts.map +0 -1
  78. package/dist/src/bitgo/litecoin/LitecoinPsbt.js +0 -17
  79. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts +0 -16
  80. package/dist/src/bitgo/litecoin/LitecoinTransaction.d.ts.map +0 -1
  81. package/dist/src/bitgo/litecoin/LitecoinTransaction.js +0 -46
  82. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts +0 -10
  83. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.d.ts.map +0 -1
  84. package/dist/src/bitgo/litecoin/LitecoinTransactionBuilder.js +0 -15
  85. package/dist/src/bitgo/litecoin/index.d.ts +0 -4
  86. package/dist/src/bitgo/litecoin/index.d.ts.map +0 -1
  87. package/dist/src/testutil/psbt.d.ts +0 -71
  88. package/dist/src/testutil/psbt.d.ts.map +0 -1
  89. package/dist/src/testutil/psbt.js +0 -147
  90. package/dist/src/testutil/transaction.d.ts +0 -61
  91. package/dist/src/testutil/transaction.d.ts.map +0 -1
  92. 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,EAA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-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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSwyQ0FBMkM7QUFHM0MsMkRBQTJEO0FBQzNELHlDQUE4RDtBQUM5RCxtQ0FBdUM7QUFFdkMsU0FBZ0IsZ0JBQWdCLENBQUMsWUFBb0IsRUFBRSxPQUFnQjtJQUNyRSxJQUFJLHlCQUFjLENBQUMsT0FBTyxDQUFDLElBQUksa0JBQU8sQ0FBQyxPQUFPLENBQUMsRUFBRTtRQUMvQyxPQUFPLFlBQVksQ0FBQyxnQkFB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VjayhhZGRyZXNzKTtcbiAgfVxuICByZXR1cm4gYml0Y29pbmpzLmFkZHJlc3MuZnJvbUJhc2U1OENoZWNrKGFkZHJlc3MpO1xufVxuXG5leHBvcnQgY29uc3QgeyBmcm9tQmVjaDMyLCB0b0JlY2gzMiB9ID0gYml0Y29pbmpzLmFkZHJlc3M7XG5cbmV4cG9ydCB7IEJhc2U1OENoZWNrUmVzdWx0LCBCZWNoMzJSZXN1bHQgfTtcbiJdfQ==
@@ -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 = (typeof addressFormats)[number];
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,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D;;;;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,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AAiB,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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzc0Zvcm1hdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hZGRyZXNzRm9ybWF0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBOzs7OztHQUtHO0FBQ0gseUNBQTJFO0FBQzNFLHVDQUE2RDtBQUU3RCxtQ0FBdUM7QUFFMUIsUUFBQSxjQUFjLEdBQUcsQ0FBQyxTQUFTLEVBQUUsVUFBVSxDQUFVLENBQUM7QUFJL0Q7Ozs7R0FJRztBQUNILFNBQWdCLHdCQUF3QixDQUFDLE1BQXFCLEVBQUUsT0FBZ0I7SUFDOUUsUUFBUSxNQUFNLEVBQUU7UUFDZCxLQUFLLFNBQVM7WUFDWixPQUFPLElBQUksQ0FBQztRQUNkLEtBQUssVUFBVTtZQUNiLE9BQU8sQ0FBQyxtQkFBUSxDQUFDLFdBQVcsRUFBRSxtQkFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDLFFBQVEsQ0FBQyxxQkFBVSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7S0FDL0U7SUFDRCxNQUFNLElBQUksS0FBSyxDQUFDLDBCQUEwQixNQUFNLEVBQUUsQ0FBQyxDQUFDO0FBQ3RELENBQUM7QUFSRCw0REFRQztBQUVEOzs7OztHQUtHO0FBQ0gsU0FBZ0IsMEJBQTBCLENBQUMsWUFBb0IsRUFBRSxNQUFxQixFQUFFLE9BQWdCO0lBQ3RHLElBQUksQ0FBQyx3QkFBd0IsQ0FBQyxNQUF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ywgb3V0cHV0U2NyaXB0XSA9IHRvT3V0cHV0U2NyaXB0QW5kRm9ybWF0KGFkZHJlc3MsIG5ldHdvcmssIGZvcm1hdHMpO1xuICByZXR1cm4gb3V0cHV0U2NyaXB0O1xufVxuXG4vKipcbiAqIEBwYXJhbSBhZGRyZXNzXG4gKiBAcGFyYW0gbmV0d29ya1xuICogQHJldHVybiBhZGRyZXNzIGluIGNhbm9uaWNhbCBmb3JtYXRcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHRvQ2Fub25pY2FsRm9ybWF0KGFkZHJlc3M6IHN0cmluZywgbmV0d29yazogTmV0d29yayk6IHN0cmluZyB7XG4gIHJldHVybiBmcm9tT3V0cHV0U2NyaXB0KHRvT3V0cHV0U2NyaXB0VHJ5Rm9ybWF0cyhhZGRyZXNzLCBuZXR3b3JrKSwgbmV0d29yayk7XG59XG4iXX0=
@@ -1,149 +1,51 @@
1
1
  /// <reference types="node" />
2
- import { SessionKey } from '@brandonblack/musig';
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 PsbtMusig2Participants {
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 PsbtMusig2PubNonce {
16
+ export interface PsbtMusig2NoncesKeyValueData {
26
17
  participantPubKey: Buffer;
27
18
  tapOutputKey: Buffer;
28
- pubNonce: Buffer;
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 encodePsbtMusig2Participants(participants: PsbtMusig2Participants): ProprietaryKeyValue;
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 encodePsbtMusig2PubNonce(nonce: PsbtMusig2PubNonce): ProprietaryKeyValue;
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 decodePsbtMusig2Participants(kv: ProprietaryKeyValue): PsbtMusig2Participants;
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
- * @returns psbt proprietary key for musig2 public nonce key value data
112
- * If no key value exists, undefined is returned.
113
- */
114
- export declare function parsePsbtMusig2Nonces(input: PsbtInput): PsbtMusig2PubNonce[] | undefined;
115
- /**
116
- * @returns psbt proprietary key for musig2 partial sig key value data
117
- * If no key value exists, undefined is returned.
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 getSigHashTypeFromSigs(partialSigs: PsbtMusig2PartialSig[]): {
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,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAUjD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAGL,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,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