@scure/btc-signer 1.8.0 → 2.0.0-beta.1
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/README.md +15 -12
- package/_type_test.js +10 -12
- package/_type_test.js.map +1 -1
- package/index.js +17 -61
- package/index.js.map +1 -1
- package/musig2.d.ts +2 -2
- package/musig2.d.ts.map +1 -1
- package/musig2.js +93 -91
- package/musig2.js.map +1 -1
- package/p2p.d.ts +7 -8
- package/p2p.d.ts.map +1 -1
- package/p2p.js +32 -38
- package/p2p.js.map +1 -1
- package/package.json +33 -70
- package/payment.js +73 -96
- package/payment.js.map +1 -1
- package/psbt.d.ts +224 -224
- package/psbt.d.ts.map +1 -1
- package/psbt.js +58 -63
- package/psbt.js.map +1 -1
- package/script.d.ts +125 -120
- package/script.d.ts.map +1 -1
- package/script.js +46 -146
- package/script.js.map +1 -1
- package/src/_type_test.ts +2 -2
- package/src/musig2.ts +45 -53
- package/src/p2p.ts +31 -43
- package/src/psbt.ts +7 -7
- package/src/script.ts +29 -26
- package/src/transaction.ts +31 -24
- package/src/utils.ts +45 -26
- package/src/utxo.ts +1 -1
- package/transaction.d.ts +23 -28
- package/transaction.d.ts.map +1 -1
- package/transaction.js +140 -154
- package/transaction.js.map +1 -1
- package/utils.d.ts +13 -7
- package/utils.d.ts.map +1 -1
- package/utils.js +60 -62
- package/utils.js.map +1 -1
- package/utxo.d.ts +45 -45
- package/utxo.d.ts.map +1 -1
- package/utxo.js +63 -59
- package/utxo.js.map +1 -1
- package/esm/_type_test.d.ts +0 -2
- package/esm/_type_test.d.ts.map +0 -1
- package/esm/_type_test.js +0 -57
- package/esm/_type_test.js.map +0 -1
- package/esm/index.d.ts +0 -22
- package/esm/index.d.ts.map +0 -1
- package/esm/index.js +0 -22
- package/esm/index.js.map +0 -1
- package/esm/musig2.d.ts +0 -148
- package/esm/musig2.d.ts.map +0 -1
- package/esm/musig2.js +0 -405
- package/esm/musig2.js.map +0 -1
- package/esm/p2p.d.ts +0 -38
- package/esm/p2p.d.ts.map +0 -1
- package/esm/p2p.js +0 -156
- package/esm/p2p.js.map +0 -1
- package/esm/package.json +0 -1
- package/esm/payment.d.ts +0 -200
- package/esm/payment.d.ts.map +0 -1
- package/esm/payment.js +0 -697
- package/esm/payment.js.map +0 -1
- package/esm/psbt.d.ts +0 -820
- package/esm/psbt.d.ts.map +0 -1
- package/esm/psbt.js +0 -409
- package/esm/psbt.js.map +0 -1
- package/esm/script.d.ts +0 -170
- package/esm/script.d.ts.map +0 -1
- package/esm/script.js +0 -356
- package/esm/script.js.map +0 -1
- package/esm/transaction.d.ts +0 -171
- package/esm/transaction.d.ts.map +0 -1
- package/esm/transaction.js +0 -1182
- package/esm/transaction.js.map +0 -1
- package/esm/utils.d.ts +0 -35
- package/esm/utils.d.ts.map +0 -1
- package/esm/utils.js +0 -118
- package/esm/utils.js.map +0 -1
- package/esm/utxo.d.ts +0 -198
- package/esm/utxo.d.ts.map +0 -1
- package/esm/utxo.js +0 -461
- package/esm/utxo.js.map +0 -1
- package/src/package.json +0 -3
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Audited & minimal library for creating, signing & decoding Bitcoin transactions.
|
|
|
10
10
|
- 🧪 Schnorr & Taproot BIP340/BIP341: P2TR, P2TR-NS, P2TR-MS
|
|
11
11
|
- 📨 BIP174 PSBT, BIP327 MuSig2
|
|
12
12
|
- 🗳️ Easy ordinals and inscriptions
|
|
13
|
-
- 🪶
|
|
13
|
+
- 🪶 39KB (gzipped) with all deps
|
|
14
14
|
|
|
15
15
|
Initial development has been funded by [Ryan Shea](https://shea.io).
|
|
16
16
|
Musig2 feature has been funded by [Arklabs](https://arklabs.to).
|
|
@@ -41,8 +41,6 @@ _Check out all web3 utility libraries:_ [ETH](https://github.com/paulmillr/micro
|
|
|
41
41
|
|
|
42
42
|
> `deno add jsr:@scure/btc-signer`
|
|
43
43
|
|
|
44
|
-
> `deno doc jsr:@scure/btc-signer` # command-line documentation
|
|
45
|
-
|
|
46
44
|
We support all major platforms and runtimes.
|
|
47
45
|
For [Deno](https://deno.land), ensure to use [npm specifier](https://deno.land/manual@v1.28.0/node/npm_specifiers).
|
|
48
46
|
For React Native, you may need a [polyfill for crypto.getRandomValues](https://github.com/LinusU/react-native-get-random-values).
|
|
@@ -89,8 +87,8 @@ BTC has several UTXO types:
|
|
|
89
87
|
|
|
90
88
|
- P2PK: Legacy, from 2010
|
|
91
89
|
- P2PKH, P2SH, P2MS: Classic
|
|
92
|
-
- P2WPKH, P2WSH:
|
|
93
|
-
- P2TR: Taproot
|
|
90
|
+
- P2WPKH, P2WSH: SegWit (signature is removed from tx hash calculation)
|
|
91
|
+
- P2TR: Taproot (schnorr signatures instead of ECDSA)
|
|
94
92
|
|
|
95
93
|
For test examples, the usage is as following:
|
|
96
94
|
|
|
@@ -158,7 +156,11 @@ deepStrictEqual(btc.p2sh(btc.p2wsh(btc.p2pkh(PubKey))), {
|
|
|
158
156
|
|
|
159
157
|
### P2WPKH (Witness Public Key Hash)
|
|
160
158
|
|
|
161
|
-
SegWit V0 version of [P2PKH](#p2pkh-public-key-hash).
|
|
159
|
+
SegWit V0 version of [P2PKH](#p2pkh-public-key-hash).
|
|
160
|
+
In SegWit, signature is removed from tx hash calculation.
|
|
161
|
+
|
|
162
|
+
Uses bech32 address.
|
|
163
|
+
Can't be wrapped in [P2WSH](#p2wsh-witness-script-hash).
|
|
162
164
|
|
|
163
165
|
```ts
|
|
164
166
|
const PubKey = hex.decode('030000000000000000000000000000000000000000000000000000000000000001');
|
|
@@ -196,6 +198,7 @@ deepStrictEqual(btc.p2sh(btc.p2pkh(PubKey)), {
|
|
|
196
198
|
### P2WSH (Witness Script Hash)
|
|
197
199
|
|
|
198
200
|
SegWit V0 version of [P2SH](#p2sh-script-hash).
|
|
201
|
+
In SegWit, signature is removed from tx hash calculation.
|
|
199
202
|
|
|
200
203
|
Required tx input fields to make it spendable: `witnessScript`
|
|
201
204
|
|
|
@@ -899,10 +902,10 @@ deepStrictEqual(tx.fee, 394n);
|
|
|
899
902
|
## MuSig2
|
|
900
903
|
|
|
901
904
|
MuSig2 implementation conforming to [BIP-327](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki)
|
|
902
|
-
is available in `@scure/btc-signer/musig2`. Check out [bip327-musig2.test.js](./test/bip327-musig2.test.js) as well:
|
|
905
|
+
is available in `@scure/btc-signer/musig2.js`. Check out [bip327-musig2.test.js](./test/bip327-musig2.test.js) as well:
|
|
903
906
|
|
|
904
907
|
```ts
|
|
905
|
-
import * as musig2 from '@scure/btc-signer/musig2';
|
|
908
|
+
import * as musig2 from '@scure/btc-signer/musig2.js';
|
|
906
909
|
// MuSig2 Multi-signature for Alice, Bob, and Carol
|
|
907
910
|
// 1. Key Generation (for each signer: Alice, Bob, Carol)
|
|
908
911
|
// - Alice's key generation
|
|
@@ -975,7 +978,7 @@ ElligatorSwift is Schnorr-like x-only ECDH with public keys indistinguishable fr
|
|
|
975
978
|
Check out [libsecp](https://github.com/bitcoin/bitcoin/blob/master/src/secp256k1/doc/ellswift.md) docs.
|
|
976
979
|
|
|
977
980
|
```ts
|
|
978
|
-
import { elligatorSwift } from '@scure/btc-signer/p2p';
|
|
981
|
+
import { elligatorSwift } from '@scure/btc-signer/p2p.js';
|
|
979
982
|
|
|
980
983
|
const alice = elligatorSwift.keygen();
|
|
981
984
|
const bob = elligatorSwift.keygen();
|
|
@@ -1011,9 +1014,9 @@ for (const k of [alice, bob]) {
|
|
|
1011
1014
|
### secp256k1 keys
|
|
1012
1015
|
|
|
1013
1016
|
```ts
|
|
1014
|
-
import { pubSchnorr, signSchnorr } from '@scure/btc-signer/utils';
|
|
1015
|
-
import { pubECDSA, signECDSA } from '@scure/btc-signer/utils';
|
|
1016
|
-
import { randomPrivateKeyBytes } from '@scure/btc-signer/utils';
|
|
1017
|
+
import { pubSchnorr, signSchnorr } from '@scure/btc-signer/utils.js';
|
|
1018
|
+
import { pubECDSA, signECDSA } from '@scure/btc-signer/utils.js';
|
|
1019
|
+
import { randomPrivateKeyBytes } from '@scure/btc-signer/utils.js';
|
|
1017
1020
|
|
|
1018
1021
|
const priv = randomPrivateKeyBytes();
|
|
1019
1022
|
const pub = pubSchnorr(priv);
|
package/_type_test.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const privKey1 = base_1.hex.decode('0101010101010101010101010101010101010101010101010101010101010101');
|
|
7
|
-
const P1 = secp256k1_1.secp256k1.getPublicKey(privKey1, true);
|
|
1
|
+
import { secp256k1 as secp } from '@noble/curves/secp256k1.js';
|
|
2
|
+
import { hex } from '@scure/base';
|
|
3
|
+
import * as btc from "./index.js";
|
|
4
|
+
const privKey1 = hex.decode('0101010101010101010101010101010101010101010101010101010101010101');
|
|
5
|
+
const P1 = secp.getPublicKey(privKey1, true);
|
|
8
6
|
const wpkh = btc.p2wpkh(P1);
|
|
9
7
|
const tx = new btc.Transaction();
|
|
10
8
|
// Basic input test
|
|
11
9
|
tx.addInput({
|
|
12
|
-
txid:
|
|
10
|
+
txid: hex.decode('0af50a00a22f74ece24c12cd667c290d3a35d48124a69f4082700589172a3aa2'),
|
|
13
11
|
index: 0,
|
|
14
12
|
...wpkh,
|
|
15
|
-
finalScriptSig:
|
|
13
|
+
finalScriptSig: Uint8Array.of(),
|
|
16
14
|
sequence: 1,
|
|
17
15
|
});
|
|
18
16
|
// Doesn't force any fields on input addition (only on sign)
|
|
@@ -23,16 +21,16 @@ tx.updateInput(0, {
|
|
|
23
21
|
sequence: 1,
|
|
24
22
|
});
|
|
25
23
|
const nonWitnessUtxo = '0200000001aad73931018bd25f84ae400b68848be09db706eac2ac18298babee71ab656f8b0000000048473044022058f6fc7c6a33e1b31548d481c826c015bd30135aad42cd67790dab66d2ad243b02204a1ced2604c6735b6393e5b41691dd78b00f0c5942fb9f751856faa938157dba01feffffff0280f0fa020000000017a9140fb9463421696b82c833af241c78c17ddbde493487d0f20a270100000017a91429ca74f8a08f81999428185c97b5d852e4063f618765000000';
|
|
26
|
-
const nonWitnessUtxoB =
|
|
24
|
+
const nonWitnessUtxoB = hex.decode(nonWitnessUtxo);
|
|
27
25
|
tx.updateInput(0, { nonWitnessUtxo: nonWitnessUtxo });
|
|
28
26
|
tx.updateInput(0, { nonWitnessUtxo: nonWitnessUtxoB });
|
|
29
27
|
tx.addInput({
|
|
30
|
-
txid:
|
|
28
|
+
txid: hex.decode('0af50a00a22f74ece24c12cd667c290d3a35d48124a69f4082700589172a3aa2'),
|
|
31
29
|
index: 0,
|
|
32
30
|
nonWitnessUtxo: nonWitnessUtxo,
|
|
33
31
|
});
|
|
34
32
|
tx.addInput({
|
|
35
|
-
txid:
|
|
33
|
+
txid: hex.decode('0af50a00a22f74ece24c12cd667c290d3a35d48124a69f4082700589172a3aa2'),
|
|
36
34
|
index: 0,
|
|
37
35
|
nonWitnessUtxo: nonWitnessUtxoB,
|
|
38
36
|
});
|
package/_type_test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_type_test.js","sourceRoot":"","sources":["src/_type_test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_type_test.js","sourceRoot":"","sources":["src/_type_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,kEAAkE,CAAC,CAAC;AAChG,MAAM,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAE7C,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,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G,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,CAAC;IACzC,aAAa;IACb,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,CAAC;IAC1C,aAAa;IACb,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,66 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._Estimator = exports._cmpBig = exports.SigHash = exports.PSBTCombine = exports.DEFAULT_SEQUENCE = exports.Decimal = exports.bip32Path = exports.TaprootControlBlock = exports._DebugPSBT = exports.WIF = exports.taprootListToTree = exports.sortedMultisig = exports.OutScript = exports.getAddress = exports.combinations = exports.Address = exports._sortPubkeys = exports.utils = exports.selectUTXO = exports.TEST_NETWORK = exports.TAPROOT_UNSPENDABLE_KEY = exports.NETWORK = exports.Transaction = exports.getInputType = exports.ScriptNum = exports.Script = exports.RawWitness = exports.RawTx = exports.OP = exports.MAX_SCRIPT_BYTE_LENGTH = exports.CompactSize = exports.p2wsh = exports.p2wpkh = exports.p2tr_pk = exports.p2tr_ns = exports.p2tr_ms = exports.p2tr = exports.p2sh = exports.p2pkh = exports.p2pk = exports.p2ms = exports.multisig = void 0;
|
|
4
1
|
/*! scure-btc-signer - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
5
|
-
|
|
2
|
+
import { compareBytes, concatBytes, isBytes, pubSchnorr, randomPrivateKeyBytes, taprootTweakPubkey, } from "./utils.js";
|
|
6
3
|
// should multisig be exported as classicMultisig?
|
|
7
4
|
// prettier-ignore
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var script_ts_1 = require("./script.js");
|
|
21
|
-
Object.defineProperty(exports, "CompactSize", { enumerable: true, get: function () { return script_ts_1.CompactSize; } });
|
|
22
|
-
Object.defineProperty(exports, "MAX_SCRIPT_BYTE_LENGTH", { enumerable: true, get: function () { return script_ts_1.MAX_SCRIPT_BYTE_LENGTH; } });
|
|
23
|
-
Object.defineProperty(exports, "OP", { enumerable: true, get: function () { return script_ts_1.OP; } });
|
|
24
|
-
Object.defineProperty(exports, "RawTx", { enumerable: true, get: function () { return script_ts_1.RawTx; } });
|
|
25
|
-
Object.defineProperty(exports, "RawWitness", { enumerable: true, get: function () { return script_ts_1.RawWitness; } });
|
|
26
|
-
Object.defineProperty(exports, "Script", { enumerable: true, get: function () { return script_ts_1.Script; } });
|
|
27
|
-
Object.defineProperty(exports, "ScriptNum", { enumerable: true, get: function () { return script_ts_1.ScriptNum; } });
|
|
28
|
-
var transaction_ts_1 = require("./transaction.js");
|
|
29
|
-
Object.defineProperty(exports, "getInputType", { enumerable: true, get: function () { return transaction_ts_1.getInputType; } });
|
|
30
|
-
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return transaction_ts_1.Transaction; } });
|
|
31
|
-
var utils_ts_2 = require("./utils.js");
|
|
32
|
-
Object.defineProperty(exports, "NETWORK", { enumerable: true, get: function () { return utils_ts_2.NETWORK; } });
|
|
33
|
-
Object.defineProperty(exports, "TAPROOT_UNSPENDABLE_KEY", { enumerable: true, get: function () { return utils_ts_2.TAPROOT_UNSPENDABLE_KEY; } });
|
|
34
|
-
Object.defineProperty(exports, "TEST_NETWORK", { enumerable: true, get: function () { return utils_ts_2.TEST_NETWORK; } });
|
|
35
|
-
var utxo_ts_1 = require("./utxo.js");
|
|
36
|
-
Object.defineProperty(exports, "selectUTXO", { enumerable: true, get: function () { return utxo_ts_1.selectUTXO; } });
|
|
37
|
-
exports.utils = {
|
|
38
|
-
isBytes: utils_ts_1.isBytes,
|
|
39
|
-
concatBytes: utils_ts_1.concatBytes,
|
|
40
|
-
compareBytes: utils_ts_1.compareBytes,
|
|
41
|
-
pubSchnorr: utils_ts_1.pubSchnorr,
|
|
42
|
-
randomPrivateKeyBytes: utils_ts_1.randomPrivateKeyBytes,
|
|
43
|
-
taprootTweakPubkey: utils_ts_1.taprootTweakPubkey,
|
|
5
|
+
export { multisig, p2ms, p2pk, p2pkh, p2sh, p2tr, p2tr_ms, p2tr_ns, p2tr_pk, p2wpkh, p2wsh } from "./payment.js";
|
|
6
|
+
export { CompactSize, MAX_SCRIPT_BYTE_LENGTH, OP, RawTx, RawWitness, Script, ScriptNum, } from "./script.js";
|
|
7
|
+
export { getInputType, Transaction } from "./transaction.js";
|
|
8
|
+
export { NETWORK, TAPROOT_UNSPENDABLE_KEY, TEST_NETWORK } from "./utils.js";
|
|
9
|
+
export { selectUTXO } from "./utxo.js";
|
|
10
|
+
export const utils = {
|
|
11
|
+
isBytes,
|
|
12
|
+
concatBytes,
|
|
13
|
+
compareBytes,
|
|
14
|
+
pubSchnorr,
|
|
15
|
+
randomPrivateKeyBytes,
|
|
16
|
+
taprootTweakPubkey,
|
|
44
17
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return payment_ts_2.getAddress; } });
|
|
50
|
-
Object.defineProperty(exports, "OutScript", { enumerable: true, get: function () { return payment_ts_2.OutScript; } });
|
|
51
|
-
Object.defineProperty(exports, "sortedMultisig", { enumerable: true, get: function () { return payment_ts_2.sortedMultisig; } });
|
|
52
|
-
Object.defineProperty(exports, "taprootListToTree", { enumerable: true, get: function () { return payment_ts_2.taprootListToTree; } });
|
|
53
|
-
Object.defineProperty(exports, "WIF", { enumerable: true, get: function () { return payment_ts_2.WIF; } });
|
|
54
|
-
var psbt_ts_1 = require("./psbt.js"); // remove
|
|
55
|
-
Object.defineProperty(exports, "_DebugPSBT", { enumerable: true, get: function () { return psbt_ts_1._DebugPSBT; } });
|
|
56
|
-
Object.defineProperty(exports, "TaprootControlBlock", { enumerable: true, get: function () { return psbt_ts_1.TaprootControlBlock; } });
|
|
57
|
-
var transaction_ts_2 = require("./transaction.js"); // remove
|
|
58
|
-
Object.defineProperty(exports, "bip32Path", { enumerable: true, get: function () { return transaction_ts_2.bip32Path; } });
|
|
59
|
-
Object.defineProperty(exports, "Decimal", { enumerable: true, get: function () { return transaction_ts_2.Decimal; } });
|
|
60
|
-
Object.defineProperty(exports, "DEFAULT_SEQUENCE", { enumerable: true, get: function () { return transaction_ts_2.DEFAULT_SEQUENCE; } });
|
|
61
|
-
Object.defineProperty(exports, "PSBTCombine", { enumerable: true, get: function () { return transaction_ts_2.PSBTCombine; } });
|
|
62
|
-
Object.defineProperty(exports, "SigHash", { enumerable: true, get: function () { return transaction_ts_2.SigHash; } });
|
|
63
|
-
var utxo_ts_2 = require("./utxo.js");
|
|
64
|
-
Object.defineProperty(exports, "_cmpBig", { enumerable: true, get: function () { return utxo_ts_2._cmpBig; } });
|
|
65
|
-
Object.defineProperty(exports, "_Estimator", { enumerable: true, get: function () { return utxo_ts_2._Estimator; } });
|
|
18
|
+
export { _sortPubkeys, Address, combinations, getAddress, OutScript, sortedMultisig, taprootListToTree, WIF, } from "./payment.js"; // remove
|
|
19
|
+
export { _DebugPSBT, TaprootControlBlock } from "./psbt.js"; // remove
|
|
20
|
+
export { bip32Path, Decimal, DEFAULT_SEQUENCE, PSBTCombine, SigHash } from "./transaction.js"; // remove
|
|
21
|
+
export { _cmpBig, _Estimator } from "./utxo.js";
|
|
66
22
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,OAAO,EACL,YAAY,EACZ,WAAW,EACX,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,kDAAkD;AAClD,kBAAkB;AAClB,OAAO,EACL,QAAQ,EACR,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EACxE,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,EAAE,EACF,KAAK,EACL,UAAU,EACV,MAAM,EACN,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,OAAO;IACP,WAAW;IACX,YAAY;IACZ,UAAU;IACV,qBAAqB;IACrB,kBAAkB;CACnB,CAAC;AAEF,OAAO,EACL,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,GAAG,GACJ,MAAM,cAAc,CAAC,CAAC,SAAS;AAGhC,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC,CAAC,SAAS;AACtE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC,CAAC,SAAS;AACxG,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
|
package/musig2.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare function sortKeys(publicKeys: Uint8Array[]): Uint8Array[];
|
|
|
38
38
|
* @throws {InvalidContributionErr} If any of the public keys are invalid and cannot be processed.
|
|
39
39
|
*/
|
|
40
40
|
export declare function keyAggregate(publicKeys: Uint8Array[], tweaks?: Uint8Array[], isXonly?: boolean[]): {
|
|
41
|
-
aggPublicKey: import("@noble/curves/abstract/weierstrass").
|
|
41
|
+
aggPublicKey: import("@noble/curves/abstract/weierstrass.js").WeierstrassPoint<bigint>;
|
|
42
42
|
gAcc: bigint;
|
|
43
43
|
tweakAcc: bigint;
|
|
44
44
|
};
|
|
@@ -47,7 +47,7 @@ export declare function keyAggregate(publicKeys: Uint8Array[], tweaks?: Uint8Arr
|
|
|
47
47
|
* @param ctx The result of the keyAggregate function.
|
|
48
48
|
* @returns The aggregate public key as a byte array.
|
|
49
49
|
*/
|
|
50
|
-
export declare function keyAggExport(ctx: ReturnType<typeof keyAggregate>): Uint8Array
|
|
50
|
+
export declare function keyAggExport(ctx: ReturnType<typeof keyAggregate>): Uint8Array;
|
|
51
51
|
/**
|
|
52
52
|
* Generates a nonce pair (public and secret) for MuSig2 signing.
|
|
53
53
|
* @param publicKey The individual public key of the signer (Uint8Array).
|
package/musig2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"musig2.d.ts","sourceRoot":"","sources":["src/musig2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"musig2.d.ts","sourceRoot":"","sources":["src/musig2.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAChE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IAAE,WAAW,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAC3E;;;GAGG;AACH,qBAAa,s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