@did-btcr2/method 0.22.0 → 0.24.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.
Files changed (164) hide show
  1. package/README.md +96 -50
  2. package/dist/browser.js +35708 -37764
  3. package/dist/browser.mjs +35707 -37763
  4. package/dist/cjs/core/beacon/aggregation/cohort/index.js +13 -2
  5. package/dist/cjs/core/beacon/aggregation/cohort/index.js.map +1 -1
  6. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js +7 -2
  7. package/dist/cjs/core/beacon/aggregation/cohort/messages/base.js.map +1 -1
  8. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js +6 -11
  9. package/dist/cjs/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -1
  10. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js +5 -8
  11. package/dist/cjs/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
  12. package/dist/cjs/core/beacon/aggregation/coordinator.js +40 -44
  13. package/dist/cjs/core/beacon/aggregation/coordinator.js.map +1 -1
  14. package/dist/cjs/core/beacon/aggregation/participant.js +35 -38
  15. package/dist/cjs/core/beacon/aggregation/participant.js.map +1 -1
  16. package/dist/cjs/core/beacon/aggregation/session/index.js +18 -7
  17. package/dist/cjs/core/beacon/aggregation/session/index.js.map +1 -1
  18. package/dist/cjs/core/beacon/cas-beacon.js +1 -1
  19. package/dist/cjs/core/beacon/cas-beacon.js.map +1 -1
  20. package/dist/cjs/core/beacon/signal-discovery.js +6 -6
  21. package/dist/cjs/core/beacon/signal-discovery.js.map +1 -1
  22. package/dist/cjs/core/beacon/singleton.js +18 -17
  23. package/dist/cjs/core/beacon/singleton.js.map +1 -1
  24. package/dist/cjs/core/beacon/smt-beacon.js +1 -1
  25. package/dist/cjs/core/beacon/smt-beacon.js.map +1 -1
  26. package/dist/cjs/core/identifier.js +11 -13
  27. package/dist/cjs/core/identifier.js.map +1 -1
  28. package/dist/cjs/core/resolve.js +25 -22
  29. package/dist/cjs/core/resolve.js.map +1 -1
  30. package/dist/cjs/core/update.js +4 -4
  31. package/dist/cjs/core/update.js.map +1 -1
  32. package/dist/cjs/did-btcr2.js +11 -16
  33. package/dist/cjs/did-btcr2.js.map +1 -1
  34. package/dist/cjs/index.js +0 -1
  35. package/dist/cjs/index.js.map +1 -1
  36. package/dist/cjs/utils/did-document.js +22 -21
  37. package/dist/cjs/utils/did-document.js.map +1 -1
  38. package/dist/esm/core/beacon/aggregation/cohort/index.js +13 -2
  39. package/dist/esm/core/beacon/aggregation/cohort/index.js.map +1 -1
  40. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js +7 -2
  41. package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +1 -1
  42. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +6 -11
  43. package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +1 -1
  44. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +5 -8
  45. package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +1 -1
  46. package/dist/esm/core/beacon/aggregation/coordinator.js +40 -44
  47. package/dist/esm/core/beacon/aggregation/coordinator.js.map +1 -1
  48. package/dist/esm/core/beacon/aggregation/participant.js +35 -38
  49. package/dist/esm/core/beacon/aggregation/participant.js.map +1 -1
  50. package/dist/esm/core/beacon/aggregation/session/index.js +18 -7
  51. package/dist/esm/core/beacon/aggregation/session/index.js.map +1 -1
  52. package/dist/esm/core/beacon/cas-beacon.js +1 -1
  53. package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
  54. package/dist/esm/core/beacon/signal-discovery.js +6 -6
  55. package/dist/esm/core/beacon/signal-discovery.js.map +1 -1
  56. package/dist/esm/core/beacon/singleton.js +18 -17
  57. package/dist/esm/core/beacon/singleton.js.map +1 -1
  58. package/dist/esm/core/beacon/smt-beacon.js +1 -1
  59. package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
  60. package/dist/esm/core/identifier.js +11 -13
  61. package/dist/esm/core/identifier.js.map +1 -1
  62. package/dist/esm/core/resolve.js +25 -22
  63. package/dist/esm/core/resolve.js.map +1 -1
  64. package/dist/esm/core/update.js +4 -4
  65. package/dist/esm/core/update.js.map +1 -1
  66. package/dist/esm/did-btcr2.js +11 -16
  67. package/dist/esm/did-btcr2.js.map +1 -1
  68. package/dist/esm/index.js +0 -1
  69. package/dist/esm/index.js.map +1 -1
  70. package/dist/esm/utils/did-document.js +22 -21
  71. package/dist/esm/utils/did-document.js.map +1 -1
  72. package/dist/types/core/beacon/aggregation/cohort/index.d.ts +2 -1
  73. package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +1 -1
  74. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts +2 -1
  75. package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +1 -1
  76. package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +1 -0
  77. package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +1 -0
  78. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +1 -0
  79. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +2 -2
  80. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +1 -1
  81. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +1 -0
  82. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +1 -0
  83. package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +1 -0
  84. package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +1 -0
  85. package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +1 -0
  86. package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +1 -0
  87. package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +1 -0
  88. package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +1 -0
  89. package/dist/types/core/beacon/aggregation/cohort/status.d.ts +1 -0
  90. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +4 -3
  91. package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +1 -1
  92. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +5 -3
  93. package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +1 -1
  94. package/dist/types/core/beacon/aggregation/communication/error.d.ts +1 -0
  95. package/dist/types/core/beacon/aggregation/communication/factory.d.ts +1 -0
  96. package/dist/types/core/beacon/aggregation/communication/service.d.ts +3 -2
  97. package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +1 -1
  98. package/dist/types/core/beacon/aggregation/coordinator.d.ts +1 -0
  99. package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +1 -1
  100. package/dist/types/core/beacon/aggregation/participant.d.ts +1 -0
  101. package/dist/types/core/beacon/aggregation/participant.d.ts.map +1 -1
  102. package/dist/types/core/beacon/aggregation/session/index.d.ts +2 -1
  103. package/dist/types/core/beacon/aggregation/session/index.d.ts.map +1 -1
  104. package/dist/types/core/beacon/aggregation/session/status.d.ts +1 -0
  105. package/dist/types/core/beacon/beacon.d.ts +4 -3
  106. package/dist/types/core/beacon/beacon.d.ts.map +1 -1
  107. package/dist/types/core/beacon/cas-beacon.d.ts +4 -3
  108. package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
  109. package/dist/types/core/beacon/error.d.ts +1 -0
  110. package/dist/types/core/beacon/factory.d.ts +1 -0
  111. package/dist/types/core/beacon/interfaces.d.ts +1 -0
  112. package/dist/types/core/beacon/signal-discovery.d.ts +6 -5
  113. package/dist/types/core/beacon/signal-discovery.d.ts.map +1 -1
  114. package/dist/types/core/beacon/singleton.d.ts +4 -4
  115. package/dist/types/core/beacon/singleton.d.ts.map +1 -1
  116. package/dist/types/core/beacon/smt-beacon.d.ts +4 -3
  117. package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
  118. package/dist/types/core/beacon/utils.d.ts +1 -0
  119. package/dist/types/core/identifier.d.ts +18 -21
  120. package/dist/types/core/identifier.d.ts.map +1 -1
  121. package/dist/types/core/interfaces.d.ts +3 -2
  122. package/dist/types/core/interfaces.d.ts.map +1 -1
  123. package/dist/types/core/resolve.d.ts +4 -3
  124. package/dist/types/core/resolve.d.ts.map +1 -1
  125. package/dist/types/core/types.d.ts +1 -0
  126. package/dist/types/core/update.d.ts +3 -2
  127. package/dist/types/core/update.d.ts.map +1 -1
  128. package/dist/types/did-btcr2.d.ts +5 -4
  129. package/dist/types/did-btcr2.d.ts.map +1 -1
  130. package/dist/types/index.d.ts +1 -1
  131. package/dist/types/index.d.ts.map +1 -1
  132. package/dist/types/utils/appendix.d.ts +1 -0
  133. package/dist/types/utils/did-document-builder.d.ts +1 -0
  134. package/dist/types/utils/did-document.d.ts +5 -7
  135. package/dist/types/utils/did-document.d.ts.map +1 -1
  136. package/package.json +5 -6
  137. package/src/core/beacon/aggregation/cohort/index.ts +13 -2
  138. package/src/core/beacon/aggregation/cohort/messages/base.ts +7 -2
  139. package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +1 -1
  140. package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +9 -15
  141. package/src/core/beacon/aggregation/communication/adapter/nostr.ts +9 -11
  142. package/src/core/beacon/aggregation/communication/service.ts +2 -2
  143. package/src/core/beacon/aggregation/coordinator.ts +40 -44
  144. package/src/core/beacon/aggregation/participant.ts +38 -40
  145. package/src/core/beacon/aggregation/session/index.ts +18 -7
  146. package/src/core/beacon/beacon.ts +3 -3
  147. package/src/core/beacon/cas-beacon.ts +3 -3
  148. package/src/core/beacon/signal-discovery.ts +9 -9
  149. package/src/core/beacon/singleton.ts +20 -20
  150. package/src/core/beacon/smt-beacon.ts +3 -3
  151. package/src/core/identifier.ts +31 -28
  152. package/src/core/interfaces.ts +2 -2
  153. package/src/core/resolve.ts +32 -26
  154. package/src/core/update.ts +6 -6
  155. package/src/did-btcr2.ts +21 -21
  156. package/src/index.ts +0 -1
  157. package/src/utils/did-document.ts +24 -20
  158. package/dist/cjs/utils/general.js +0 -195
  159. package/dist/cjs/utils/general.js.map +0 -1
  160. package/dist/esm/utils/general.js +0 -195
  161. package/dist/esm/utils/general.js.map +0 -1
  162. package/dist/types/utils/general.d.ts +0 -85
  163. package/dist/types/utils/general.d.ts.map +0 -1
  164. package/src/utils/general.ts +0 -204
