xpi-ts 0.2.22 → 0.2.24
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/dist/cjs/lib/bitcore/crypto/point.js +2 -2
- package/dist/cjs/lib/bitcore/index.js +162 -162
- package/dist/esm/lib/bitcore/crypto/point.js +2 -2
- package/dist/esm/lib/bitcore/index.js +42 -42
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/address.d.ts +116 -0
- package/dist/types/lib/bitcore/address.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/block.d.ts +214 -0
- package/dist/types/lib/bitcore/block/block.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/blockheader.d.ts +220 -0
- package/dist/types/lib/bitcore/block/blockheader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/block/merkleblock.d.ts +206 -0
- package/dist/types/lib/bitcore/block/merkleblock.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/bn.d.ts +224 -0
- package/dist/types/lib/bitcore/crypto/bn.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts +122 -0
- package/dist/types/lib/bitcore/crypto/ecdsa.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/hash.d.ts +56 -0
- package/dist/types/lib/bitcore/crypto/hash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/index.d.ts +4 -0
- package/dist/types/lib/bitcore/crypto/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/musig2.d.ts +282 -0
- package/dist/types/lib/bitcore/crypto/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/point.d.ts +87 -0
- package/dist/types/lib/bitcore/crypto/point.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/random.d.ts +48 -0
- package/dist/types/lib/bitcore/crypto/random.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts +203 -0
- package/dist/types/lib/bitcore/crypto/schnorr.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/signature.d.ts +452 -0
- package/dist/types/lib/bitcore/crypto/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts +46 -0
- package/dist/types/lib/bitcore/crypto/sigtype.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58.d.ts +68 -0
- package/dist/types/lib/bitcore/encoding/base58.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/base58check.d.ts +58 -0
- package/dist/types/lib/bitcore/encoding/base58check.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts +112 -0
- package/dist/types/lib/bitcore/encoding/bufferreader.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts +144 -0
- package/dist/types/lib/bitcore/encoding/bufferwriter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/encoding/varint.d.ts +86 -0
- package/dist/types/lib/bitcore/encoding/varint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdprivatekey.d.ts +59 -0
- package/dist/types/lib/bitcore/hdprivatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/hdpublickey.d.ts +145 -0
- package/dist/types/lib/bitcore/hdpublickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/index.d.ts +58 -54
- package/dist/types/lib/bitcore/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/message.d.ts +63 -0
- package/dist/types/lib/bitcore/message.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/errors.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts +106 -0
- package/dist/types/lib/bitcore/mnemonic/mnemonic.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts +13 -0
- package/dist/types/lib/bitcore/mnemonic/pbkdf2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/english.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts +5 -0
- package/dist/types/lib/bitcore/mnemonic/words/french.d.ts.map +1 -1
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts +4 -0
- package/dist/types/lib/bitcore/mnemonic/words/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/index.d.ts +14 -0
- package/dist/types/lib/bitcore/musig2/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/session.d.ts +254 -0
- package/dist/types/lib/bitcore/musig2/session.d.ts.map +1 -1
- package/dist/types/lib/bitcore/musig2/signer.d.ts +212 -0
- package/dist/types/lib/bitcore/musig2/signer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/networks.d.ts +17 -0
- package/dist/types/lib/bitcore/networks.d.ts.map +1 -1
- package/dist/types/lib/bitcore/opcode.d.ts +151 -0
- package/dist/types/lib/bitcore/opcode.d.ts.map +1 -1
- package/dist/types/lib/bitcore/privatekey.d.ts +80 -0
- package/dist/types/lib/bitcore/privatekey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/publickey.d.ts +195 -0
- package/dist/types/lib/bitcore/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/chunk.d.ts +51 -0
- package/dist/types/lib/bitcore/script/chunk.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts +60 -0
- package/dist/types/lib/bitcore/script/interpreter/condition-stack.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts +23 -0
- package/dist/types/lib/bitcore/script/interpreter/index.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts +86 -0
- package/dist/types/lib/bitcore/script/interpreter/interpreter.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts +115 -0
- package/dist/types/lib/bitcore/script/interpreter/script-num.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts +119 -0
- package/dist/types/lib/bitcore/script/interpreter/types.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script/taproot.d.ts +297 -0
- package/dist/types/lib/bitcore/script/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/script.d.ts +510 -0
- package/dist/types/lib/bitcore/script.d.ts.map +1 -1
- package/dist/types/lib/bitcore/taproot/musig2.d.ts +153 -0
- package/dist/types/lib/bitcore/taproot/musig2.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisig.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/multisigscripthash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts +8 -0
- package/dist/types/lib/bitcore/transaction/input/publickey.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts +14 -0
- package/dist/types/lib/bitcore/transaction/input/publickeyhash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts +22 -0
- package/dist/types/lib/bitcore/transaction/input/taproot.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/input.d.ts +418 -0
- package/dist/types/lib/bitcore/transaction/input.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts +110 -0
- package/dist/types/lib/bitcore/transaction/outpoint.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/output.d.ts +83 -0
- package/dist/types/lib/bitcore/transaction/output.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/sighash.d.ts +69 -0
- package/dist/types/lib/bitcore/transaction/sighash.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/signature.d.ts +98 -0
- package/dist/types/lib/bitcore/transaction/signature.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/transaction.d.ts +379 -0
- package/dist/types/lib/bitcore/transaction/transaction.d.ts.map +1 -1
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts +61 -0
- package/dist/types/lib/bitcore/transaction/unspentoutput.d.ts.map +1 -1
- package/dist/types/lib/bitcore/unit.d.ts +140 -0
- package/dist/types/lib/bitcore/unit.d.ts.map +1 -1
- package/dist/types/lib/bitcore/uri.d.ts +34 -0
- package/dist/types/lib/bitcore/uri.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/base32.d.ts +55 -0
- package/dist/types/lib/bitcore/util/base32.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/bits.d.ts +76 -0
- package/dist/types/lib/bitcore/util/bits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/buffer.d.ts +135 -0
- package/dist/types/lib/bitcore/util/buffer.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/convertBits.d.ts +15 -0
- package/dist/types/lib/bitcore/util/convertBits.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/js.d.ts +19 -0
- package/dist/types/lib/bitcore/util/js.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/merkle.d.ts +85 -0
- package/dist/types/lib/bitcore/util/merkle.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util/preconditions.d.ts +29 -0
- package/dist/types/lib/bitcore/util/preconditions.d.ts.map +1 -1
- package/dist/types/lib/bitcore/util.d.ts +7 -0
- package/dist/types/lib/bitcore/util.d.ts.map +1 -1
- package/dist/types/lib/bitcore/xaddress.d.ts +117 -0
- package/dist/types/lib/bitcore/xaddress.d.ts.map +1 -1
- package/dist/types/lib/lokad.d.ts +292 -0
- package/dist/types/lib/lokad.d.ts.map +1 -1
- package/dist/types/lib/nft.d.ts +434 -0
- package/dist/types/lib/nft.d.ts.map +1 -1
- package/dist/types/lib/rank/api.d.ts +13 -0
- package/dist/types/lib/rank/api.d.ts.map +1 -1
- package/dist/types/lib/rank/index.d.ts +153 -0
- package/dist/types/lib/rank/index.d.ts.map +1 -1
- package/dist/types/lib/rank/opcode.d.ts +6 -2
- package/dist/types/lib/rank/opcode.d.ts.map +1 -1
- package/dist/types/lib/rank/script.d.ts +10 -0
- package/dist/types/lib/rank/script.d.ts.map +1 -1
- package/dist/types/lib/rank/transaction.d.ts +11 -0
- package/dist/types/lib/rank/transaction.d.ts.map +1 -1
- package/dist/types/lib/rpc.d.ts +176 -0
- package/dist/types/lib/rpc.d.ts.map +1 -1
- package/dist/types/utils/constants.d.ts +27 -0
- package/dist/types/utils/constants.d.ts.map +1 -1
- package/dist/types/utils/env.d.ts +15 -0
- package/dist/types/utils/env.d.ts.map +1 -1
- package/dist/types/utils/string.d.ts +57 -0
- package/dist/types/utils/string.d.ts.map +1 -1
- package/dist/types/utils/wallet.d.ts +43 -1
- package/dist/types/utils/wallet.d.ts.map +1 -1
- package/package.json +1 -1
- package/tsconfig.types.json +2 -1
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025-2026 The Lotusia Stewardship
|
|
3
|
+
* Github: https://github.com/LotusiaStewardship
|
|
4
|
+
* License: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Taproot + MuSig2 Integration
|
|
8
|
+
*
|
|
9
|
+
* This module provides integration between MuSig2 key aggregation and
|
|
10
|
+
* Taproot outputs, enabling privacy-preserving multi-signature spending
|
|
11
|
+
* via Taproot key paths.
|
|
12
|
+
*
|
|
13
|
+
* Key Features:
|
|
14
|
+
* - Use MuSig2 aggregated keys as Taproot internal keys
|
|
15
|
+
* - Handle Taproot tweaking for aggregated keys
|
|
16
|
+
* - Support both key-path and script-path spending
|
|
17
|
+
* - Full compatibility with existing Taproot implementation
|
|
18
|
+
*
|
|
19
|
+
* @module TaprootMuSig
|
|
20
|
+
*/
|
|
1
21
|
import { PublicKey } from '../publickey';
|
|
2
22
|
import { PrivateKey } from '../privatekey';
|
|
3
23
|
import { Address } from '../address';
|
|
@@ -7,21 +27,154 @@ import { BN, Point } from '../crypto/index';
|
|
|
7
27
|
import { type MuSig2KeyAggContext, type MuSig2Nonce, type MuSig2AggregatedNonce } from '../crypto/musig2';
|
|
8
28
|
import { type TapNode, type TapLeaf } from '../script/taproot';
|
|
9
29
|
import type { Buffer } from 'buffer/';
|
|
30
|
+
/**
|
|
31
|
+
* Result of MuSig2 Taproot key creation
|
|
32
|
+
*/
|
|
10
33
|
export interface MuSig2TaprootKeyResult {
|
|
34
|
+
/** Aggregated public key (before Taproot tweak) */
|
|
11
35
|
aggregatedPubKey: PublicKey;
|
|
36
|
+
/** Taproot commitment (aggregated key + tweak) */
|
|
12
37
|
commitment: PublicKey;
|
|
38
|
+
/** Taproot output script */
|
|
13
39
|
script: Script;
|
|
40
|
+
/** Key aggregation context (needed for signing) */
|
|
14
41
|
keyAggContext: MuSig2KeyAggContext;
|
|
42
|
+
/** Merkle root (if using script tree) */
|
|
15
43
|
merkleRoot: Buffer;
|
|
44
|
+
/** Taproot tweak value */
|
|
16
45
|
tweak: Buffer;
|
|
17
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Build a MuSig2 aggregated key for Taproot (key-path only)
|
|
49
|
+
*
|
|
50
|
+
* Creates a Taproot output using MuSig2 aggregated key as the internal key.
|
|
51
|
+
* When spent via key path, the transaction looks like a single-sig spend,
|
|
52
|
+
* providing maximum privacy for multi-sig.
|
|
53
|
+
*
|
|
54
|
+
* Algorithm:
|
|
55
|
+
* 1. Aggregate signer public keys: Q = Σ(aᵢ·Pᵢ)
|
|
56
|
+
* 2. Compute Taproot tweak: t = H("TapTweak", Q || merkle_root)
|
|
57
|
+
* 3. Compute commitment: C = Q + t·G
|
|
58
|
+
* 4. Build Taproot script: OP_SCRIPTTYPE OP_1 <33-byte C>
|
|
59
|
+
*
|
|
60
|
+
* @param signerPubKeys - Array of signer public keys to aggregate
|
|
61
|
+
* @param state - Optional 32-byte Taproot state
|
|
62
|
+
* @returns MuSig2 Taproot key result with all necessary data for signing
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const result = buildMuSigTaprootKey([
|
|
67
|
+
* alice.publicKey,
|
|
68
|
+
* bob.publicKey,
|
|
69
|
+
* carol.publicKey
|
|
70
|
+
* ])
|
|
71
|
+
*
|
|
72
|
+
* console.log('Taproot script:', result.script.toString())
|
|
73
|
+
* console.log('Aggregated key:', result.aggregatedPubKey.toString())
|
|
74
|
+
* console.log('Commitment:', result.commitment.toString())
|
|
75
|
+
*
|
|
76
|
+
* // Use result.script as output in transaction
|
|
77
|
+
* // Use result.keyAggContext when signing
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
18
80
|
export declare function buildMuSig2TaprootKey(signerPubKeys: PublicKey[]): MuSig2TaprootKeyResult;
|
|
81
|
+
/**
|
|
82
|
+
* Build a MuSig2 aggregated key for Taproot with script tree
|
|
83
|
+
*
|
|
84
|
+
* Creates a Taproot output using MuSig2 aggregated key as the internal key,
|
|
85
|
+
* with alternative spending conditions in a script tree.
|
|
86
|
+
*
|
|
87
|
+
* Algorithm:
|
|
88
|
+
* 1. Aggregate signer public keys: Q = Σ(aᵢ·Pᵢ)
|
|
89
|
+
* 2. Build script tree and compute merkle root
|
|
90
|
+
* 3. Compute Taproot tweak: t = H("TapTweak", Q || merkle_root)
|
|
91
|
+
* 4. Compute commitment: C = Q + t·G
|
|
92
|
+
* 5. Build Taproot script with commitment
|
|
93
|
+
*
|
|
94
|
+
* @param signerPubKeys - Array of signer public keys
|
|
95
|
+
* @param scriptTree - Taproot script tree structure
|
|
96
|
+
* @param state - Optional 32-byte Taproot state
|
|
97
|
+
* @returns MuSig2 Taproot key result with script tree info
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* // 3-of-3 with timelock fallback
|
|
102
|
+
* const tree = {
|
|
103
|
+
* type: 'leaf',
|
|
104
|
+
* script: timelockScript
|
|
105
|
+
* }
|
|
106
|
+
*
|
|
107
|
+
* const result = buildMuSigTaprootKeyWithScripts(
|
|
108
|
+
* [alice.publicKey, bob.publicKey, carol.publicKey],
|
|
109
|
+
* tree
|
|
110
|
+
* )
|
|
111
|
+
*
|
|
112
|
+
* // Cooperative spend: Use MuSig2 key path
|
|
113
|
+
* // Fallback: Use timelock script path
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
19
116
|
export declare function buildMuSig2TaprootKeyWithScripts(signerPubKeys: PublicKey[], scriptTree: TapNode, state: Buffer): MuSig2TaprootKeyResult & {
|
|
20
117
|
leaves: TapLeaf[];
|
|
21
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Create MuSig2 partial signature for Taproot key path spending
|
|
121
|
+
*
|
|
122
|
+
* BIP327 Approach: Only signer 0 adds the tweak term
|
|
123
|
+
*
|
|
124
|
+
* Algorithm:
|
|
125
|
+
* 1. All signers compute normal partial signature: s_i = k + e·a_i·x_i
|
|
126
|
+
* (where e uses the COMMITMENT in challenge hash!)
|
|
127
|
+
* 2. Signer 0 ONLY: Add tweak correction term
|
|
128
|
+
*
|
|
129
|
+
* The key insight: when verifying against commitment Q' = Q + t·G,
|
|
130
|
+
* we need s·G = R + e·Q', but normal MuSig2 gives s·G = R + e·Q.
|
|
131
|
+
* So signer 0 adds e·t to bridge the gap: (R + e·Q + e·t·G) = R + e·Q'
|
|
132
|
+
*
|
|
133
|
+
* @param secretNonce - Signer's secret nonce
|
|
134
|
+
* @param privateKey - Signer's private key (UNTWEAKED)
|
|
135
|
+
* @param keyAggContext - Key aggregation context (with INTERNAL key)
|
|
136
|
+
* @param signerIndex - Index of this signer
|
|
137
|
+
* @param aggregatedNonce - Aggregated nonces from all signers
|
|
138
|
+
* @param message - Message to sign (transaction sighash)
|
|
139
|
+
* @param tweak - Taproot tweak (from result.tweak)
|
|
140
|
+
* @returns Partial signature for Taproot spending
|
|
141
|
+
*/
|
|
22
142
|
export declare function signTaprootKeyPathWithMuSig2(secretNonce: MuSig2Nonce, privateKey: PrivateKey, keyAggContext: MuSig2KeyAggContext, signerIndex: number, aggregatedNonce: MuSig2AggregatedNonce, message: Buffer, tweak: Buffer): BN;
|
|
143
|
+
/**
|
|
144
|
+
* Verify MuSig2 partial signature for Taproot key path
|
|
145
|
+
*
|
|
146
|
+
* For signer 0: must subtract the tweak term before verification
|
|
147
|
+
* For other signers: verify normally with commitment
|
|
148
|
+
*
|
|
149
|
+
* @param partialSig - Partial signature to verify
|
|
150
|
+
* @param publicNonce - Signer's public nonce
|
|
151
|
+
* @param publicKey - Signer's public key
|
|
152
|
+
* @param keyAggContext - Key aggregation context
|
|
153
|
+
* @param signerIndex - Index of the signer
|
|
154
|
+
* @param aggregatedNonce - Aggregated nonces
|
|
155
|
+
* @param message - Message being signed
|
|
156
|
+
* @param tweak - Taproot tweak (from result.tweak)
|
|
157
|
+
* @returns true if partial signature is valid
|
|
158
|
+
*/
|
|
23
159
|
export declare function verifyTaprootKeyPathMuSigPartial(partialSig: BN, publicNonce: [Point, Point], publicKey: PublicKey, keyAggContext: MuSig2KeyAggContext, signerIndex: number, aggregatedNonce: MuSig2AggregatedNonce, message: Buffer, tweak: Buffer): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Helper to check if a script is a MuSig2 Taproot output
|
|
162
|
+
*
|
|
163
|
+
* Note: There's no way to detect if a Taproot script uses MuSig2
|
|
164
|
+
* because the aggregated key looks like a regular public key.
|
|
165
|
+
* This function just checks if it's a valid Taproot script.
|
|
166
|
+
*
|
|
167
|
+
* @param script - Script to check
|
|
168
|
+
* @returns true if it's a Taproot script (may or may not use MuSig2)
|
|
169
|
+
*/
|
|
24
170
|
export declare function isMuSigTaprootOutput(script: Script): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Utility to create Taproot address from MuSig2 aggregated key
|
|
173
|
+
*
|
|
174
|
+
* @param signerPubKeys - Array of signer public keys
|
|
175
|
+
* @param network - Network for address ('livenet' or 'testnet')
|
|
176
|
+
* @returns Taproot address and key info
|
|
177
|
+
*/
|
|
25
178
|
export declare function createMuSigTaprootAddress(signerPubKeys: PublicKey[], network?: NetworkName): {
|
|
26
179
|
address: Address;
|
|
27
180
|
script: Script;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"musig2.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/taproot/musig2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"musig2.d.ts","sourceRoot":"","sources":["../../../../../lib/bitcore/taproot/musig2.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,EAAE,EAAE,EAAE,KAAK,EAAQ,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,OAAO,EACb,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,mDAAmD;IACnD,gBAAgB,EAAE,SAAS,CAAA;IAE3B,kDAAkD;IAClD,UAAU,EAAE,SAAS,CAAA;IAErB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAA;IAEd,mDAAmD;IACnD,aAAa,EAAE,mBAAmB,CAAA;IAElC,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAA;IAElB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,SAAS,EAAE,GACzB,sBAAsB,CAyBxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,gCAAgC,CAC9C,aAAa,EAAE,SAAS,EAAE,EAC1B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,MAAM,GACZ,sBAAsB,GAAG;IAAE,MAAM,EAAE,OAAO,EAAE,CAAA;CAAE,CAwBhD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,mBAAmB,EAClC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,qBAAqB,EACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,EAAE,CA6DJ;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gCAAgC,CAC9C,UAAU,EAAE,EAAE,EACd,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAC3B,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,mBAAmB,EAClC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,qBAAqB,EACtC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAsDT;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,SAAS,EAAE,EAC1B,OAAO,CAAC,EAAE,WAAW,GACpB;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,SAAS,CAAA;IACrB,aAAa,EAAE,mBAAmB,CAAA;CACnC,CA2BA"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultisigInput - Input for spending bare multisig outputs
|
|
3
|
+
*
|
|
4
|
+
* Bitcore-compatible specialized input for bare multisig scripts.
|
|
5
|
+
*/
|
|
1
6
|
import { Input, type InputData } from '../input';
|
|
7
|
+
/**
|
|
8
|
+
* Input for spending bare multisig outputs
|
|
9
|
+
*/
|
|
2
10
|
export declare class MultisigInput extends Input {
|
|
3
11
|
constructor(data?: InputData);
|
|
4
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multisig.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/multisig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multisig.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/multisig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAEhD;;GAEG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,IAAI,CAAC,EAAE,SAAS;CAG7B"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultisigScriptHashInput - Input for spending P2SH multisig outputs
|
|
3
|
+
*
|
|
4
|
+
* Bitcore-compatible specialized input for Pay-to-Script-Hash multisig scripts.
|
|
5
|
+
*/
|
|
1
6
|
import { Input, type InputData } from '../input';
|
|
7
|
+
/**
|
|
8
|
+
* Input for spending Pay-to-Script-Hash multisig outputs
|
|
9
|
+
*/
|
|
2
10
|
export declare class MultisigScriptHashInput extends Input {
|
|
3
11
|
constructor(data?: InputData);
|
|
4
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multisigscripthash.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/multisigscripthash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multisigscripthash.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/multisigscripthash.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAEhD;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,IAAI,CAAC,EAAE,SAAS;CAG7B"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PublicKeyInput - Input for spending P2PK outputs
|
|
3
|
+
*
|
|
4
|
+
* Bitcore-compatible specialized input for Pay-to-Public-Key scripts.
|
|
5
|
+
*/
|
|
1
6
|
import { Input, type InputData } from '../input';
|
|
7
|
+
/**
|
|
8
|
+
* Input for spending Pay-to-Public-Key (P2PK) outputs
|
|
9
|
+
*/
|
|
2
10
|
export declare class PublicKeyInput extends Input {
|
|
3
11
|
constructor(data?: InputData);
|
|
4
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publickey.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/publickey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publickey.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/publickey.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAEhD;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,IAAI,CAAC,EAAE,SAAS;CAG7B"}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PublicKeyHashInput - Input for spending P2PKH outputs
|
|
3
|
+
*
|
|
4
|
+
* Bitcore-compatible specialized input for Pay-to-Public-Key-Hash scripts.
|
|
5
|
+
* This is the most common input type used by wallet applications.
|
|
6
|
+
*
|
|
7
|
+
* Used by lotus-bot: new Input.PublicKeyHash({ prevTxId, outputIndex, output, script })
|
|
8
|
+
*/
|
|
1
9
|
import { Input, type InputData } from '../input';
|
|
10
|
+
/**
|
|
11
|
+
* Alias type for Bitcore compat: InputData with Bitcore-style property names
|
|
12
|
+
*/
|
|
2
13
|
export type PublicKeyHashInputData = InputData;
|
|
14
|
+
/**
|
|
15
|
+
* Input for spending Pay-to-Public-Key-Hash (P2PKH) outputs
|
|
16
|
+
*/
|
|
3
17
|
export declare class PublicKeyHashInput extends Input {
|
|
4
18
|
constructor(data?: InputData);
|
|
5
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publickeyhash.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/publickeyhash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publickeyhash.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/publickeyhash.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,CAAA;AAE9C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,IAAI,CAAC,EAAE,SAAS;CAG7B"}
|
|
@@ -1,17 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TaprootInput - Input for spending Taproot outputs
|
|
3
|
+
*
|
|
4
|
+
* Bitcore-compatible specialized input for Lotus Taproot scripts.
|
|
5
|
+
* Supports both key-path and script-path spending.
|
|
6
|
+
*
|
|
7
|
+
* Used by nft.ts for NFT transfer transactions.
|
|
8
|
+
*/
|
|
1
9
|
import { Script } from '../../script';
|
|
2
10
|
import { PublicKey } from '../../publickey';
|
|
3
11
|
import { Input, type InputData } from '../input';
|
|
4
12
|
import type { Buffer } from 'buffer/';
|
|
13
|
+
/**
|
|
14
|
+
* Additional data for Taproot input construction
|
|
15
|
+
*/
|
|
5
16
|
export interface TaprootInputData extends InputData {
|
|
17
|
+
/** Internal public key for the Taproot output */
|
|
6
18
|
internalPubKey?: PublicKey;
|
|
19
|
+
/** Merkle root of the tap tree */
|
|
7
20
|
merkleRoot?: Buffer;
|
|
21
|
+
/** Control block for script-path spending */
|
|
8
22
|
controlBlock?: Buffer;
|
|
23
|
+
/** Tap script for script-path spending */
|
|
9
24
|
tapScript?: Script;
|
|
10
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Input for spending Taproot outputs (key-path or script-path)
|
|
28
|
+
*/
|
|
11
29
|
export declare class TaprootInput extends Input {
|
|
30
|
+
/** Internal public key for the Taproot output */
|
|
12
31
|
internalPubKey?: PublicKey;
|
|
32
|
+
/** Merkle root of the tap tree */
|
|
13
33
|
merkleRoot?: Buffer;
|
|
34
|
+
/** Control block for script-path spending */
|
|
14
35
|
controlBlock?: Buffer;
|
|
36
|
+
/** Tap script for script-path spending */
|
|
15
37
|
tapScript?: Script;
|
|
16
38
|
constructor(data?: TaprootInputData);
|
|
17
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taproot.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/taproot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taproot.d.ts","sourceRoot":"","sources":["../../../../../../lib/bitcore/transaction/input/taproot.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,iDAAiD;IACjD,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,iDAAiD;IACjD,cAAc,CAAC,EAAE,SAAS,CAAA;IAC1B,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAA;gBAEN,IAAI,CAAC,EAAE,gBAAgB;CASpC"}
|