@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.js
CHANGED
|
@@ -93203,6 +93203,7 @@ a=end-of-candidates
|
|
|
93203
93203
|
InMemoryRateLimitStore: () => InMemoryRateLimitStore,
|
|
93204
93204
|
InMemoryTransport: () => InMemoryTransport,
|
|
93205
93205
|
InboxBuffer: () => InboxBuffer,
|
|
93206
|
+
KeyPairAggregationSigner: () => KeyPairAggregationSigner,
|
|
93206
93207
|
NONCE_CONTRIBUTION: () => NONCE_CONTRIBUTION,
|
|
93207
93208
|
NonceCache: () => NonceCache,
|
|
93208
93209
|
NostrTransport: () => NostrTransport,
|
|
@@ -100117,6 +100118,13 @@ a=end-of-candidates
|
|
|
100117
100118
|
// ../keypair/dist/esm/types.js
|
|
100118
100119
|
init_shim();
|
|
100119
100120
|
|
|
100121
|
+
// ../keypair/dist/esm/utils.js
|
|
100122
|
+
init_shim();
|
|
100123
|
+
function wipe(bytes3) {
|
|
100124
|
+
if (bytes3)
|
|
100125
|
+
bytes3.fill(0);
|
|
100126
|
+
}
|
|
100127
|
+
|
|
100120
100128
|
// ../cryptosuite/dist/esm/multikey/index.js
|
|
100121
100129
|
init_secp256k1();
|
|
100122
100130
|
init_utils();
|
|
@@ -100703,8 +100711,48 @@ a=end-of-candidates
|
|
|
100703
100711
|
|
|
100704
100712
|
// src/core/aggregation/cohort.ts
|
|
100705
100713
|
init_shim();
|
|
100706
|
-
|
|
100707
|
-
|
|
100714
|
+
|
|
100715
|
+
// ../bitcoin/dist/esm/index.js
|
|
100716
|
+
init_shim();
|
|
100717
|
+
|
|
100718
|
+
// ../bitcoin/dist/esm/connection.js
|
|
100719
|
+
init_shim();
|
|
100720
|
+
|
|
100721
|
+
// ../bitcoin/dist/esm/client/rest/index.js
|
|
100722
|
+
init_shim();
|
|
100723
|
+
|
|
100724
|
+
// ../bitcoin/dist/esm/client/rest/address.js
|
|
100725
|
+
init_shim();
|
|
100726
|
+
|
|
100727
|
+
// ../bitcoin/dist/esm/client/rest/block.js
|
|
100728
|
+
init_shim();
|
|
100729
|
+
|
|
100730
|
+
// ../bitcoin/dist/esm/errors.js
|
|
100731
|
+
init_shim();
|
|
100732
|
+
|
|
100733
|
+
// ../bitcoin/dist/esm/client/rest/transaction.js
|
|
100734
|
+
init_shim();
|
|
100735
|
+
|
|
100736
|
+
// ../bitcoin/dist/esm/client/rest/protocol.js
|
|
100737
|
+
init_shim();
|
|
100738
|
+
|
|
100739
|
+
// ../bitcoin/dist/esm/client/http.js
|
|
100740
|
+
init_shim();
|
|
100741
|
+
|
|
100742
|
+
// ../bitcoin/dist/esm/client/rpc/index.js
|
|
100743
|
+
init_shim();
|
|
100744
|
+
|
|
100745
|
+
// ../bitcoin/dist/esm/client/rpc/json-rpc.js
|
|
100746
|
+
init_shim();
|
|
100747
|
+
|
|
100748
|
+
// ../bitcoin/dist/esm/client/utils.js
|
|
100749
|
+
init_shim();
|
|
100750
|
+
|
|
100751
|
+
// ../bitcoin/dist/esm/client/rpc/protocol.js
|
|
100752
|
+
init_shim();
|
|
100753
|
+
|
|
100754
|
+
// ../bitcoin/dist/esm/network.js
|
|
100755
|
+
init_shim();
|
|
100708
100756
|
|
|
100709
100757
|
// ../../node_modules/.pnpm/@scure+btc-signer@1.8.1/node_modules/@scure/btc-signer/esm/index.js
|
|
100710
100758
|
init_shim();
|
|
@@ -102903,6 +102951,48 @@ a=end-of-candidates
|
|
|
102903
102951
|
}
|
|
102904
102952
|
};
|
|
102905
102953
|
|
|
102954
|
+
// ../bitcoin/dist/esm/network.js
|
|
102955
|
+
var REGTEST_NETWORK = {
|
|
102956
|
+
bech32: "bcrt",
|
|
102957
|
+
pubKeyHash: 111,
|
|
102958
|
+
scriptHash: 196,
|
|
102959
|
+
wif: 239
|
|
102960
|
+
};
|
|
102961
|
+
function getNetwork(network) {
|
|
102962
|
+
switch (network) {
|
|
102963
|
+
case "bitcoin":
|
|
102964
|
+
return NETWORK;
|
|
102965
|
+
case "testnet3":
|
|
102966
|
+
case "testnet4":
|
|
102967
|
+
case "signet":
|
|
102968
|
+
case "mutinynet":
|
|
102969
|
+
return TEST_NETWORK;
|
|
102970
|
+
case "regtest":
|
|
102971
|
+
return REGTEST_NETWORK;
|
|
102972
|
+
default:
|
|
102973
|
+
throw new Error(`Unknown network "${network}"`);
|
|
102974
|
+
}
|
|
102975
|
+
}
|
|
102976
|
+
|
|
102977
|
+
// ../bitcoin/dist/esm/constants.js
|
|
102978
|
+
init_shim();
|
|
102979
|
+
var TXIN_WITNESS_COINBASE = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
102980
|
+
var GENESIS_TX_ID = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";
|
|
102981
|
+
|
|
102982
|
+
// ../bitcoin/dist/esm/types.js
|
|
102983
|
+
init_shim();
|
|
102984
|
+
var VerbosityLevel;
|
|
102985
|
+
(function(VerbosityLevel2) {
|
|
102986
|
+
VerbosityLevel2[VerbosityLevel2["hex"] = 0] = "hex";
|
|
102987
|
+
VerbosityLevel2[VerbosityLevel2["json"] = 1] = "json";
|
|
102988
|
+
VerbosityLevel2[VerbosityLevel2["jsonext"] = 2] = "jsonext";
|
|
102989
|
+
VerbosityLevel2[VerbosityLevel2["jsonextprev"] = 3] = "jsonextprev";
|
|
102990
|
+
})(VerbosityLevel || (VerbosityLevel = {}));
|
|
102991
|
+
|
|
102992
|
+
// src/core/aggregation/cohort.ts
|
|
102993
|
+
init_secp256k1();
|
|
102994
|
+
init_utils();
|
|
102995
|
+
|
|
102906
102996
|
// ../../node_modules/.pnpm/@scure+btc-signer@1.8.1/node_modules/@scure/btc-signer/esm/musig2.js
|
|
102907
102997
|
init_shim();
|
|
102908
102998
|
init_modular();
|
|
@@ -103317,7 +103407,7 @@ a=end-of-candidates
|
|
|
103317
103407
|
}
|
|
103318
103408
|
const keyAggContext = keyAggregate(this.#cohortKeys);
|
|
103319
103409
|
const aggPubkey = keyAggExport(keyAggContext);
|
|
103320
|
-
const payment = p2tr(aggPubkey);
|
|
103410
|
+
const payment = p2tr(aggPubkey, void 0, getNetwork(this.network));
|
|
103321
103411
|
this.tapTweak = schnorr2.utils.taggedHash("TapTweak", aggPubkey);
|
|
103322
103412
|
if (!payment.address) {
|
|
103323
103413
|
throw new AggregationCohortError(
|
|
@@ -103614,8 +103704,14 @@ a=end-of-candidates
|
|
|
103614
103704
|
signature;
|
|
103615
103705
|
/** Current signing session phase. */
|
|
103616
103706
|
phase;
|
|
103617
|
-
/**
|
|
103618
|
-
|
|
103707
|
+
/**
|
|
103708
|
+
* Participant's MuSig2 secret nonce, held only on the participant side
|
|
103709
|
+
* between {@link generateNonceContribution} and {@link generatePartialSignature}.
|
|
103710
|
+
* Private and cleared on every terminal path (success, failure, or teardown
|
|
103711
|
+
* via {@link clearSecrets}) so a spent or abandoned nonce cannot be reused or
|
|
103712
|
+
* serialized.
|
|
103713
|
+
*/
|
|
103714
|
+
#secretNonce;
|
|
103619
103715
|
constructor({ id, cohort, pendingTx, prevOutScripts, prevOutValues }) {
|
|
103620
103716
|
this.id = id || crypto.randomUUID();
|
|
103621
103717
|
this.cohort = cohort;
|
|
@@ -103767,22 +103863,24 @@ a=end-of-candidates
|
|
|
103767
103863
|
generateNonceContribution(participantPublicKey, participantSecretKey) {
|
|
103768
103864
|
const aggPublicKey = keyAggExport(keyAggregate(this.cohort.cohortKeys));
|
|
103769
103865
|
const nonces = nonceGen(participantPublicKey, participantSecretKey, aggPublicKey);
|
|
103770
|
-
this
|
|
103866
|
+
this.#secretNonce = nonces.secret;
|
|
103771
103867
|
return nonces.public;
|
|
103772
103868
|
}
|
|
103773
103869
|
/**
|
|
103774
103870
|
* Generates a partial signature using the participant's secret key + secret nonce.
|
|
103775
103871
|
* Requires the aggregated nonce to have been set first (via the service).
|
|
103776
103872
|
*
|
|
103777
|
-
*
|
|
103778
|
-
*
|
|
103779
|
-
*
|
|
103873
|
+
* Clears the stored secret nonce after use on every path (success or throw)
|
|
103874
|
+
* via {@link clearSecrets}. JS cannot truly erase memory (GC may relocate
|
|
103875
|
+
* buffers), but overwriting the bytes shortens the exposure window and
|
|
103876
|
+
* prevents accidental reuse or serialization of a spent nonce - reuse of a
|
|
103877
|
+
* MuSig2 nonce leaks the secret key.
|
|
103780
103878
|
*/
|
|
103781
103879
|
generatePartialSignature(participantSecretKey) {
|
|
103782
103880
|
if (!this.aggregatedNonce) {
|
|
103783
103881
|
throw new SigningSessionError("Aggregated nonce not available.", "MISSING_AGGREGATED_NONCE");
|
|
103784
103882
|
}
|
|
103785
|
-
if (!this
|
|
103883
|
+
if (!this.#secretNonce) {
|
|
103786
103884
|
throw new SigningSessionError("Secret nonce not available \u2014 generateNonceContribution() must be called first.", "MISSING_SECRET_NONCE");
|
|
103787
103885
|
}
|
|
103788
103886
|
const session = new Session(
|
|
@@ -103792,10 +103890,23 @@ a=end-of-candidates
|
|
|
103792
103890
|
[this.cohort.tapTweak],
|
|
103793
103891
|
[true]
|
|
103794
103892
|
);
|
|
103795
|
-
|
|
103796
|
-
|
|
103797
|
-
|
|
103798
|
-
|
|
103893
|
+
try {
|
|
103894
|
+
return session.sign(this.#secretNonce, participantSecretKey);
|
|
103895
|
+
} finally {
|
|
103896
|
+
this.clearSecrets();
|
|
103897
|
+
}
|
|
103898
|
+
}
|
|
103899
|
+
/**
|
|
103900
|
+
* Zeroize any retained secret nonce. Safe to call repeatedly and on any path
|
|
103901
|
+
* (completion, failure, or teardown of an abandoned session). Callers that
|
|
103902
|
+
* drop a session before it reaches a partial signature should invoke this so
|
|
103903
|
+
* the secret nonce does not linger on the live object.
|
|
103904
|
+
*/
|
|
103905
|
+
clearSecrets() {
|
|
103906
|
+
if (this.#secretNonce) {
|
|
103907
|
+
wipe(this.#secretNonce);
|
|
103908
|
+
this.#secretNonce = void 0;
|
|
103909
|
+
}
|
|
103799
103910
|
}
|
|
103800
103911
|
isComplete() {
|
|
103801
103912
|
return this.phase === "Complete" /* Complete */;
|
|
@@ -103809,13 +103920,13 @@ a=end-of-candidates
|
|
|
103809
103920
|
var DEFAULT_MAX_UPDATE_SIZE_BYTES = 256 * 1024;
|
|
103810
103921
|
var AggregationService = class {
|
|
103811
103922
|
did;
|
|
103812
|
-
|
|
103923
|
+
publicKey;
|
|
103813
103924
|
maxUpdateSizeBytes;
|
|
103814
103925
|
/** Per-cohort state, keyed by cohortId. */
|
|
103815
103926
|
#cohortStates = /* @__PURE__ */ new Map();
|
|
103816
|
-
constructor({ did,
|
|
103927
|
+
constructor({ did, publicKey: publicKey2, maxUpdateSizeBytes }) {
|
|
103817
103928
|
this.did = did;
|
|
103818
|
-
this.
|
|
103929
|
+
this.publicKey = publicKey2;
|
|
103819
103930
|
this.maxUpdateSizeBytes = maxUpdateSizeBytes ?? DEFAULT_MAX_UPDATE_SIZE_BYTES;
|
|
103820
103931
|
}
|
|
103821
103932
|
receive(message2) {
|
|
@@ -103908,7 +104019,7 @@ a=end-of-candidates
|
|
|
103908
104019
|
cohortSize: state.config.minParticipants,
|
|
103909
104020
|
beaconType: state.config.beaconType,
|
|
103910
104021
|
network: state.config.network,
|
|
103911
|
-
communicationPk: this.
|
|
104022
|
+
communicationPk: this.publicKey.compressed
|
|
103912
104023
|
});
|
|
103913
104024
|
state.phase = "Advertised" /* Advertised */;
|
|
103914
104025
|
return [message2];
|
|
@@ -104319,12 +104430,17 @@ a=end-of-candidates
|
|
|
104319
104430
|
init_utils();
|
|
104320
104431
|
var AggregationParticipant = class {
|
|
104321
104432
|
did;
|
|
104322
|
-
|
|
104433
|
+
/** MuSig2 signing capability. The raw secret never lives as a field here. */
|
|
104434
|
+
#signer;
|
|
104323
104435
|
/** Per-cohort state, keyed by cohortId. */
|
|
104324
104436
|
#cohortStates = /* @__PURE__ */ new Map();
|
|
104325
|
-
constructor({ did,
|
|
104437
|
+
constructor({ did, signer }) {
|
|
104326
104438
|
this.did = did;
|
|
104327
|
-
this
|
|
104439
|
+
this.#signer = signer;
|
|
104440
|
+
}
|
|
104441
|
+
/** The participant's compressed (33-byte) MuSig2 public key. Not secret. */
|
|
104442
|
+
get publicKey() {
|
|
104443
|
+
return this.#signer.publicKey;
|
|
104328
104444
|
}
|
|
104329
104445
|
/**
|
|
104330
104446
|
* Process an incoming message. Updates internal state but never produces
|
|
@@ -104413,8 +104529,8 @@ a=end-of-candidates
|
|
|
104413
104529
|
from: this.did,
|
|
104414
104530
|
to: state.serviceDid,
|
|
104415
104531
|
cohortId,
|
|
104416
|
-
participantPk: this.
|
|
104417
|
-
communicationPk: this.
|
|
104532
|
+
participantPk: this.publicKey,
|
|
104533
|
+
communicationPk: this.publicKey
|
|
104418
104534
|
});
|
|
104419
104535
|
return [optInMessage];
|
|
104420
104536
|
}
|
|
@@ -104444,7 +104560,7 @@ a=end-of-candidates
|
|
|
104444
104560
|
const beaconAddress = message2.body?.beaconAddress;
|
|
104445
104561
|
const cohortKeys = message2.body?.cohortKeys;
|
|
104446
104562
|
if (!beaconAddress || !cohortKeys) return;
|
|
104447
|
-
const participantPkHex = bytesToHex(this.
|
|
104563
|
+
const participantPkHex = bytesToHex(this.publicKey);
|
|
104448
104564
|
const cohortKeysHex = cohortKeys.map((k) => bytesToHex(new Uint8Array(k)));
|
|
104449
104565
|
state.cohort.validateMembership(participantPkHex, cohortKeysHex, beaconAddress);
|
|
104450
104566
|
state.phase = "CohortReady" /* CohortReady */;
|
|
@@ -104611,9 +104727,8 @@ a=end-of-candidates
|
|
|
104611
104727
|
prevOutValues
|
|
104612
104728
|
});
|
|
104613
104729
|
state.signingSession = session;
|
|
104614
|
-
const nonceContribution =
|
|
104615
|
-
this.
|
|
104616
|
-
this.keys.secretKey.bytes
|
|
104730
|
+
const nonceContribution = this.#signer.withSecret(
|
|
104731
|
+
(secretKey) => session.generateNonceContribution(this.publicKey, secretKey)
|
|
104617
104732
|
);
|
|
104618
104733
|
state.phase = "NonceSent" /* NonceSent */;
|
|
104619
104734
|
return [createNonceContributionMessage({
|
|
@@ -104656,7 +104771,10 @@ a=end-of-candidates
|
|
|
104656
104771
|
{ cohortId }
|
|
104657
104772
|
);
|
|
104658
104773
|
}
|
|
104659
|
-
const
|
|
104774
|
+
const signingSession = state.signingSession;
|
|
104775
|
+
const partialSig = this.#signer.withSecret(
|
|
104776
|
+
(secretKey) => signingSession.generatePartialSignature(secretKey)
|
|
104777
|
+
);
|
|
104660
104778
|
state.phase = "Complete" /* Complete */;
|
|
104661
104779
|
return [createSignatureAuthorizationMessage({
|
|
104662
104780
|
from: this.did,
|
|
@@ -104669,6 +104787,37 @@ a=end-of-candidates
|
|
|
104669
104787
|
getCohortPhase(cohortId) {
|
|
104670
104788
|
return this.#cohortStates.get(cohortId)?.phase;
|
|
104671
104789
|
}
|
|
104790
|
+
/**
|
|
104791
|
+
* Zeroize any retained MuSig2 secret nonces across all cohorts. The raw
|
|
104792
|
+
* signing key is never held here (it lives behind the {@link AggregationSigner}
|
|
104793
|
+
* and is wiped per-operation), but an abandoned signing session can still hold
|
|
104794
|
+
* a secret nonce; call this on teardown to clear it deterministically.
|
|
104795
|
+
*/
|
|
104796
|
+
clearSecrets() {
|
|
104797
|
+
for (const state of this.#cohortStates.values()) {
|
|
104798
|
+
state.signingSession?.clearSecrets();
|
|
104799
|
+
}
|
|
104800
|
+
}
|
|
104801
|
+
};
|
|
104802
|
+
|
|
104803
|
+
// src/core/aggregation/signer.ts
|
|
104804
|
+
init_shim();
|
|
104805
|
+
var KeyPairAggregationSigner = class {
|
|
104806
|
+
publicKey;
|
|
104807
|
+
#keys;
|
|
104808
|
+
/** @param {SchnorrKeyPair} keys The keypair whose secret backs this signer. */
|
|
104809
|
+
constructor(keys) {
|
|
104810
|
+
this.#keys = keys;
|
|
104811
|
+
this.publicKey = keys.publicKey.compressed;
|
|
104812
|
+
}
|
|
104813
|
+
withSecret(fn) {
|
|
104814
|
+
const secretKey = this.#keys.secretKey.bytes;
|
|
104815
|
+
try {
|
|
104816
|
+
return fn(secretKey);
|
|
104817
|
+
} finally {
|
|
104818
|
+
wipe(secretKey);
|
|
104819
|
+
}
|
|
104820
|
+
}
|
|
104672
104821
|
};
|
|
104673
104822
|
|
|
104674
104823
|
// src/core/aggregation/logger.ts
|
|
@@ -105425,7 +105574,7 @@ ${value2}`;
|
|
|
105425
105574
|
body: JSON.stringify(envelope)
|
|
105426
105575
|
});
|
|
105427
105576
|
if (!res.ok) {
|
|
105428
|
-
const body = await
|
|
105577
|
+
const body = await safeText2(res);
|
|
105429
105578
|
throw new HttpTransportError(
|
|
105430
105579
|
`sendMessage failed: HTTP ${res.status}`,
|
|
105431
105580
|
"SEND_MESSAGE_HTTP",
|
|
@@ -105602,7 +105751,7 @@ ${value2}`;
|
|
|
105602
105751
|
else signal.addEventListener("abort", onAbort, { once: true });
|
|
105603
105752
|
});
|
|
105604
105753
|
}
|
|
105605
|
-
async function
|
|
105754
|
+
async function safeText2(res) {
|
|
105606
105755
|
try {
|
|
105607
105756
|
return await res.text();
|
|
105608
105757
|
} catch {
|
|
@@ -111181,10 +111330,10 @@ ${value2}`;
|
|
|
111181
111330
|
start() {
|
|
111182
111331
|
}
|
|
111183
111332
|
registerActor(did, keys) {
|
|
111184
|
-
this.#actors.set(did, { keys, handlers: /* @__PURE__ */ new Map() });
|
|
111333
|
+
this.#actors.set(did, { publicKey: keys.publicKey.compressed, handlers: /* @__PURE__ */ new Map() });
|
|
111185
111334
|
}
|
|
111186
111335
|
getActorPk(did) {
|
|
111187
|
-
return this.#actors.get(did)?.
|
|
111336
|
+
return this.#actors.get(did)?.publicKey;
|
|
111188
111337
|
}
|
|
111189
111338
|
/** True if `did` is registered on this transport. Used by the bus for routing. */
|
|
111190
111339
|
hasActor(did) {
|
|
@@ -111407,8 +111556,11 @@ ${value2}`;
|
|
|
111407
111556
|
this.#phaseTimeoutMs = options2.phaseTimeoutMs;
|
|
111408
111557
|
this.#advertRepeatIntervalMs = options2.advertRepeatIntervalMs ?? DEFAULT_ADVERT_REPEAT_INTERVAL_MS;
|
|
111409
111558
|
this.session = new AggregationService({
|
|
111559
|
+
// The coordinator never signs, so the state machine receives only the
|
|
111560
|
+
// public half of the operator's keypair (see ADR 038). The full keypair
|
|
111561
|
+
// remains the operator's transport/communication identity.
|
|
111410
111562
|
did: options2.did,
|
|
111411
|
-
|
|
111563
|
+
publicKey: options2.keys.publicKey,
|
|
111412
111564
|
maxUpdateSizeBytes: options2.maxUpdateSizeBytes
|
|
111413
111565
|
});
|
|
111414
111566
|
}
|
|
@@ -111761,7 +111913,10 @@ ${value2}`;
|
|
|
111761
111913
|
this.#onProvideUpdate = options2.onProvideUpdate;
|
|
111762
111914
|
this.#onValidateData = options2.onValidateData ?? (async (info) => ({ approved: info.matches }));
|
|
111763
111915
|
this.#onApproveSigning = options2.onApproveSigning ?? (async () => ({ approved: true }));
|
|
111764
|
-
this.session = new AggregationParticipant({
|
|
111916
|
+
this.session = new AggregationParticipant({
|
|
111917
|
+
did: options2.did,
|
|
111918
|
+
signer: new KeyPairAggregationSigner(options2.keys)
|
|
111919
|
+
});
|
|
111765
111920
|
}
|
|
111766
111921
|
/**
|
|
111767
111922
|
* Start listening for cohorts. The runner stays active until {@link stop}
|
|
@@ -111774,6 +111929,7 @@ ${value2}`;
|
|
|
111774
111929
|
stop() {
|
|
111775
111930
|
this.#stopped = true;
|
|
111776
111931
|
this.#unregisterHandlers();
|
|
111932
|
+
this.session.clearSecrets();
|
|
111777
111933
|
}
|
|
111778
111934
|
/** Message types this runner listens for on the transport. */
|
|
111779
111935
|
static #HANDLED_MESSAGE_TYPES = [
|
|
@@ -112615,84 +112771,6 @@ ${value2}`;
|
|
|
112615
112771
|
// src/core/beacon/signal-discovery.ts
|
|
112616
112772
|
init_shim();
|
|
112617
112773
|
|
|
112618
|
-
// ../bitcoin/dist/esm/index.js
|
|
112619
|
-
init_shim();
|
|
112620
|
-
|
|
112621
|
-
// ../bitcoin/dist/esm/connection.js
|
|
112622
|
-
init_shim();
|
|
112623
|
-
|
|
112624
|
-
// ../bitcoin/dist/esm/client/rest/index.js
|
|
112625
|
-
init_shim();
|
|
112626
|
-
|
|
112627
|
-
// ../bitcoin/dist/esm/client/rest/address.js
|
|
112628
|
-
init_shim();
|
|
112629
|
-
|
|
112630
|
-
// ../bitcoin/dist/esm/client/rest/block.js
|
|
112631
|
-
init_shim();
|
|
112632
|
-
|
|
112633
|
-
// ../bitcoin/dist/esm/errors.js
|
|
112634
|
-
init_shim();
|
|
112635
|
-
|
|
112636
|
-
// ../bitcoin/dist/esm/client/rest/transaction.js
|
|
112637
|
-
init_shim();
|
|
112638
|
-
|
|
112639
|
-
// ../bitcoin/dist/esm/client/rest/protocol.js
|
|
112640
|
-
init_shim();
|
|
112641
|
-
|
|
112642
|
-
// ../bitcoin/dist/esm/client/http.js
|
|
112643
|
-
init_shim();
|
|
112644
|
-
|
|
112645
|
-
// ../bitcoin/dist/esm/client/rpc/index.js
|
|
112646
|
-
init_shim();
|
|
112647
|
-
|
|
112648
|
-
// ../bitcoin/dist/esm/client/rpc/json-rpc.js
|
|
112649
|
-
init_shim();
|
|
112650
|
-
|
|
112651
|
-
// ../bitcoin/dist/esm/client/utils.js
|
|
112652
|
-
init_shim();
|
|
112653
|
-
|
|
112654
|
-
// ../bitcoin/dist/esm/client/rpc/protocol.js
|
|
112655
|
-
init_shim();
|
|
112656
|
-
|
|
112657
|
-
// ../bitcoin/dist/esm/network.js
|
|
112658
|
-
init_shim();
|
|
112659
|
-
var REGTEST_NETWORK = {
|
|
112660
|
-
bech32: "bcrt",
|
|
112661
|
-
pubKeyHash: 111,
|
|
112662
|
-
scriptHash: 196,
|
|
112663
|
-
wif: 239
|
|
112664
|
-
};
|
|
112665
|
-
function getNetwork(network) {
|
|
112666
|
-
switch (network) {
|
|
112667
|
-
case "bitcoin":
|
|
112668
|
-
return NETWORK;
|
|
112669
|
-
case "testnet3":
|
|
112670
|
-
case "testnet4":
|
|
112671
|
-
case "signet":
|
|
112672
|
-
case "mutinynet":
|
|
112673
|
-
return TEST_NETWORK;
|
|
112674
|
-
case "regtest":
|
|
112675
|
-
return REGTEST_NETWORK;
|
|
112676
|
-
default:
|
|
112677
|
-
throw new Error(`Unknown network "${network}"`);
|
|
112678
|
-
}
|
|
112679
|
-
}
|
|
112680
|
-
|
|
112681
|
-
// ../bitcoin/dist/esm/constants.js
|
|
112682
|
-
init_shim();
|
|
112683
|
-
var TXIN_WITNESS_COINBASE = "0000000000000000000000000000000000000000000000000000000000000000";
|
|
112684
|
-
var GENESIS_TX_ID = "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";
|
|
112685
|
-
|
|
112686
|
-
// ../bitcoin/dist/esm/types.js
|
|
112687
|
-
init_shim();
|
|
112688
|
-
var VerbosityLevel;
|
|
112689
|
-
(function(VerbosityLevel2) {
|
|
112690
|
-
VerbosityLevel2[VerbosityLevel2["hex"] = 0] = "hex";
|
|
112691
|
-
VerbosityLevel2[VerbosityLevel2["json"] = 1] = "json";
|
|
112692
|
-
VerbosityLevel2[VerbosityLevel2["jsonext"] = 2] = "jsonext";
|
|
112693
|
-
VerbosityLevel2[VerbosityLevel2["jsonextprev"] = 3] = "jsonextprev";
|
|
112694
|
-
})(VerbosityLevel || (VerbosityLevel = {}));
|
|
112695
|
-
|
|
112696
112774
|
// src/core/beacon/utils.ts
|
|
112697
112775
|
init_shim();
|
|
112698
112776
|
|