@@ -1,4 +1,4 @@
1
- import { Logger, Maybe } from '@did-btcr2/common';
1
+ import { Maybe } from '@did-btcr2/common';
2
2
  import { RawSchnorrKeyPair } from '@did-btcr2/keypair';
3
3
  import { BeaconCoordinatorError } from '../error.js';
4
4
  import { AggregateBeaconCohort } from './cohort/index.js';
@@ -6,12 +6,12 @@ import {
6
6
  BEACON_COHORT_ADVERT,
7
7
  BEACON_COHORT_NONCE_CONTRIBUTION,
8
8
  BEACON_COHORT_OPT_IN,
9
- BEACON_COHORT_OPT_IN_ACCEPT,
10
9
  BEACON_COHORT_REQUEST_SIGNATURE,
11
10
  BEACON_COHORT_SIGNATURE_AUTHORIZATION
12
11
  } from './cohort/messages/constants.js';
13
12
  import { BeaconCohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
14
13
  import { BeaconCohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
14
+ import { BeaconCohortOptInAcceptMessage } from './cohort/messages/keygen/opt-in-accept.js';
15
15
  import { BeaconCohortOptInMessage, CohortOptInMessage } from './cohort/messages/keygen/opt-in.js';
16
16
  import { BeaconCohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
17
17
  import { BeaconCohortNonceContributionMessage, CohortNonceContributionMessage } from './cohort/messages/sign/nonce-contribution.js';
@@ -98,7 +98,7 @@ export class BeaconCoordinator {
98
98
  * @returns {void}
99
99
  */
100
100
  start(): void {
101
- Logger.info(`Setting up BeaconCoordinator ${this.name} (${this.did}) on ${this.protocol.name} ...`);
101
+ console.info(`Setting up BeaconCoordinator ${this.name} (${this.did}) on ${this.protocol.name} ...`);
102
102
  this.protocol.registerMessageHandler(BEACON_COHORT_OPT_IN, this.#handleOptIn.bind(this));
103
103
  this.protocol.registerMessageHandler(BEACON_COHORT_REQUEST_SIGNATURE, this.#handleRequestSignature.bind(this));
104
104
  this.protocol.registerMessageHandler(BEACON_COHORT_NONCE_CONTRIBUTION, this.#handleNonceContribution.bind(this));
@@ -117,7 +117,7 @@ export class BeaconCoordinator {
117
117
  const participant = optIn.from;
118
118
  const participantPk = optIn.body?.participantPk;
119
119
  if(!cohortId || !participant || !participantPk) {
120
- Logger.warn(`Invalid opt-in message from ${participant}: missing cohortId, participant or participantPk`);
120
+ console.warn(`Invalid opt-in message from ${participant}: missing cohortId, participant or participantPk`);
121
121
  return;
122
122
  }
123
123
  const cohort = this.cohorts.find(c => c.id === cohortId);
@@ -142,16 +142,16 @@ export class BeaconCoordinator {
142
142
  const signatureRequest = BeaconCohortRequestSignatureMessage.fromJSON(message);
143
143
  const cohortId = signatureRequest.body?.cohortId;
144
144
  if (!cohortId) {
145
- Logger.warn(`Signature request missing cohort ID from ${signatureRequest.from}`);
145
+ console.warn(`Signature request missing cohort ID from ${signatureRequest.from}`);
146
146
  return;
147
147
  }
148
148
  const cohort = this.cohorts.find(c => c.id === cohortId);
149
149
  if (!cohort) {
150
- Logger.error(`Cohort with ID ${cohortId} not found.`);
150
+ console.error(`Cohort with ID ${cohortId} not found.`);
151
151
  return;
152
152
  }
153
153
  cohort.addSignatureRequest(signatureRequest);
154
- Logger.info(`Received signature request from ${signatureRequest.from} for cohort ${cohortId}.`);
154
+ console.info(`Received signature request from ${signatureRequest.from} for cohort ${cohortId}.`);
155
155
  }
156
156
 
157
157
  /**
@@ -164,12 +164,12 @@ export class BeaconCoordinator {
164
164
  const nonceContribMessage = BeaconCohortNonceContributionMessage.fromJSON(message);
165
165
  const cohortId = nonceContribMessage.body?.cohortId;
166
166
  if (!cohortId) {
167
- Logger.warn(`Nonce contribution message missing cohort ID from ${nonceContribMessage.from}`);
167
+ console.warn(`Nonce contribution message missing cohort ID from ${nonceContribMessage.from}`);
168
168
  return;
169
169
  }
170
170
  const sessionId = nonceContribMessage.body?.sessionId;
171
171
  if (!sessionId) {
172
- Logger.warn(`Nonce contribution message missing session ID from ${nonceContribMessage.from}`);
172
+ console.warn(`Nonce contribution message missing session ID from ${nonceContribMessage.from}`);
173
173
  return;
174
174
  }
175
175
  // Get the signing session using the cohort ID from the message.
@@ -177,7 +177,7 @@ export class BeaconCoordinator {
177
177
 
178
178
  // If the signing session does not exist, log an error and return.
179
179
  if(!signingSession) {
180
- Logger.error(`Session ${cohortId || sessionId} not found.`);
180
+ console.error(`Session ${cohortId || sessionId} not found.`);
181
181
  return;
182
182
  }
183
183
 
@@ -190,12 +190,12 @@ export class BeaconCoordinator {
190
190
  }
191
191
  const nonceContribution = nonceContribMessage.body?.nonceContribution;
192
192
  if(!nonceContribution) {
193
- Logger.warn(`Nonce contribution message missing nonce contribution from ${nonceContribMessage.from}`);
193
+ console.warn(`Nonce contribution message missing nonce contribution from ${nonceContribMessage.from}`);
194
194
  return;
195
195
  }
196
196
  // Add the nonce contribution to the signing session.
197
197
  signingSession.addNonceContribution(nonceContribMessage.from, nonceContribution);
198
- Logger.info(`Nonce contribution received from ${nonceContribMessage.from} for session ${sessionId}.`);
198
+ console.info(`Nonce contribution received from ${nonceContribMessage.from} for session ${sessionId}.`);
199
199
 
200
200
  if (signingSession.status !== SIGNING_SESSION_STATUS.NONCE_CONTRIBUTIONS_RECEIVED) {
201
201
  await this.sendAggregatedNonce(signingSession);
@@ -211,17 +211,17 @@ export class BeaconCoordinator {
211
211
  const sigAuthMessage = BeaconCohortSignatureAuthorizationMessage.fromJSON(message);
212
212
  const cohortId = sigAuthMessage.body?.cohortId;
213
213
  if (!cohortId) {
214
- Logger.warn(`Signature authorization message missing cohort ID from ${sigAuthMessage.from}`);
214
+ console.warn(`Signature authorization message missing cohort ID from ${sigAuthMessage.from}`);
215
215
  return;
216
216
  }
217
217
  const sessionId = sigAuthMessage.body?.sessionId;
218
218
  if (!sessionId) {
219
- Logger.warn(`Signature authorization message missing session ID from ${sigAuthMessage.from}`);
219
+ console.warn(`Signature authorization message missing session ID from ${sigAuthMessage.from}`);
220
220
  return;
221
221
  }
222
222
  const signingSession = this.activeSigningSessions.get(cohortId || sessionId);
223
223
  if (!signingSession) {
224
- Logger.error(`Session ${sessionId} not found.`);
224
+ console.error(`Session ${sessionId} not found.`);
225
225
  return;
226
226
  }
227
227
 
@@ -240,12 +240,12 @@ export class BeaconCoordinator {
240
240
  }
241
241
  const partialSignature = sigAuthMessage.body?.partialSignature;
242
242
  if (!partialSignature) {
243
- Logger.warn(`Signature authorization message missing partial signature from ${sigAuthMessage.from}`);
243
+ console.warn(`Signature authorization message missing partial signature from ${sigAuthMessage.from}`);
244
244
  return;
245
245
  }
246
246
  // Add the signature authorization to the signing session.
247
247
  signingSession.addPartialSignature(sigAuthMessage.from, partialSignature);
248
- Logger.info(`Received partial signature from ${sigAuthMessage.from} for session ${sessionId}.`);
248
+ console.info(`Received partial signature from ${sigAuthMessage.from} for session ${sessionId}.`);
249
249
 
250
250
  if(signingSession.partialSignatures.size === signingSession.cohort.participants.length) {
251
251
  signingSession.status = SIGNING_SESSION_STATUS.PARTIAL_SIGNATURES_RECEIVED;
@@ -253,7 +253,7 @@ export class BeaconCoordinator {
253
253
 
254
254
  if (signingSession.status === SIGNING_SESSION_STATUS.PARTIAL_SIGNATURES_RECEIVED) {
255
255
  const signature = await signingSession.generateFinalSignature();
256
- Logger.info(`Final signature ${Buffer.from(signature).toString('hex')} generated for session ${signingSession.id}`);
256
+ console.info(`Final signature ${Buffer.from(signature).toString('hex')} generated for session ${signingSession.id}`);
257
257
  }
258
258
  }
259
259
 
@@ -263,14 +263,14 @@ export class BeaconCoordinator {
263
263
  * @returns {Promise<void>}
264
264
  */
265
265
  private async _startKeyGeneration(cohort: AggregateBeaconCohort): Promise<void> {
266
- Logger.info(`Starting key generation for cohort ${cohort.id} with participants: ${cohort.participants.join(', ')}`);
266
+ console.info(`Starting key generation for cohort ${cohort.id} with participants: ${cohort.participants.join(', ')}`);
267
267
  cohort.finalize();
268
268
  for(const participant of cohort.participants) {
269
269
  const message = cohort.getCohortReadyMessage(participant, this.did);
270
- Logger.info(`Sending BEACON_COHORT_READY message to ${participant}`);
270
+ console.info(`Sending BEACON_COHORT_READY message to ${participant}`);
271
271
  await this.protocol.sendMessage(message, participant, this.did);
272
272
  }
273
- Logger.info(`Finished sending BEACON_COHORT_READY message to ${cohort.participants.length} participants`);
273
+ console.info(`Finished sending BEACON_COHORT_READY message to ${cohort.participants.length} participants`);
274
274
  }
275
275
 
276
276
  /**
@@ -279,12 +279,8 @@ export class BeaconCoordinator {
279
279
  * @returns {Promise<void>}
280
280
  */
281
281
  async acceptSubscription(participant: string): Promise<void> {
282
- Logger.info(`Accepting subscription from ${participant}`);
283
- const message = {
284
- type : BEACON_COHORT_OPT_IN_ACCEPT,
285
- to : participant,
286
- from : this.did
287
- };
282
+ console.info(`Accepting subscription from ${participant}`);
283
+ const message = new BeaconCohortOptInAcceptMessage({ to: participant, from: this.did });
288
284
  await this.protocol.sendMessage(message, this.did, participant);
289
285
  }
290
286
 
@@ -295,7 +291,7 @@ export class BeaconCoordinator {
295
291
  */
296
292
  async sendAggregatedNonce(session: BeaconCohortSigningSession): Promise<void> {
297
293
  const aggregatedNonce = session.generateAggregatedNonce();
298
- Logger.info(`Aggregated Nonces for session ${session.id}:`, aggregatedNonce);
294
+ console.info(`Aggregated Nonces for session ${session.id}:`, aggregatedNonce);
299
295
 
300
296
  session.status = SIGNING_SESSION_STATUS.AWAITING_PARTIAL_SIGNATURES;
301
297
  for (const participant of session.cohort.participants) {
@@ -306,10 +302,10 @@ export class BeaconCoordinator {
306
302
  sessionId : session.id,
307
303
  aggregatedNonce : aggregatedNonce
308
304
  });
309
- Logger.info(`Sending AGGREGATED_NONCE message to ${participant}`);
305
+ console.info(`Sending AGGREGATED_NONCE message to ${participant}`);
310
306
  await this.protocol.sendMessage(message, participant, this.did);
311
307
  }
312
- Logger.info(`Successfully sent aggregated nonce message to all participants in session ${session.id}.`);
308
+ console.info(`Successfully sent aggregated nonce message to all participants in session ${session.id}.`);
313
309
  }
314
310
 
315
311
  /**
@@ -325,7 +321,7 @@ export class BeaconCoordinator {
325
321
  beaconType: string = 'SMTBeacon'
326
322
  ): Promise<AggregateBeaconCohort> {
327
323
  const cohort = new AggregateBeaconCohort({ minParticipants, network, beaconType });
328
- Logger.info(`Advertising new cohort ${cohort.id} ...`);
324
+ console.info(`Advertising new cohort ${cohort.id} ...`);
329
325
  this.cohorts.push(cohort);
330
326
  const message = new BeaconCohortAdvertMessage({
331
327
  from : this.did,
@@ -334,9 +330,9 @@ export class BeaconCoordinator {
334
330
  network : cohort.network,
335
331
  beaconType
336
332
  });
337
- Logger.info(`Sending ${BEACON_COHORT_ADVERT} message to network ...`, message);
333
+ console.info(`Sending ${BEACON_COHORT_ADVERT} message to network ...`, message);
338
334
  await this.protocol.sendMessage(message, this.did);
339
- Logger.info(`Cohort ${cohort.id} advertised successfully.`);
335
+ console.info(`Cohort ${cohort.id} advertised successfully.`);
340
336
  return cohort;
341
337
  }
342
338
 
@@ -349,13 +345,13 @@ export class BeaconCoordinator {
349
345
  async announceCohortReady(cohortId: string): Promise<AggregateBeaconCohort> {
350
346
  const cohort = this.cohorts.find(c => c.id === cohortId);
351
347
  if (!cohort) {
352
- Logger.error(`Cohort with ID ${cohortId} not found.`);
348
+ console.error(`Cohort with ID ${cohortId} not found.`);
353
349
  throw new BeaconCoordinatorError(
354
350
  `Cohort with ID ${cohortId} not found.`,
355
351
  'COHORT_NOT_FOUND', { cohortId }
356
352
  );
357
353
  }
358
- Logger.info(`Announcing cohort ${cohort.id} to ${cohort.participants.length} subscribers...`);
354
+ console.info(`Announcing cohort ${cohort.id} to ${cohort.participants.length} subscribers...`);
359
355
  this.cohorts.push(cohort);
360
356
  for (const participant of cohort.participants) {
361
357
  const message = new BeaconCohortReadyMessage({
@@ -365,7 +361,7 @@ export class BeaconCoordinator {
365
361
  beaconAddress : cohort.beaconAddress,
366
362
  cohortKeys : cohort.cohortKeys,
367
363
  });
368
- Logger.info(`Sending ${BEACON_COHORT_ADVERT} message to ${participant}`);
364
+ console.info(`Sending ${BEACON_COHORT_ADVERT} message to ${participant}`);
369
365
 
370
366
  await this.protocol.sendMessage(message, this.did, participant);
371
367
  }
@@ -379,24 +375,24 @@ export class BeaconCoordinator {
379
375
  * @throws {BeaconCoordinatorError} If the cohort with the given ID is not found.
380
376
  */
381
377
  async startSigningSession(cohortId: string): Promise<BeaconCohortSigningSession> {
382
- Logger.info(`Attempting to start signing session for cohort ${cohortId}`);
378
+ console.info(`Attempting to start signing session for cohort ${cohortId}`);
383
379
  const cohort = this.cohorts.find(c => c.id === cohortId);
384
380
  if (!cohort) {
385
- Logger.error(`Cohort with ID ${cohortId} not found.`);
381
+ console.error(`Cohort with ID ${cohortId} not found.`);
386
382
  throw new BeaconCoordinatorError(`Cohort with ID ${cohortId} not found.`, 'COHORT_NOT_FOUND');
387
383
  }
388
- Logger.info(`Cohort ${cohortId} found. Starting signing session.`);
384
+ console.info(`Cohort ${cohortId} found. Starting signing session.`);
389
385
  const signingSession = cohort.startSigningSession();
390
- Logger.info(`Starting signing session ${signingSession.id} for cohort ${cohortId}`);
386
+ console.info(`Starting signing session ${signingSession.id} for cohort ${cohortId}`);
391
387
  for (const participant of cohort.participants) {
392
388
  const msg = signingSession.getAuthorizationRequest(participant, this.did);
393
- Logger.info(`Sending authorization request to ${participant}`);
389
+ console.info(`Sending authorization request to ${participant}`);
394
390
  await this.protocol.sendMessage(msg, this.did, participant).catch(error => {
395
- Logger.error(`Error sending authorization request to ${participant}: ${error.message}`);
391
+ console.error(`Error sending authorization request to ${participant}: ${error.message}`);
396
392
  });
397
393
  }
398
394
  this.activeSigningSessions.set(cohortId, signingSession);
399
- Logger.info(`Signing session ${signingSession.id} started for cohort ${cohortId}`);
395
+ console.info(`Signing session ${signingSession.id} started for cohort ${cohortId}`);
400
396
  return signingSession;
401
397
  }
402
398
 
@@ -412,7 +408,7 @@ export class BeaconCoordinator {
412
408
  did : service.did,
413
409
  keys : service.keys,
414
410
  });
415
- Logger.info(`BeaconCoordinator ${coordinator.name} initialized with DID ${coordinator.did}. Run .start() to listen for messages`);
411
+ console.info(`BeaconCoordinator ${coordinator.name} initialized with DID ${coordinator.did}. Run .start() to listen for messages`);
416
412
  return coordinator;
417
413
  }
418
414
  }
@@ -1,4 +1,4 @@
1
- import { KeyBytes, Logger, Maybe } from '@did-btcr2/common';
1
+ import { KeyBytes, Maybe } from '@did-btcr2/common';
2
2
  import { HDKey } from '@scure/bip32';
3
3
  import { mnemonicToSeedSync } from '@scure/bip39';
4
4
  import * as musig2 from '@scure/btc-signer/musig2';
@@ -130,7 +130,7 @@ export class BeaconParticipant {
130
130
  this.protocol = protocol || new NostrAdapter();
131
131
  this.protocol.setKeys({ public: pk, secret });
132
132
  this.cohortKeyState.set('__UNSET__', this.beaconKeyIndex);
133
- Logger.debug(`BeaconParticipant initialized with DID: ${this.did}, Name: ${this.name}, Key Index: ${this.beaconKeyIndex}`);
133
+ console.debug(`BeaconParticipant initialized with DID: ${this.did}, Name: ${this.name}, Key Index: ${this.beaconKeyIndex}`);
134
134
  }
135
135
 
136
136
  /**
@@ -138,7 +138,7 @@ export class BeaconParticipant {
138
138
  * @returns {void}
139
139
  */
140
140
  public start(): void {
141
- Logger.info(`Setting up BeaconParticipant ${this.name} (${this.did}) on ${this.protocol.name} ...`);
141
+ console.info(`Setting up BeaconParticipant ${this.name} (${this.did}) on ${this.protocol.name} ...`);
142
142
  this.protocol.registerMessageHandler(BEACON_COHORT_ADVERT, this._handleCohortAdvert.bind(this));
143
143
  this.protocol.registerMessageHandler(BEACON_COHORT_OPT_IN_ACCEPT, this._handleSubscribeAccept.bind(this));
144
144
  this.protocol.registerMessageHandler(BEACON_COHORT_READY, this._handleCohortReady.bind(this));
@@ -171,10 +171,10 @@ export class BeaconParticipant {
171
171
  this.beaconKeyIndex = this.cohortKeyState.size + 1;
172
172
  }
173
173
  if(this.cohortKeyState.has(cohortId)) {
174
- Logger.warn(`Cohort key state for cohort ${cohortId} already exists. Updating key index.`);
174
+ console.warn(`Cohort key state for cohort ${cohortId} already exists. Updating key index.`);
175
175
  }
176
176
  this.cohortKeyState.set(cohortId, this.beaconKeyIndex);
177
- Logger.info(`Cohort key state updated. Next beacon key index: ${this.beaconKeyIndex + 1}`);
177
+ console.info(`Cohort key state updated. Next beacon key index: ${this.beaconKeyIndex + 1}`);
178
178
  }
179
179
 
180
180
  /**
@@ -196,7 +196,7 @@ export class BeaconParticipant {
196
196
  }
197
197
 
198
198
  if (this.cohortKeyState.has(cohortId)) {
199
- Logger.warn(`Cohort key state already exists for ${cohortId}. Skipping migration from '__UNSET__'.`);
199
+ console.warn(`Cohort key state already exists for ${cohortId}. Skipping migration from '__UNSET__'.`);
200
200
  this.cohortKeyState.delete(unsetKey);
201
201
  return;
202
202
  }
@@ -204,7 +204,7 @@ export class BeaconParticipant {
204
204
  this.setCohortKey(cohortId);
205
205
  this.cohortKeyState.delete(unsetKey);
206
206
 
207
- Logger.info(`Finalized '__UNSET__' CohortKeyState with ${cohortId} for ${this.did}`);
207
+ console.info(`Finalized '__UNSET__' CohortKeyState with ${cohortId} for ${this.did}`);
208
208
  }
209
209
 
210
210
  /**
@@ -226,25 +226,25 @@ export class BeaconParticipant {
226
226
  * @returns {Promise<void>}
227
227
  */
228
228
  public async _handleCohortAdvert(message: Maybe<CohortAdvertMessage>): Promise<void> {
229
- Logger.debug('_handleCohortAdvert', message);
229
+ console.debug('_handleCohortAdvert', message);
230
230
  const cohortAdvertMessage = BeaconCohortAdvertMessage.fromJSON(message);
231
- Logger.info(`Received new cohort announcement from ${cohortAdvertMessage.from}`, cohortAdvertMessage);
231
+ console.info(`Received new cohort announcement from ${cohortAdvertMessage.from}`, cohortAdvertMessage);
232
232
 
233
233
  const cohortId = cohortAdvertMessage.body?.cohortId;
234
234
  if (!cohortId) {
235
- Logger.warn('Received malformed cohort advert message: missing cohortId', cohortAdvertMessage);
235
+ console.warn('Received malformed cohort advert message: missing cohortId', cohortAdvertMessage);
236
236
  return;
237
237
  }
238
238
 
239
239
  const network = cohortAdvertMessage.body?.network;
240
240
  if (!network) {
241
- Logger.warn('Received malformed cohort advert message: missing network', cohortAdvertMessage);
241
+ console.warn('Received malformed cohort advert message: missing network', cohortAdvertMessage);
242
242
  return;
243
243
  }
244
244
 
245
245
  const minParticipants = cohortAdvertMessage.body?.cohortSize;
246
246
  if (!cohortId || !network || !minParticipants) {
247
- Logger.warn('Received malformed cohort advert message: missing minParticipants', cohortAdvertMessage);
247
+ console.warn('Received malformed cohort advert message: missing minParticipants', cohortAdvertMessage);
248
248
  return;
249
249
  }
250
250
 
@@ -271,30 +271,30 @@ export class BeaconParticipant {
271
271
  const cohortId = cohortSetMessage.body?.cohortId;
272
272
  const cohort = this.cohorts.find(c => c.id === cohortId);
273
273
  if (!cohortId || !cohort) {
274
- Logger.warn(`Cohort with ID ${cohortId} not found or not joined by participant ${this.did}.`);
274
+ console.warn(`Cohort with ID ${cohortId} not found or not joined by participant ${this.did}.`);
275
275
  return;
276
276
  }
277
277
  this.finalizeUnsetCohortKey(cohortId);
278
278
  const participantPkBytes = this.getCohortKey(cohortId).publicKey;
279
279
  if(!participantPkBytes) {
280
- Logger.error(`Failed to derive public key for cohort ${cohortId}`);
280
+ console.error(`Failed to derive public key for cohort ${cohortId}`);
281
281
  return;
282
282
  }
283
283
  const participantPk = Buffer.from(participantPkBytes).toString('hex');
284
284
  const beaconAddress = cohortSetMessage.body?.beaconAddress;
285
285
  if(!beaconAddress) {
286
- Logger.error(`Beacon address not provided in cohort set message for ${cohortId}`);
286
+ console.error(`Beacon address not provided in cohort set message for ${cohortId}`);
287
287
  return;
288
288
  }
289
289
  const cohortKeys = cohortSetMessage.body?.cohortKeys;
290
290
  if(!cohortKeys) {
291
- Logger.error(`Cohort keys not provided in cohort set message for ${cohortId}`);
291
+ console.error(`Cohort keys not provided in cohort set message for ${cohortId}`);
292
292
  return;
293
293
  }
294
294
  const keys = cohortKeys.map(key => Buffer.from(key).toString('hex'));
295
295
  cohort.validateCohort([participantPk], keys, beaconAddress);
296
- Logger.info(`BeaconParticipant w/ pk ${participantPk} successfully joined cohort ${cohortId} with beacon address ${beaconAddress}.`);
297
- Logger.info(`Cohort status: ${cohort.status}`);
296
+ console.info(`BeaconParticipant w/ pk ${participantPk} successfully joined cohort ${cohortId} with beacon address ${beaconAddress}.`);
297
+ console.info(`Cohort status: ${cohort.status}`);
298
298
  }
299
299
 
300
300
  /**
@@ -306,17 +306,17 @@ export class BeaconParticipant {
306
306
  const authRequest = BeaconCohortAuthorizationRequestMessage.fromJSON(message);
307
307
  const cohort = this.cohorts.find(c => c.id === authRequest.body?.cohortId);
308
308
  if (!cohort) {
309
- Logger.warn(`Authorization request for unknown cohort ${authRequest.body?.cohortId} from ${authRequest.from}`);
309
+ console.warn(`Authorization request for unknown cohort ${authRequest.body?.cohortId} from ${authRequest.from}`);
310
310
  return;
311
311
  }
312
312
  const id = authRequest.body?.sessionId;
313
313
  if (!id) {
314
- Logger.warn(`Authorization request missing session ID from ${authRequest.from}`);
314
+ console.warn(`Authorization request missing session ID from ${authRequest.from}`);
315
315
  return;
316
316
  }
317
317
  const pendingTx = authRequest.body?.pendingTx;
318
318
  if (!pendingTx) {
319
- Logger.warn(`Authorization request missing pending transaction from ${authRequest.from}`);
319
+ console.warn(`Authorization request missing pending transaction from ${authRequest.from}`);
320
320
  return;
321
321
  }
322
322
  const session = new BeaconCohortSigningSession({
@@ -338,23 +338,23 @@ export class BeaconParticipant {
338
338
  const aggNonceMessage = BeaconCohortAggregatedNonceMessage.fromJSON(message);
339
339
  const sessionId = aggNonceMessage.body?.sessionId;
340
340
  if (!sessionId) {
341
- Logger.warn(`Aggregated nonce message missing session ID from ${aggNonceMessage.from}`);
341
+ console.warn(`Aggregated nonce message missing session ID from ${aggNonceMessage.from}`);
342
342
  return;
343
343
  }
344
344
  const session = this.activeSigningSessions.get(sessionId);
345
345
  if (!session) {
346
- Logger.warn(`Aggregated nonce message received for unknown session ${sessionId}`);
346
+ console.warn(`Aggregated nonce message received for unknown session ${sessionId}`);
347
347
  return;
348
348
  }
349
349
  const aggregatedNonce = aggNonceMessage.body?.aggregatedNonce;
350
350
  if (!aggregatedNonce) {
351
- Logger.warn(`Aggregated nonce message missing aggregated nonce from ${aggNonceMessage.from}`);
351
+ console.warn(`Aggregated nonce message missing aggregated nonce from ${aggNonceMessage.from}`);
352
352
  return;
353
353
  }
354
354
  session.aggregatedNonce = aggregatedNonce;
355
355
  const participantSk = this.getCohortKey(session.cohort.id).privateKey;
356
356
  if(!participantSk) {
357
- Logger.error(`Failed to derive secret key for cohort ${session.cohort.id}`);
357
+ console.error(`Failed to derive secret key for cohort ${session.cohort.id}`);
358
358
  return;
359
359
  }
360
360
  const partialSig = session.generatePartialSignature(participantSk);
@@ -368,7 +368,7 @@ export class BeaconParticipant {
368
368
  */
369
369
  public async subscribeToCoordinator(coordinatorDid: string): Promise<any> {
370
370
  if(this.coordinatorDids.includes(coordinatorDid)) {
371
- Logger.info(`Already subscribed to coordinator ${coordinatorDid}`);
371
+ console.info(`Already subscribed to coordinator ${coordinatorDid}`);
372
372
  return;
373
373
  }
374
374
  const subMessage = new BeaconCohortSubscribeMessage({ to: coordinatorDid, from: this.did });
@@ -382,16 +382,16 @@ export class BeaconParticipant {
382
382
  * @returns {Promise<void>}
383
383
  */
384
384
  public async joinCohort(cohortId: string, coordinatorDid: string): Promise<void> {
385
- Logger.info(`BeaconParticipant ${this.did} joining cohort ${cohortId} with coordinator ${coordinatorDid}`);
385
+ console.info(`BeaconParticipant ${this.did} joining cohort ${cohortId} with coordinator ${coordinatorDid}`);
386
386
  this.finalizeUnsetCohortKey(cohortId);
387
387
  const cohort = this.cohorts.find(c => c.id === cohortId);
388
388
  if (!cohort) {
389
- Logger.warn(`Cohort with ID ${cohortId} not found.`);
389
+ console.warn(`Cohort with ID ${cohortId} not found.`);
390
390
  return;
391
391
  }
392
392
  const pk = this.getCohortKey(cohortId).publicKey;
393
393
  if(!pk) {
394
- Logger.error(`Failed to derive public key for cohort ${cohortId} at index ${this.beaconKeyIndex}`);
394
+ console.error(`Failed to derive public key for cohort ${cohortId} at index ${this.beaconKeyIndex}`);
395
395
  return;
396
396
  }
397
397
  this.setCohortKey(cohortId);
@@ -415,11 +415,11 @@ export class BeaconParticipant {
415
415
  public async requestCohortSignature(cohortId: string, data: string): Promise<boolean> {
416
416
  const cohort = this.cohorts.find(c => c.id === cohortId);
417
417
  if (!cohort) {
418
- Logger.warn(`Cohort with ID ${cohortId} not found.`);
418
+ console.warn(`Cohort with ID ${cohortId} not found.`);
419
419
  return false;
420
420
  }
421
421
  if(cohort.status !== COHORT_STATUS.COHORT_SET_STATUS) {
422
- Logger.warn(`Cohort ${cohortId} not in a set state. Current status: ${cohort.status}`);
422
+ console.warn(`Cohort ${cohortId} not in a set state. Current status: ${cohort.status}`);
423
423
  return false;
424
424
  }
425
425
  const reqSigMessage = new BeaconCohortRequestSignatureMessage({
@@ -469,16 +469,14 @@ export class BeaconParticipant {
469
469
  session: BeaconCohortSigningSession
470
470
  ): Promise<void> {
471
471
  const nonceContributionMessage = BeaconCohortNonceContributionMessage.fromJSON({
472
- to : cohort.coordinatorDid,
473
- from : this.did,
474
- body : {
475
- sessionId : session.id,
476
- cohortId : cohort.id,
477
- nonceContribution
478
- }
472
+ to : cohort.coordinatorDid,
473
+ from : this.did,
474
+ sessionId : session.id,
475
+ cohortId : cohort.id,
476
+ nonceContribution
479
477
  });
480
478
  await this.protocol.sendMessage(nonceContributionMessage, this.did, cohort.coordinatorDid);
481
- Logger.info(`Nonce contribution sent for session ${session.id} in cohort ${cohort.id} by participant ${this.did}`);
479
+ console.info(`Nonce contribution sent for session ${session.id} in cohort ${cohort.id} by participant ${this.did}`);
482
480
  }
483
481
 
484
482
  /**
@@ -496,7 +494,7 @@ export class BeaconParticipant {
496
494
  partialSignature : partialSig,
497
495
  });
498
496
  await this.protocol.sendMessage(sigAuthMessage, this.did, session.cohort.coordinatorDid);
499
- Logger.info(`Partial signature sent for session ${session.id} in cohort ${session.cohort.id} by participant ${this.did}`);
497
+ console.info(`Partial signature sent for session ${session.id} in cohort ${session.cohort.id} by participant ${this.did}`);
500
498
  }
501
499
 
502
500
  /**
@@ -1,4 +1,3 @@
1
- import { Logger } from '@did-btcr2/common';
2
1
  import * as musig2 from '@scure/btc-signer/musig2';
3
2
  import { Transaction } from 'bitcoinjs-lib';
4
3
  import { AggregateBeaconError } from '../../error.js';
@@ -166,7 +165,7 @@ export class BeaconCohortSigningSession implements SigningSession {
166
165
  }
167
166
 
168
167
  if (this.nonceContributions.get(from)) {
169
- Logger.warn(`WARNING: Nonce contribution already received from ${from}.`);
168
+ console.warn(`WARNING: Nonce contribution already received from ${from}.`);
170
169
  }
171
170
 
172
171
  this.nonceContributions.set(from, nonceContribution);
@@ -188,7 +187,7 @@ export class BeaconCohortSigningSession implements SigningSession {
188
187
  `Missing ${missing} nonce contributions. ` +
189
188
  `Received ${this.cohort?.participants.length} of ${this.nonceContributions.size} nonce contributions. ` +
190
189
  `Current status: ${this.status}`,
191
- 'NONCE_CONTRIBUTION_ERROR', this.json()
190
+ 'NONCE_CONTRIBUTION_ERROR', this.toJSON()
192
191
  );
193
192
  }
194
193
  const sortedPubkeys = musig2.sortKeys(this.cohort.cohortKeys);
@@ -210,7 +209,7 @@ export class BeaconCohortSigningSession implements SigningSession {
210
209
  }
211
210
 
212
211
  if(this.partialSignatures.get(from)) {
213
- Logger.warn(`WARNING: Partial signature already received from ${from}.`);
212
+ console.warn(`WARNING: Partial signature already received from ${from}.`);
214
213
  }
215
214
 
216
215
  this.partialSignatures.set(from, partialSignature);
@@ -236,7 +235,7 @@ export class BeaconCohortSigningSession implements SigningSession {
236
235
  }
237
236
 
238
237
  const sigSum = [...this.partialSignatures.values()].reduce((sum, sig) => sum + bigEndianToInt(sig), 0n);
239
- Logger.info(`Aggregated Signature computed: ${sigSum}`);
238
+ console.info(`Aggregated Signature computed: ${sigSum}`);
240
239
 
241
240
  this.aggregatedNonce ??= this.generateAggregatedNonce();
242
241
 
@@ -267,8 +266,20 @@ export class BeaconCohortSigningSession implements SigningSession {
267
266
  * Converts the signing session instance to a JSON object representation.
268
267
  * @returns {BeaconCohortSigningSession} The JSON object representation of the signing session.
269
268
  */
270
- public json(): BeaconCohortSigningSession {
271
- return Object.fromEntries(Object.entries(this)) as BeaconCohortSigningSession;
269
+ public toJSON(): Partial<BeaconCohortSigningSession> {
270
+ return {
271
+ id : this.id,
272
+ cohort : this.cohort,
273
+ pendingTx : this.pendingTx,
274
+ nonceContributions : this.nonceContributions,
275
+ aggregatedNonce : this.aggregatedNonce,
276
+ partialSignatures : this.partialSignatures,
277
+ signature : this.signature,
278
+ status : this.status,
279
+ processedRequests : this.processedRequests,
280
+ nonceSecrets : this.nonceSecrets,
281
+ musig2Session : this.musig2Session
282
+ };
272
283
  }
273
284
 
274
285
  /**
@@ -1,5 +1,5 @@
1
1
  import { KeyBytes } from '@did-btcr2/common';
2
- import { BitcoinNetworkConnection } from '../../../../bitcoin/dist/types/bitcoin.js';
2
+ import { BitcoinConnection } from '@did-btcr2/bitcoin';
3
3
  import { SignedBTCR2Update } from '../../../../cryptosuite/dist/types/data-integrity-proof/interface.js';
4
4
  import { SidecarData } from '../types.js';
5
5
  import { BeaconService, BeaconSignal, BlockMetadata } from './interfaces.js';
@@ -47,12 +47,12 @@ export abstract class Beacon {
47
47
  * Used during the update path.
48
48
  * @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
49
49
  * @param {KeyBytes} secretKey The secret key for signing the Bitcoin transaction.
50
- * @param {BitcoinNetworkConnection} bitcoin The Bitcoin network connection.
50
+ * @param {BitcoinConnection} bitcoin The Bitcoin network connection.
51
51
  * @returns {Promise<SignedBTCR2Update>} The signed update that was broadcast.
52
52
  */
53
53
  abstract broadcastSignal(
54
54
  signedUpdate: SignedBTCR2Update,
55
55
  secretKey: KeyBytes,
56
- bitcoin: BitcoinNetworkConnection
56
+ bitcoin: BitcoinConnection
57
57
  ): Promise<SignedBTCR2Update>;
58
58
  }
@@ -1,4 +1,4 @@
1
- import { BitcoinNetworkConnection } from '@did-btcr2/bitcoin';
1
+ import { BitcoinConnection } from '@did-btcr2/bitcoin';
2
2
  import { KeyBytes } from '@did-btcr2/common';
3
3
  import { SignedBTCR2Update } from '@did-btcr2/cryptosuite';
4
4
  import { SidecarData } from '../types.js';
@@ -39,14 +39,14 @@ export class CASBeacon extends Beacon {
39
39
  * Broadcast CAS Beacon signal to the Bitcoin network.
40
40
  * @param {SignedBTCR2Update} signedUpdate The signed BTCR2 update to broadcast.
41
41
  * @param {KeyBytes} secretKey The secret key for signing the Bitcoin transaction.
42
- * @param {BitcoinNetworkConnection} bitcoin The Bitcoin network connection.
42
+ * @param {BitcoinConnection} bitcoin The Bitcoin network connection.
43
43
  * @return {Promise<SignedBTCR2Update>} The signed update that was broadcasted.
44
44
  * @throws {CASBeaconError} if broadcasting fails.
45
45
  */
46
46
  async broadcastSignal(
47
47
  signedUpdate: SignedBTCR2Update,
48
48
  secretKey: KeyBytes,
49
- bitcoin: BitcoinNetworkConnection
49
+ bitcoin: BitcoinConnection
50
50
  ): Promise<SignedBTCR2Update> {
51
51
  throw new CASBeaconError('Method not implemented.', `METHOD_NOT_IMPLEMENTED`, {signedUpdate, secretKey, bitcoin});
52
52
  }