@did-btcr2/method 0.34.0 → 0.35.0
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/.tsbuildinfo +1 -1
- package/dist/browser.js +190 -112
- package/dist/browser.mjs +190 -112
- package/dist/cjs/index.js +130 -60
- package/dist/esm/core/aggregation/cohort.js +5 -1
- package/dist/esm/core/aggregation/cohort.js.map +1 -1
- package/dist/esm/core/aggregation/participant.js +25 -8
- package/dist/esm/core/aggregation/participant.js.map +1 -1
- package/dist/esm/core/aggregation/runner/participant-runner.js +9 -1
- package/dist/esm/core/aggregation/runner/participant-runner.js.map +1 -1
- package/dist/esm/core/aggregation/runner/service-runner.js +4 -1
- package/dist/esm/core/aggregation/runner/service-runner.js.map +1 -1
- package/dist/esm/core/aggregation/service.js +4 -4
- package/dist/esm/core/aggregation/service.js.map +1 -1
- package/dist/esm/core/aggregation/signer.js +33 -0
- package/dist/esm/core/aggregation/signer.js.map +1 -0
- package/dist/esm/core/aggregation/signing-session.js +34 -11
- package/dist/esm/core/aggregation/signing-session.js.map +1 -1
- package/dist/esm/core/aggregation/transport/in-memory.js +5 -2
- package/dist/esm/core/aggregation/transport/in-memory.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/types/core/aggregation/cohort.d.ts.map +1 -1
- package/dist/types/core/aggregation/participant.d.ts +17 -4
- package/dist/types/core/aggregation/participant.d.ts.map +1 -1
- package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -1
- package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -1
- package/dist/types/core/aggregation/service.d.ts +10 -4
- package/dist/types/core/aggregation/service.d.ts.map +1 -1
- package/dist/types/core/aggregation/signer.d.ts +50 -0
- package/dist/types/core/aggregation/signer.d.ts.map +1 -0
- package/dist/types/core/aggregation/signing-session.d.ts +13 -5
- package/dist/types/core/aggregation/signing-session.d.ts.map +1 -1
- package/dist/types/core/aggregation/transport/in-memory.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/core/aggregation/cohort.ts +5 -1
- package/src/core/aggregation/participant.ts +38 -12
- package/src/core/aggregation/runner/participant-runner.ts +9 -1
- package/src/core/aggregation/runner/service-runner.ts +4 -1
- package/src/core/aggregation/service.ts +12 -6
- package/src/core/aggregation/signer.ts +67 -0
- package/src/core/aggregation/signing-session.ts +34 -11
- package/src/core/aggregation/transport/in-memory.ts +7 -3
- package/src/index.ts +1 -0
package/dist/browser.mjs
CHANGED
|
@@ -99982,6 +99982,13 @@ function compareBytes(a2, b) {
|
|
|
99982
99982
|
// ../keypair/dist/esm/types.js
|
|
99983
99983
|
init_shim();
|
|
99984
99984
|
|
|
99985
|
+
// ../keypair/dist/esm/utils.js
|
|
99986
|
+
init_shim();
|
|
99987
|
+
function wipe(bytes3) {
|
|
99988
|
+
if (bytes3)
|
|
99989
|
+
bytes3.fill(0);
|
|
99990
|
+
}
|
|
99991
|
+
|
|
99985
99992
|
// ../cryptosuite/dist/esm/multikey/index.js
|
|
99986
99993
|
init_secp256k1();
|
|
99987
99994
|
init_utils();
|
|
@@ -100568,8 +100575,48 @@ function getBeaconStrategy(type) {
|
|
|
100568
100575
|
|
|
100569
100576
|
// src/core/aggregation/cohort.ts
|
|
100570
100577
|
init_shim();
|
|
100571
|
-
|
|
100572
|
-
|
|
100578
|
+
|
|
100579
|
+
// ../bitcoin/dist/esm/index.js
|
|
100580
|
+
init_shim();
|
|
100581
|
+
|
|
100582
|
+
// ../bitcoin/dist/esm/connection.js
|
|
100583
|
+
init_shim();
|
|
100584
|
+
|
|
100585
|
+
// ../bitcoin/dist/esm/client/rest/index.js
|
|
100586
|
+
init_shim();
|
|
100587
|
+
|
|
100588
|
+
// ../bitcoin/dist/esm/client/rest/address.js
|
|
100589
|
+
init_shim();
|
|
100590
|
+
|
|
100591
|
+
// ../bitcoin/dist/esm/client/rest/block.js
|
|
100592
|
+
init_shim();
|
|
100593
|
+
|
|
100594
|
+
// ../bitcoin/dist/esm/errors.js
|
|
100595
|
+
init_shim();
|
|
100596
|
+
|
|
100597
|
+
// ../bitcoin/dist/esm/client/rest/transaction.js
|
|
100598
|
+
init_shim();
|
|
100599
|
+
|
|
100600
|
+
// ../bitcoin/dist/esm/client/rest/protocol.js
|
|
100601
|
+
init_shim();
|
|
100602
|
+
|
|
100603
|
+
// ../bitcoin/dist/esm/client/http.js
|
|
100604
|
+
init_shim();
|
|
100605
|
+
|
|
100606
|
+
// ../bitcoin/dist/esm/client/rpc/index.js
|
|
100607
|
+
init_shim();
|
|
100608
|
+
|
|
100609
|
+
// ../bitcoin/dist/esm/client/rpc/json-rpc.js
|
|
100610
|
+
init_shim();
|
|
100611
|
+
|
|
100612
|
+
// ../bitcoin/dist/esm/client/utils.js
|
|
100613
|
+
init_shim();
|
|
100614
|
+
|
|
100615
|
+
// ../bitcoin/dist/esm/client/rpc/protocol.js
|
|
100616
|
+
init_shim();
|
|
100617
|
+
|
|
100618
|
+
// ../bitcoin/dist/esm/network.js
|
|
100619
|
+
init_shim();
|
|
100573
100620
|
|
|
100574
100621
|
// ../../node_modules/.pnpm/@scure+btc-signer@1.8.1/node_modules/@scure/btc-signer/esm/index.js
|
|
100575
100622
|
init_shim();
|
|
@@ -102768,6 +102815,48 @@ var Transaction = class _Transaction {
|
|
|
102768
102815
|
}
|
|
102769
102816
|
};
|
|
102770
102817
|
|
|
102818
|
+
// ../bitcoin/dist/esm/network.js
|
|
102819
|
+
var REGTEST_NETWORK = {
|
|
102820
|
+
bech32: "bcrt",
|
|
102821
|
+
pubKeyHash: 111,
|
|
102822
|
+
scriptHash: 196,
|
|
102823
|
+
wif: 239
|
|
102824
|
+
};
|
|
102825
|
+
function getNetwork(network) {
|
|
102826
|
+
switch (network) {
|
|
102827
|
+
case "bitcoin":
|
|
102828
|
+
return NETWORK;
|
|
102829
|
+
case "testnet3":
|
|
102830
|
+
case "testnet4":
|
|
102831
|
+
case "signet":
|
|
102832
|
+
case "mutinynet":
|
|
102833
|
+
return TEST_NETWORK;
|
|
102834
|
+
case "regtest":
|
|
102835
|
+
return REGTEST_NETWORK;
|
|
102836
|
+
default:
|
|
102837
|
+
throw new Error(`Unknown network "${network}"`);
|
|
102838
|
+
}
|
|
102839
|
+
}
|
|
102840
|
+
|
|
102841
|
+
// ../bitcoin/dist/esm/constants.js
|
|
102842
|
+
init_shim();
|
|
102843
|
+
var TXIN_WITNESS_COINBASE = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
102844
|
+
var GENESIS_TX_ID = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";
|
|
102845
|
+
|
|
102846
|
+
// ../bitcoin/dist/esm/types.js
|
|
102847
|
+
init_shim();
|
|
102848
|
+
var VerbosityLevel;
|
|
102849
|
+
(function(VerbosityLevel2) {
|
|
102850
|
+
VerbosityLevel2[VerbosityLevel2["hex"] = 0] = "hex";
|
|
102851
|
+
VerbosityLevel2[VerbosityLevel2["json"] = 1] = "json";
|
|
102852
|
+
VerbosityLevel2[VerbosityLevel2["jsonext"] = 2] = "jsonext";
|
|
102853
|
+
VerbosityLevel2[VerbosityLevel2["jsonextprev"] = 3] = "jsonextprev";
|
|
102854
|
+
})(VerbosityLevel || (VerbosityLevel = {}));
|
|
102855
|
+
|
|
102856
|
+
// src/core/aggregation/cohort.ts
|
|
102857
|
+
init_secp256k1();
|
|
102858
|
+
init_utils();
|
|
102859
|
+
|
|
102771
102860
|
// ../../node_modules/.pnpm/@scure+btc-signer@1.8.1/node_modules/@scure/btc-signer/esm/musig2.js
|
|
102772
102861
|
init_shim();
|
|
102773
102862
|
init_modular();
|
|
@@ -103182,7 +103271,7 @@ var AggregationCohort = class {
|
|
|
103182
103271
|
}
|
|
103183
103272
|
const keyAggContext = keyAggregate(this.#cohortKeys);
|
|
103184
103273
|
const aggPubkey = keyAggExport(keyAggContext);
|
|
103185
|
-
const payment = p2tr(aggPubkey);
|
|
103274
|
+
const payment = p2tr(aggPubkey, void 0, getNetwork(this.network));
|
|
103186
103275
|
this.tapTweak = schnorr2.utils.taggedHash("TapTweak", aggPubkey);
|
|
103187
103276
|
if (!payment.address) {
|
|
103188
103277
|
throw new AggregationCohortError(
|
|
@@ -103479,8 +103568,14 @@ var BeaconSigningSession = class {
|
|
|
103479
103568
|
signature;
|
|
103480
103569
|
/** Current signing session phase. */
|
|
103481
103570
|
phase;
|
|
103482
|
-
/**
|
|
103483
|
-
|
|
103571
|
+
/**
|
|
103572
|
+
* Participant's MuSig2 secret nonce, held only on the participant side
|
|
103573
|
+
* between {@link generateNonceContribution} and {@link generatePartialSignature}.
|
|
103574
|
+
* Private and cleared on every terminal path (success, failure, or teardown
|
|
103575
|
+
* via {@link clearSecrets}) so a spent or abandoned nonce cannot be reused or
|
|
103576
|
+
* serialized.
|
|
103577
|
+
*/
|
|
103578
|
+
#secretNonce;
|
|
103484
103579
|
constructor({ id, cohort, pendingTx, prevOutScripts, prevOutValues }) {
|
|
103485
103580
|
this.id = id || crypto.randomUUID();
|
|
103486
103581
|
this.cohort = cohort;
|
|
@@ -103632,22 +103727,24 @@ var BeaconSigningSession = class {
|
|
|
103632
103727
|
generateNonceContribution(participantPublicKey, participantSecretKey) {
|
|
103633
103728
|
const aggPublicKey = keyAggExport(keyAggregate(this.cohort.cohortKeys));
|
|
103634
103729
|
const nonces = nonceGen(participantPublicKey, participantSecretKey, aggPublicKey);
|
|
103635
|
-
this
|
|
103730
|
+
this.#secretNonce = nonces.secret;
|
|
103636
103731
|
return nonces.public;
|
|
103637
103732
|
}
|
|
103638
103733
|
/**
|
|
103639
103734
|
* Generates a partial signature using the participant's secret key + secret nonce.
|
|
103640
103735
|
* Requires the aggregated nonce to have been set first (via the service).
|
|
103641
103736
|
*
|
|
103642
|
-
*
|
|
103643
|
-
*
|
|
103644
|
-
*
|
|
103737
|
+
* Clears the stored secret nonce after use on every path (success or throw)
|
|
103738
|
+
* via {@link clearSecrets}. JS cannot truly erase memory (GC may relocate
|
|
103739
|
+
* buffers), but overwriting the bytes shortens the exposure window and
|
|
103740
|
+
* prevents accidental reuse or serialization of a spent nonce - reuse of a
|
|
103741
|
+
* MuSig2 nonce leaks the secret key.
|
|
103645
103742
|
*/
|
|
103646
103743
|
generatePartialSignature(participantSecretKey) {
|
|
103647
103744
|
if (!this.aggregatedNonce) {
|
|
103648
103745
|
throw new SigningSessionError("Aggregated nonce not available.", "MISSING_AGGREGATED_NONCE");
|
|
103649
103746
|
}
|
|
103650
|
-
if (!this
|
|
103747
|
+
if (!this.#secretNonce) {
|
|
103651
103748
|
throw new SigningSessionError("Secret nonce not available \u2014 generateNonceContribution() must be called first.", "MISSING_SECRET_NONCE");
|
|
103652
103749
|
}
|
|
103653
103750
|
const session = new Session(
|
|
@@ -103657,10 +103754,23 @@ var BeaconSigningSession = class {
|
|
|
103657
103754
|
[this.cohort.tapTweak],
|
|
103658
103755
|
[true]
|
|
103659
103756
|
);
|
|
103660
|
-
|
|
103661
|
-
|
|
103662
|
-
|
|
103663
|
-
|
|
103757
|
+
try {
|
|
103758
|
+
return session.sign(this.#secretNonce, participantSecretKey);
|
|
103759
|
+
} finally {
|
|
103760
|
+
this.clearSecrets();
|
|
103761
|
+
}
|
|
103762
|
+
}
|
|
103763
|
+
/**
|
|
103764
|
+
* Zeroize any retained secret nonce. Safe to call repeatedly and on any path
|
|
103765
|
+
* (completion, failure, or teardown of an abandoned session). Callers that
|
|
103766
|
+
* drop a session before it reaches a partial signature should invoke this so
|
|
103767
|
+
* the secret nonce does not linger on the live object.
|
|
103768
|
+
*/
|
|
103769
|
+
clearSecrets() {
|
|
103770
|
+
if (this.#secretNonce) {
|
|
103771
|
+
wipe(this.#secretNonce);
|
|
103772
|
+
this.#secretNonce = void 0;
|
|
103773
|
+
}
|
|
103664
103774
|
}
|
|
103665
103775
|
isComplete() {
|
|
103666
103776
|
return this.phase === "Complete" /* Complete */;
|
|
@@ -103674,13 +103784,13 @@ var BeaconSigningSession = class {
|
|
|
103674
103784
|
var DEFAULT_MAX_UPDATE_SIZE_BYTES = 256 * 1024;
|
|
103675
103785
|
var AggregationService = class {
|
|
103676
103786
|
did;
|
|
103677
|
-
|
|
103787
|
+
publicKey;
|
|
103678
103788
|
maxUpdateSizeBytes;
|
|
103679
103789
|
/** Per-cohort state, keyed by cohortId. */
|
|
103680
103790
|
#cohortStates = /* @__PURE__ */ new Map();
|
|
103681
|
-
constructor({ did,
|
|
103791
|
+
constructor({ did, publicKey: publicKey2, maxUpdateSizeBytes }) {
|
|
103682
103792
|
this.did = did;
|
|
103683
|
-
this.
|
|
103793
|
+
this.publicKey = publicKey2;
|
|
103684
103794
|
this.maxUpdateSizeBytes = maxUpdateSizeBytes ?? DEFAULT_MAX_UPDATE_SIZE_BYTES;
|
|
103685
103795
|
}
|
|
103686
103796
|
receive(message2) {
|
|
@@ -103773,7 +103883,7 @@ var AggregationService = class {
|
|
|
103773
103883
|
cohortSize: state.config.minParticipants,
|
|
103774
103884
|
beaconType: state.config.beaconType,
|
|
103775
103885
|
network: state.config.network,
|
|
103776
|
-
communicationPk: this.
|
|
103886
|
+
communicationPk: this.publicKey.compressed
|
|
103777
103887
|
});
|
|
103778
103888
|
state.phase = "Advertised" /* Advertised */;
|
|
103779
103889
|
return [message2];
|
|
@@ -104184,12 +104294,17 @@ init_shim();
|
|
|
104184
104294
|
init_utils();
|
|
104185
104295
|
var AggregationParticipant = class {
|
|
104186
104296
|
did;
|
|
104187
|
-
|
|
104297
|
+
/** MuSig2 signing capability. The raw secret never lives as a field here. */
|
|
104298
|
+
#signer;
|
|
104188
104299
|
/** Per-cohort state, keyed by cohortId. */
|
|
104189
104300
|
#cohortStates = /* @__PURE__ */ new Map();
|
|
104190
|
-
constructor({ did,
|
|
104301
|
+
constructor({ did, signer }) {
|
|
104191
104302
|
this.did = did;
|
|
104192
|
-
this
|
|
104303
|
+
this.#signer = signer;
|
|
104304
|
+
}
|
|
104305
|
+
/** The participant's compressed (33-byte) MuSig2 public key. Not secret. */
|
|
104306
|
+
get publicKey() {
|
|
104307
|
+
return this.#signer.publicKey;
|
|
104193
104308
|
}
|
|
104194
104309
|
/**
|
|
104195
104310
|
* Process an incoming message. Updates internal state but never produces
|
|
@@ -104278,8 +104393,8 @@ var AggregationParticipant = class {
|
|
|
104278
104393
|
from: this.did,
|
|
104279
104394
|
to: state.serviceDid,
|
|
104280
104395
|
cohortId,
|
|
104281
|
-
participantPk: this.
|
|
104282
|
-
communicationPk: this.
|
|
104396
|
+
participantPk: this.publicKey,
|
|
104397
|
+
communicationPk: this.publicKey
|
|
104283
104398
|
});
|
|
104284
104399
|
return [optInMessage];
|
|
104285
104400
|
}
|
|
@@ -104309,7 +104424,7 @@ var AggregationParticipant = class {
|
|
|
104309
104424
|
const beaconAddress = message2.body?.beaconAddress;
|
|
104310
104425
|
const cohortKeys = message2.body?.cohortKeys;
|
|
104311
104426
|
if (!beaconAddress || !cohortKeys) return;
|
|
104312
|
-
const participantPkHex = bytesToHex(this.
|
|
104427
|
+
const participantPkHex = bytesToHex(this.publicKey);
|
|
104313
104428
|
const cohortKeysHex = cohortKeys.map((k) => bytesToHex(new Uint8Array(k)));
|
|
104314
104429
|
state.cohort.validateMembership(participantPkHex, cohortKeysHex, beaconAddress);
|
|
104315
104430
|
state.phase = "CohortReady" /* CohortReady */;
|
|
@@ -104476,9 +104591,8 @@ var AggregationParticipant = class {
|
|
|
104476
104591
|
prevOutValues
|
|
104477
104592
|
});
|
|
104478
104593
|
state.signingSession = session;
|
|
104479
|
-
const nonceContribution =
|
|
104480
|
-
this.
|
|
104481
|
-
this.keys.secretKey.bytes
|
|
104594
|
+
const nonceContribution = this.#signer.withSecret(
|
|
104595
|
+
(secretKey) => session.generateNonceContribution(this.publicKey, secretKey)
|
|
104482
104596
|
);
|
|
104483
104597
|
state.phase = "NonceSent" /* NonceSent */;
|
|
104484
104598
|
return [createNonceContributionMessage({
|
|
@@ -104521,7 +104635,10 @@ var AggregationParticipant = class {
|
|
|
104521
104635
|
{ cohortId }
|
|
104522
104636
|
);
|
|
104523
104637
|
}
|
|
104524
|
-
const
|
|
104638
|
+
const signingSession = state.signingSession;
|
|
104639
|
+
const partialSig = this.#signer.withSecret(
|
|
104640
|
+
(secretKey) => signingSession.generatePartialSignature(secretKey)
|
|
104641
|
+
);
|
|
104525
104642
|
state.phase = "Complete" /* Complete */;
|
|
104526
104643
|
return [createSignatureAuthorizationMessage({
|
|
104527
104644
|
from: this.did,
|
|
@@ -104534,6 +104651,37 @@ var AggregationParticipant = class {
|
|
|
104534
104651
|
getCohortPhase(cohortId) {
|
|
104535
104652
|
return this.#cohortStates.get(cohortId)?.phase;
|
|
104536
104653
|
}
|
|
104654
|
+
/**
|
|
104655
|
+
* Zeroize any retained MuSig2 secret nonces across all cohorts. The raw
|
|
104656
|
+
* signing key is never held here (it lives behind the {@link AggregationSigner}
|
|
104657
|
+
* and is wiped per-operation), but an abandoned signing session can still hold
|
|
104658
|
+
* a secret nonce; call this on teardown to clear it deterministically.
|
|
104659
|
+
*/
|
|
104660
|
+
clearSecrets() {
|
|
104661
|
+
for (const state of this.#cohortStates.values()) {
|
|
104662
|
+
state.signingSession?.clearSecrets();
|
|
104663
|
+
}
|
|
104664
|
+
}
|
|
104665
|
+
};
|
|
104666
|
+
|
|
104667
|
+
// src/core/aggregation/signer.ts
|
|
104668
|
+
init_shim();
|
|
104669
|
+
var KeyPairAggregationSigner = class {
|
|
104670
|
+
publicKey;
|
|
104671
|
+
#keys;
|
|
104672
|
+
/** @param {SchnorrKeyPair} keys The keypair whose secret backs this signer. */
|
|
104673
|
+
constructor(keys) {
|
|
104674
|
+
this.#keys = keys;
|
|
104675
|
+
this.publicKey = keys.publicKey.compressed;
|
|
104676
|
+
}
|
|
104677
|
+
withSecret(fn) {
|
|
104678
|
+
const secretKey = this.#keys.secretKey.bytes;
|
|
104679
|
+
try {
|
|
104680
|
+
return fn(secretKey);
|
|
104681
|
+
} finally {
|
|
104682
|
+
wipe(secretKey);
|
|
104683
|
+
}
|
|
104684
|
+
}
|
|
104537
104685
|
};
|
|
104538
104686
|
|
|
104539
104687
|
// src/core/aggregation/logger.ts
|
|
@@ -105290,7 +105438,7 @@ var HttpClientTransport = class {
|
|
|
105290
105438
|
body: JSON.stringify(envelope)
|
|
105291
105439
|
});
|
|
105292
105440
|
if (!res.ok) {
|
|
105293
|
-
const body = await
|
|
105441
|
+
const body = await safeText2(res);
|
|
105294
105442
|
throw new HttpTransportError(
|
|
105295
105443
|
`sendMessage failed: HTTP ${res.status}`,
|
|
105296
105444
|
"SEND_MESSAGE_HTTP",
|
|
@@ -105467,7 +105615,7 @@ function sleep(ms2, signal) {
|
|
|
105467
105615
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
105468
105616
|
});
|
|
105469
105617
|
}
|
|
105470
|
-
async function
|
|
105618
|
+
async function safeText2(res) {
|
|
105471
105619
|
try {
|
|
105472
105620
|
return await res.text();
|
|
105473
105621
|
} catch {
|
|
@@ -111046,10 +111194,10 @@ var InMemoryTransport = class {
|
|
|
111046
111194
|
start() {
|
|
111047
111195
|
}
|
|
111048
111196
|
registerActor(did, keys) {
|
|
111049
|
-
this.#actors.set(did, { keys, handlers: /* @__PURE__ */ new Map() });
|
|
111197
|
+
this.#actors.set(did, { publicKey: keys.publicKey.compressed, handlers: /* @__PURE__ */ new Map() });
|
|
111050
111198
|
}
|
|
111051
111199
|
getActorPk(did) {
|
|
111052
|
-
return this.#actors.get(did)?.
|
|
111200
|
+
return this.#actors.get(did)?.publicKey;
|
|
111053
111201
|
}
|
|
111054
111202
|
/** True if `did` is registered on this transport. Used by the bus for routing. */
|
|
111055
111203
|
hasActor(did) {
|
|
@@ -111272,8 +111420,11 @@ var AggregationServiceRunner = class _AggregationServiceRunner extends TypedEven
|
|
|
111272
111420
|
this.#phaseTimeoutMs = options2.phaseTimeoutMs;
|
|
111273
111421
|
this.#advertRepeatIntervalMs = options2.advertRepeatIntervalMs ?? DEFAULT_ADVERT_REPEAT_INTERVAL_MS;
|
|
111274
111422
|
this.session = new AggregationService({
|
|
111423
|
+
// The coordinator never signs, so the state machine receives only the
|
|
111424
|
+
// public half of the operator's keypair (see ADR 038). The full keypair
|
|
111425
|
+
// remains the operator's transport/communication identity.
|
|
111275
111426
|
did: options2.did,
|
|
111276
|
-
|
|
111427
|
+
publicKey: options2.keys.publicKey,
|
|
111277
111428
|
maxUpdateSizeBytes: options2.maxUpdateSizeBytes
|
|
111278
111429
|
});
|
|
111279
111430
|
}
|
|
@@ -111626,7 +111777,10 @@ var AggregationParticipantRunner = class _AggregationParticipantRunner extends T
|
|
|
111626
111777
|
this.#onProvideUpdate = options2.onProvideUpdate;
|
|
111627
111778
|
this.#onValidateData = options2.onValidateData ?? (async (info) => ({ approved: info.matches }));
|
|
111628
111779
|
this.#onApproveSigning = options2.onApproveSigning ?? (async () => ({ approved: true }));
|
|
111629
|
-
this.session = new AggregationParticipant({
|
|
111780
|
+
this.session = new AggregationParticipant({
|
|
111781
|
+
did: options2.did,
|
|
111782
|
+
signer: new KeyPairAggregationSigner(options2.keys)
|
|
111783
|
+
});
|
|
111630
111784
|
}
|
|
111631
111785
|
/**
|
|
111632
111786
|
* Start listening for cohorts. The runner stays active until {@link stop}
|
|
@@ -111639,6 +111793,7 @@ var AggregationParticipantRunner = class _AggregationParticipantRunner extends T
|
|
|
111639
111793
|
stop() {
|
|
111640
111794
|
this.#stopped = true;
|
|
111641
111795
|
this.#unregisterHandlers();
|
|
111796
|
+
this.session.clearSecrets();
|
|
111642
111797
|
}
|
|
111643
111798
|
/** Message types this runner listens for on the transport. */
|
|
111644
111799
|
static #HANDLED_MESSAGE_TYPES = [
|
|
@@ -112480,84 +112635,6 @@ init_shim();
|
|
|
112480
112635
|
// src/core/beacon/signal-discovery.ts
|
|
112481
112636
|
init_shim();
|
|
112482
112637
|
|
|
112483
|
-
// ../bitcoin/dist/esm/index.js
|
|
112484
|
-
init_shim();
|
|
112485
|
-
|
|
112486
|
-
// ../bitcoin/dist/esm/connection.js
|
|
112487
|
-
init_shim();
|
|
112488
|
-
|
|
112489
|
-
// ../bitcoin/dist/esm/client/rest/index.js
|
|
112490
|
-
init_shim();
|
|
112491
|
-
|
|
112492
|
-
// ../bitcoin/dist/esm/client/rest/address.js
|
|
112493
|
-
init_shim();
|
|
112494
|
-
|
|
112495
|
-
// ../bitcoin/dist/esm/client/rest/block.js
|
|
112496
|
-
init_shim();
|
|
112497
|
-
|
|
112498
|
-
// ../bitcoin/dist/esm/errors.js
|
|
112499
|
-
init_shim();
|
|
112500
|
-
|
|
112501
|
-
// ../bitcoin/dist/esm/client/rest/transaction.js
|
|
112502
|
-
init_shim();
|
|
112503
|
-
|
|
112504
|
-
// ../bitcoin/dist/esm/client/rest/protocol.js
|
|
112505
|
-
init_shim();
|
|
112506
|
-
|
|
112507
|
-
// ../bitcoin/dist/esm/client/http.js
|
|
112508
|
-
init_shim();
|
|
112509
|
-
|
|
112510
|
-
// ../bitcoin/dist/esm/client/rpc/index.js
|
|
112511
|
-
init_shim();
|
|
112512
|
-
|
|
112513
|
-
// ../bitcoin/dist/esm/client/rpc/json-rpc.js
|
|
112514
|
-
init_shim();
|
|
112515
|
-
|
|
112516
|
-
// ../bitcoin/dist/esm/client/utils.js
|
|
112517
|
-
init_shim();
|
|
112518
|
-
|
|
112519
|
-
// ../bitcoin/dist/esm/client/rpc/protocol.js
|
|
112520
|
-
init_shim();
|
|
112521
|
-
|
|
112522
|
-
// ../bitcoin/dist/esm/network.js
|
|
112523
|
-
init_shim();
|
|
112524
|
-
var REGTEST_NETWORK = {
|
|
112525
|
-
bech32: "bcrt",
|
|
112526
|
-
pubKeyHash: 111,
|
|
112527
|
-
scriptHash: 196,
|
|
112528
|
-
wif: 239
|
|
112529
|
-
};
|
|
112530
|
-
function getNetwork(network) {
|
|
112531
|
-
switch (network) {
|
|
112532
|
-
case "bitcoin":
|
|
112533
|
-
return NETWORK;
|
|
112534
|
-
case "testnet3":
|
|
112535
|
-
case "testnet4":
|
|
112536
|
-
case "signet":
|
|
112537
|
-
case "mutinynet":
|
|
112538
|
-
return TEST_NETWORK;
|
|
112539
|
-
case "regtest":
|
|
112540
|
-
return REGTEST_NETWORK;
|
|
112541
|
-
default:
|
|
112542
|
-
throw new Error(`Unknown network "${network}"`);
|
|
112543
|
-
}
|
|
112544
|
-
}
|
|
112545
|
-
|
|
112546
|
-
// ../bitcoin/dist/esm/constants.js
|
|
112547
|
-
init_shim();
|
|
112548
|
-
var TXIN_WITNESS_COINBASE = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
112549
|
-
var GENESIS_TX_ID = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";
|
|
112550
|
-
|
|
112551
|
-
// ../bitcoin/dist/esm/types.js
|
|
112552
|
-
init_shim();
|
|
112553
|
-
var VerbosityLevel;
|
|
112554
|
-
(function(VerbosityLevel2) {
|
|
112555
|
-
VerbosityLevel2[VerbosityLevel2["hex"] = 0] = "hex";
|
|
112556
|
-
VerbosityLevel2[VerbosityLevel2["json"] = 1] = "json";
|
|
112557
|
-
VerbosityLevel2[VerbosityLevel2["jsonext"] = 2] = "jsonext";
|
|
112558
|
-
VerbosityLevel2[VerbosityLevel2["jsonextprev"] = 3] = "jsonextprev";
|
|
112559
|
-
})(VerbosityLevel || (VerbosityLevel = {}));
|
|
112560
|
-
|
|
112561
112638
|
// src/core/beacon/utils.ts
|
|
112562
112639
|
init_shim();
|
|
112563
112640
|
|
|
@@ -129024,6 +129101,7 @@ export {
|
|
|
129024
129101
|
InMemoryRateLimitStore,
|
|
129025
129102
|
InMemoryTransport,
|
|
129026
129103
|
InboxBuffer,
|
|
129104
|
+
KeyPairAggregationSigner,
|
|
129027
129105
|
NONCE_CONTRIBUTION,
|
|
129028
129106
|
NonceCache,
|
|
129029
129107
|
NostrTransport,
|