@did-btcr2/method 0.26.0 → 0.28.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/README.md +118 -236
- package/dist/.tsbuildinfo +1 -1
- package/dist/browser.js +27665 -23764
- package/dist/browser.mjs +27665 -23764
- package/dist/cjs/index.js +2661 -2239
- package/dist/esm/core/aggregation/cohort.js +178 -0
- package/dist/esm/core/aggregation/cohort.js.map +1 -0
- package/dist/esm/core/aggregation/errors.js +22 -0
- package/dist/esm/core/aggregation/errors.js.map +1 -0
- package/dist/esm/core/{beacon/aggregation/cohort → aggregation}/messages/base.js +0 -1
- package/dist/esm/core/aggregation/messages/base.js.map +1 -0
- package/dist/esm/core/aggregation/messages/constants.js +26 -0
- package/dist/esm/core/aggregation/messages/constants.js.map +1 -0
- package/dist/esm/core/aggregation/messages/factories.js +113 -0
- package/dist/esm/core/aggregation/messages/factories.js.map +1 -0
- package/dist/esm/core/aggregation/messages/guards.js +37 -0
- package/dist/esm/core/aggregation/messages/guards.js.map +1 -0
- package/dist/esm/core/aggregation/messages/index.js +5 -0
- package/dist/esm/core/aggregation/messages/index.js.map +1 -0
- package/dist/esm/core/aggregation/participant.js +376 -0
- package/dist/esm/core/aggregation/participant.js.map +1 -0
- package/dist/esm/core/aggregation/phases.js +39 -0
- package/dist/esm/core/aggregation/phases.js.map +1 -0
- package/dist/esm/core/aggregation/runner/events.js +2 -0
- package/dist/esm/core/aggregation/runner/events.js.map +1 -0
- package/dist/esm/core/aggregation/runner/index.js +5 -0
- package/dist/esm/core/aggregation/runner/index.js.map +1 -0
- package/dist/esm/core/aggregation/runner/participant-runner.js +286 -0
- package/dist/esm/core/aggregation/runner/participant-runner.js.map +1 -0
- package/dist/esm/core/aggregation/runner/service-runner.js +290 -0
- package/dist/esm/core/aggregation/runner/service-runner.js.map +1 -0
- package/dist/esm/core/aggregation/runner/typed-emitter.js +80 -0
- package/dist/esm/core/aggregation/runner/typed-emitter.js.map +1 -0
- package/dist/esm/core/aggregation/service.js +416 -0
- package/dist/esm/core/aggregation/service.js.map +1 -0
- package/dist/esm/core/aggregation/signing-session.js +133 -0
- package/dist/esm/core/aggregation/signing-session.js.map +1 -0
- package/dist/esm/core/aggregation/transport/didcomm.js +32 -0
- package/dist/esm/core/aggregation/transport/didcomm.js.map +1 -0
- package/dist/esm/core/aggregation/transport/error.js +12 -0
- package/dist/esm/core/aggregation/transport/error.js.map +1 -0
- package/dist/esm/core/aggregation/transport/factory.js +20 -0
- package/dist/esm/core/aggregation/transport/factory.js.map +1 -0
- package/dist/esm/core/aggregation/transport/index.js +6 -0
- package/dist/esm/core/aggregation/transport/index.js.map +1 -0
- package/dist/esm/core/aggregation/transport/nostr.js +262 -0
- package/dist/esm/core/aggregation/transport/nostr.js.map +1 -0
- package/dist/esm/core/aggregation/transport/transport.js +2 -0
- package/dist/esm/core/aggregation/transport/transport.js.map +1 -0
- package/dist/esm/core/beacon/beacon.js +80 -0
- package/dist/esm/core/beacon/beacon.js.map +1 -1
- package/dist/esm/core/beacon/cas-beacon.js +15 -56
- package/dist/esm/core/beacon/cas-beacon.js.map +1 -1
- package/dist/esm/core/beacon/error.js +0 -10
- package/dist/esm/core/beacon/error.js.map +1 -1
- package/dist/esm/core/beacon/fee-estimator.js +30 -0
- package/dist/esm/core/beacon/fee-estimator.js.map +1 -0
- package/dist/esm/core/beacon/singleton-beacon.js +10 -53
- package/dist/esm/core/beacon/singleton-beacon.js.map +1 -1
- package/dist/esm/core/beacon/smt-beacon.js +85 -9
- package/dist/esm/core/beacon/smt-beacon.js.map +1 -1
- package/dist/esm/core/identifier.js +13 -0
- package/dist/esm/core/identifier.js.map +1 -1
- package/dist/esm/core/resolver.js +9 -0
- package/dist/esm/core/resolver.js.map +1 -1
- package/dist/esm/core/updater.js +269 -0
- package/dist/esm/core/updater.js.map +1 -0
- package/dist/esm/did-btcr2.js +30 -42
- package/dist/esm/did-btcr2.js.map +1 -1
- package/dist/esm/index.js +16 -25
- package/dist/esm/index.js.map +1 -1
- package/dist/types/core/aggregation/cohort.d.ts +94 -0
- package/dist/types/core/aggregation/cohort.d.ts.map +1 -0
- package/dist/types/core/aggregation/errors.d.ts +14 -0
- package/dist/types/core/aggregation/errors.d.ts.map +1 -0
- package/dist/types/core/{beacon/aggregation/cohort → aggregation}/messages/base.d.ts +7 -1
- package/dist/types/core/aggregation/messages/base.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/constants.d.ts +23 -0
- package/dist/types/core/aggregation/messages/constants.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/factories.d.ts +177 -0
- package/dist/types/core/aggregation/messages/factories.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/guards.d.ts +11 -0
- package/dist/types/core/aggregation/messages/guards.d.ts.map +1 -0
- package/dist/types/core/aggregation/messages/index.d.ts +5 -0
- package/dist/types/core/aggregation/messages/index.d.ts.map +1 -0
- package/dist/types/core/aggregation/participant.d.ts +101 -0
- package/dist/types/core/aggregation/participant.d.ts.map +1 -0
- package/dist/types/core/aggregation/phases.d.ts +49 -0
- package/dist/types/core/aggregation/phases.d.ts.map +1 -0
- package/dist/types/core/aggregation/runner/events.d.ts +89 -0
- package/dist/types/core/aggregation/runner/events.d.ts.map +1 -0
- package/dist/types/core/aggregation/runner/index.d.ts +5 -0
- package/dist/types/core/aggregation/runner/index.d.ts.map +1 -0
- package/dist/types/core/aggregation/runner/participant-runner.d.ts +111 -0
- package/dist/types/core/aggregation/runner/participant-runner.d.ts.map +1 -0
- package/dist/types/core/aggregation/runner/service-runner.d.ts +102 -0
- package/dist/types/core/aggregation/runner/service-runner.d.ts.map +1 -0
- package/dist/types/core/aggregation/runner/typed-emitter.d.ts +41 -0
- package/dist/types/core/aggregation/runner/typed-emitter.d.ts.map +1 -0
- package/dist/types/core/aggregation/service.d.ts +112 -0
- package/dist/types/core/aggregation/service.d.ts.map +1 -0
- package/dist/types/core/aggregation/signing-session.d.ts +69 -0
- package/dist/types/core/aggregation/signing-session.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/didcomm.d.ts +20 -0
- package/dist/types/core/aggregation/transport/didcomm.d.ts.map +1 -0
- package/dist/types/core/{beacon/aggregation/communication → aggregation/transport}/error.d.ts +2 -2
- package/dist/types/core/aggregation/transport/error.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/factory.d.ts +13 -0
- package/dist/types/core/aggregation/transport/factory.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/index.d.ts +6 -0
- package/dist/types/core/aggregation/transport/index.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/nostr.d.ts +55 -0
- package/dist/types/core/aggregation/transport/nostr.d.ts.map +1 -0
- package/dist/types/core/aggregation/transport/transport.d.ts +37 -0
- package/dist/types/core/aggregation/transport/transport.d.ts.map +1 -0
- package/dist/types/core/beacon/beacon.d.ts +37 -2
- package/dist/types/core/beacon/beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/cas-beacon.d.ts +19 -7
- package/dist/types/core/beacon/cas-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/error.d.ts +0 -6
- package/dist/types/core/beacon/error.d.ts.map +1 -1
- package/dist/types/core/beacon/fee-estimator.d.ts +40 -0
- package/dist/types/core/beacon/fee-estimator.d.ts.map +1 -0
- package/dist/types/core/beacon/interfaces.d.ts +8 -0
- package/dist/types/core/beacon/interfaces.d.ts.map +1 -1
- package/dist/types/core/beacon/singleton-beacon.d.ts +9 -2
- package/dist/types/core/beacon/singleton-beacon.d.ts.map +1 -1
- package/dist/types/core/beacon/smt-beacon.d.ts +27 -7
- package/dist/types/core/beacon/smt-beacon.d.ts.map +1 -1
- package/dist/types/core/identifier.d.ts +8 -0
- package/dist/types/core/identifier.d.ts.map +1 -1
- package/dist/types/core/interfaces.d.ts +2 -2
- package/dist/types/core/resolver.d.ts +11 -1
- package/dist/types/core/resolver.d.ts.map +1 -1
- package/dist/types/core/updater.d.ts +178 -0
- package/dist/types/core/updater.d.ts.map +1 -0
- package/dist/types/did-btcr2.d.ts +23 -23
- package/dist/types/did-btcr2.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -25
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +31 -30
- package/src/core/aggregation/cohort.ts +247 -0
- package/src/core/aggregation/errors.ts +25 -0
- package/src/core/{beacon/aggregation/cohort → aggregation}/messages/base.ts +8 -3
- package/src/core/aggregation/messages/constants.ts +28 -0
- package/src/core/aggregation/messages/factories.ts +240 -0
- package/src/core/aggregation/messages/guards.ts +55 -0
- package/src/core/aggregation/messages/index.ts +4 -0
- package/src/core/aggregation/participant.ts +510 -0
- package/src/core/aggregation/phases.ts +82 -0
- package/src/core/aggregation/runner/events.ts +77 -0
- package/src/core/aggregation/runner/index.ts +4 -0
- package/src/core/aggregation/runner/participant-runner.ts +364 -0
- package/src/core/aggregation/runner/service-runner.ts +365 -0
- package/src/core/aggregation/runner/typed-emitter.ts +87 -0
- package/src/core/aggregation/service.ts +547 -0
- package/src/core/aggregation/signing-session.ts +209 -0
- package/src/core/aggregation/transport/didcomm.ts +42 -0
- package/src/core/aggregation/transport/error.ts +13 -0
- package/src/core/aggregation/transport/factory.ts +29 -0
- package/src/core/aggregation/transport/index.ts +5 -0
- package/src/core/aggregation/transport/nostr.ts +333 -0
- package/src/core/aggregation/transport/transport.ts +46 -0
- package/src/core/beacon/beacon.ts +122 -2
- package/src/core/beacon/cas-beacon.ts +28 -76
- package/src/core/beacon/error.ts +0 -12
- package/src/core/beacon/fee-estimator.ts +52 -0
- package/src/core/beacon/interfaces.ts +10 -1
- package/src/core/beacon/singleton-beacon.ts +14 -75
- package/src/core/beacon/smt-beacon.ts +109 -11
- package/src/core/identifier.ts +17 -0
- package/src/core/interfaces.ts +2 -2
- package/src/core/resolver.ts +25 -2
- package/src/core/updater.ts +415 -0
- package/src/did-btcr2.ts +36 -66
- package/src/index.ts +17 -30
- package/dist/esm/core/beacon/aggregation/cohort/index.js +0 -237
- package/dist/esm/core/beacon/aggregation/cohort/index.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/base.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js +0 -11
- package/dist/esm/core/beacon/aggregation/cohort/messages/constants.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/index.js +0 -98
- package/dist/esm/core/beacon/aggregation/cohort/messages/index.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js +0 -31
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js +0 -29
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js +0 -27
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js +0 -23
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/opt-in.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js +0 -28
- package/dist/esm/core/beacon/aggregation/cohort/messages/keygen/subscribe.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js +0 -29
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js +0 -30
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/authorization-request.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js +0 -30
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js +0 -30
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/request-signature.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js +0 -31
- package/dist/esm/core/beacon/aggregation/cohort/messages/sign/signature-authorization.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/cohort/status.js +0 -8
- package/dist/esm/core/beacon/aggregation/cohort/status.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js +0 -121
- package/dist/esm/core/beacon/aggregation/communication/adapter/did-comm.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js +0 -245
- package/dist/esm/core/beacon/aggregation/communication/adapter/nostr.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/communication/error.js +0 -12
- package/dist/esm/core/beacon/aggregation/communication/error.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/communication/factory.js +0 -21
- package/dist/esm/core/beacon/aggregation/communication/factory.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/communication/service.js +0 -2
- package/dist/esm/core/beacon/aggregation/communication/service.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/coordinator.js +0 -343
- package/dist/esm/core/beacon/aggregation/coordinator.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/participant.js +0 -435
- package/dist/esm/core/beacon/aggregation/participant.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/session/index.js +0 -244
- package/dist/esm/core/beacon/aggregation/session/index.js.map +0 -1
- package/dist/esm/core/beacon/aggregation/session/status.js +0 -11
- package/dist/esm/core/beacon/aggregation/session/status.js.map +0 -1
- package/dist/esm/core/update.js +0 -112
- package/dist/esm/core/update.js.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts +0 -136
- package/dist/types/core/beacon/aggregation/cohort/index.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/base.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts +0 -11
- package/dist/types/core/beacon/aggregation/cohort/messages/constants.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts +0 -65
- package/dist/types/core/beacon/aggregation/cohort/messages/index.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts +0 -29
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts +0 -26
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts +0 -24
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts +0 -20
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/opt-in.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts +0 -25
- package/dist/types/core/beacon/aggregation/cohort/messages/keygen/subscribe.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts +0 -25
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts +0 -26
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/authorization-request.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts +0 -26
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts +0 -26
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/request-signature.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts +0 -27
- package/dist/types/core/beacon/aggregation/cohort/messages/sign/signature-authorization.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/cohort/status.d.ts +0 -8
- package/dist/types/core/beacon/aggregation/cohort/status.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts +0 -89
- package/dist/types/core/beacon/aggregation/communication/adapter/did-comm.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts +0 -103
- package/dist/types/core/beacon/aggregation/communication/adapter/nostr.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/communication/error.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts +0 -10
- package/dist/types/core/beacon/aggregation/communication/factory.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/communication/service.d.ts +0 -36
- package/dist/types/core/beacon/aggregation/communication/service.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/coordinator.d.ts +0 -116
- package/dist/types/core/beacon/aggregation/coordinator.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/participant.d.ts +0 -192
- package/dist/types/core/beacon/aggregation/participant.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/session/index.d.ts +0 -156
- package/dist/types/core/beacon/aggregation/session/index.d.ts.map +0 -1
- package/dist/types/core/beacon/aggregation/session/status.d.ts +0 -11
- package/dist/types/core/beacon/aggregation/session/status.d.ts.map +0 -1
- package/dist/types/core/update.d.ts +0 -52
- package/dist/types/core/update.d.ts.map +0 -1
- package/src/core/beacon/aggregation/cohort/index.ts +0 -305
- package/src/core/beacon/aggregation/cohort/messages/constants.ts +0 -12
- package/src/core/beacon/aggregation/cohort/messages/index.ts +0 -143
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-advert.ts +0 -44
- package/src/core/beacon/aggregation/cohort/messages/keygen/cohort-ready.ts +0 -40
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in-accept.ts +0 -35
- package/src/core/beacon/aggregation/cohort/messages/keygen/opt-in.ts +0 -34
- package/src/core/beacon/aggregation/cohort/messages/keygen/subscribe.ts +0 -36
- package/src/core/beacon/aggregation/cohort/messages/sign/aggregated-nonce.ts +0 -39
- package/src/core/beacon/aggregation/cohort/messages/sign/authorization-request.ts +0 -40
- package/src/core/beacon/aggregation/cohort/messages/sign/nonce-contribution.ts +0 -40
- package/src/core/beacon/aggregation/cohort/messages/sign/request-signature.ts +0 -40
- package/src/core/beacon/aggregation/cohort/messages/sign/signature-authorization.ts +0 -41
- package/src/core/beacon/aggregation/cohort/status.ts +0 -7
- package/src/core/beacon/aggregation/communication/adapter/did-comm.ts +0 -148
- package/src/core/beacon/aggregation/communication/adapter/nostr.ts +0 -323
- package/src/core/beacon/aggregation/communication/error.ts +0 -13
- package/src/core/beacon/aggregation/communication/factory.ts +0 -25
- package/src/core/beacon/aggregation/communication/service.ts +0 -42
- package/src/core/beacon/aggregation/coordinator.ts +0 -419
- package/src/core/beacon/aggregation/participant.ts +0 -517
- package/src/core/beacon/aggregation/session/index.ts +0 -301
- package/src/core/beacon/aggregation/session/status.ts +0 -18
- package/src/core/update.ts +0 -158
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator.js","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/coordinator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAChC,oBAAoB,EACpB,+BAA+B,EAC/B,qCAAqC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAE3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,kCAAkC,EAAE,MAAM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AAC,GAAG;YACtB,IAAI,EAAO,OAAO,CAAC,IAAI;SACxB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,qBAAqB,WAAW,CAAC,IAAI,yBAAyB,WAAW,CAAC,GAAG,uCAAuC,CAAC,CAAC;QACnI,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,435 +0,0 @@
|
|
|
1
|
-
import { bytesToHex } from '@noble/hashes/utils';
|
|
2
|
-
import { HDKey } from '@scure/bip32';
|
|
3
|
-
import { mnemonicToSeedSync } from '@scure/bip39';
|
|
4
|
-
import * as musig2 from '@scure/btc-signer/musig2';
|
|
5
|
-
import { Transaction } from 'bitcoinjs-lib';
|
|
6
|
-
import { BeaconParticipantError } from '../error.js';
|
|
7
|
-
import { AggregateBeaconCohort } from './cohort/index.js';
|
|
8
|
-
import { BEACON_COHORT_ADVERT, BEACON_COHORT_AGGREGATED_NONCE, BEACON_COHORT_AUTHORIZATION_REQUEST, BEACON_COHORT_OPT_IN_ACCEPT, BEACON_COHORT_READY } from './cohort/messages/constants.js';
|
|
9
|
-
import { BeaconCohortAdvertMessage } from './cohort/messages/keygen/cohort-advert.js';
|
|
10
|
-
import { BeaconCohortReadyMessage } from './cohort/messages/keygen/cohort-ready.js';
|
|
11
|
-
import { BeaconCohortOptInAcceptMessage } from './cohort/messages/keygen/opt-in-accept.js';
|
|
12
|
-
import { BeaconCohortOptInMessage } from './cohort/messages/keygen/opt-in.js';
|
|
13
|
-
import { BeaconCohortSubscribeMessage } from './cohort/messages/keygen/subscribe.js';
|
|
14
|
-
import { BeaconCohortAggregatedNonceMessage } from './cohort/messages/sign/aggregated-nonce.js';
|
|
15
|
-
import { BeaconCohortAuthorizationRequestMessage } from './cohort/messages/sign/authorization-request.js';
|
|
16
|
-
import { BeaconCohortNonceContributionMessage } from './cohort/messages/sign/nonce-contribution.js';
|
|
17
|
-
import { BeaconCohortRequestSignatureMessage } from './cohort/messages/sign/request-signature.js';
|
|
18
|
-
import { BeaconCohortSignatureAuthorizationMessage } from './cohort/messages/sign/signature-authorization.js';
|
|
19
|
-
import { COHORT_STATUS } from './cohort/status.js';
|
|
20
|
-
import { NostrAdapter } from './communication/adapter/nostr.js';
|
|
21
|
-
import { BeaconCohortSigningSession } from './session/index.js';
|
|
22
|
-
/**
|
|
23
|
-
* Represents a participant in the did:btc1 Beacon Aggregation protocol.
|
|
24
|
-
* @class BeaconParticipant
|
|
25
|
-
* @type {BeaconParticipant}
|
|
26
|
-
*/
|
|
27
|
-
export class BeaconParticipant {
|
|
28
|
-
/**
|
|
29
|
-
* The name of the BeaconParticipant service.
|
|
30
|
-
* @type {string}
|
|
31
|
-
*/
|
|
32
|
-
name;
|
|
33
|
-
/**
|
|
34
|
-
* The DID of the BeaconParticipant.
|
|
35
|
-
* @type {Array<string>}
|
|
36
|
-
*/
|
|
37
|
-
did;
|
|
38
|
-
/**
|
|
39
|
-
* The communication protocol used by the BeaconParticipant.
|
|
40
|
-
* @type {CommunicationService}
|
|
41
|
-
*/
|
|
42
|
-
protocol;
|
|
43
|
-
/**
|
|
44
|
-
* The HD key used by the BeaconParticipant.
|
|
45
|
-
* @type {HDKey}
|
|
46
|
-
*/
|
|
47
|
-
hdKey;
|
|
48
|
-
/**
|
|
49
|
-
* The current index for the beacon key.
|
|
50
|
-
* @type {number}
|
|
51
|
-
*/
|
|
52
|
-
beaconKeyIndex = 0;
|
|
53
|
-
/**
|
|
54
|
-
* The coordinator DIDs that the participant is subscribed to.
|
|
55
|
-
* @type {Array<string>}
|
|
56
|
-
*/
|
|
57
|
-
coordinatorDids = new Array();
|
|
58
|
-
/**
|
|
59
|
-
* The cohorts that the participant is part of.
|
|
60
|
-
* @type {Array<AggregateBeaconCohort>}
|
|
61
|
-
*/
|
|
62
|
-
cohorts = new Array();
|
|
63
|
-
/**
|
|
64
|
-
* A mapping of Cohort IDs to HDKey indexes (CohortId => KeyIndex).
|
|
65
|
-
* @type {CohortKeyState}
|
|
66
|
-
*/
|
|
67
|
-
cohortKeyState = new Map();
|
|
68
|
-
/**
|
|
69
|
-
* A mapping of active Session IDs to their sessions (sessionId => BeaconCohortSigningSession).
|
|
70
|
-
* @type {ActiveSigningSessions}
|
|
71
|
-
*/
|
|
72
|
-
activeSigningSessions = new Map();
|
|
73
|
-
/**
|
|
74
|
-
* Creates an instance of BeaconParticipant.
|
|
75
|
-
* @param {BeaconParticipantParams} params The parameters for the participant.
|
|
76
|
-
* @param {Seed | Mnemonic} params.ent The seed or mnemonic to derive the HD key.
|
|
77
|
-
* @param {CommunicationService} params.protocol The communication protocol to use.
|
|
78
|
-
* @param {string} params.did The DID of the participant.
|
|
79
|
-
* @param {string} [params.name] Optional name for the participant. If not provided, a random name will be generated.
|
|
80
|
-
*/
|
|
81
|
-
constructor({ ent, protocol, did, name }) {
|
|
82
|
-
this.did = did;
|
|
83
|
-
this.name = name || `btcr2-beacon-participant-${crypto.randomUUID()}`;
|
|
84
|
-
this.beaconKeyIndex = this.cohortKeyState.size;
|
|
85
|
-
this.hdKey = ent instanceof Uint8Array
|
|
86
|
-
? HDKey.fromMasterSeed(ent)
|
|
87
|
-
: HDKey.fromMasterSeed(mnemonicToSeedSync(ent));
|
|
88
|
-
const { publicKey: pk, privateKey: secret } = this.hdKey.deriveChild(this.beaconKeyIndex);
|
|
89
|
-
if (!pk || !secret) {
|
|
90
|
-
throw new BeaconParticipantError(`Failed to derive HD key for participant ${this.name} at index ${this.beaconKeyIndex}`, 'CONSTRUCTOR_ERROR', { public: pk, secret });
|
|
91
|
-
}
|
|
92
|
-
this.protocol = protocol || new NostrAdapter();
|
|
93
|
-
this.protocol.setKeys({ public: pk, secret });
|
|
94
|
-
this.cohortKeyState.set('__UNSET__', this.beaconKeyIndex);
|
|
95
|
-
console.debug(`BeaconParticipant initialized with DID: ${this.did}, Name: ${this.name}, Key Index: ${this.beaconKeyIndex}`);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Setup and start the BeaconParticipant communication protocol..
|
|
99
|
-
* @returns {void}
|
|
100
|
-
*/
|
|
101
|
-
start() {
|
|
102
|
-
console.info(`Setting up BeaconParticipant ${this.name} (${this.did}) on ${this.protocol.name} ...`);
|
|
103
|
-
this.protocol.registerMessageHandler(BEACON_COHORT_ADVERT, this._handleCohortAdvert.bind(this));
|
|
104
|
-
this.protocol.registerMessageHandler(BEACON_COHORT_OPT_IN_ACCEPT, this._handleSubscribeAccept.bind(this));
|
|
105
|
-
this.protocol.registerMessageHandler(BEACON_COHORT_READY, this._handleCohortReady.bind(this));
|
|
106
|
-
this.protocol.registerMessageHandler(BEACON_COHORT_AUTHORIZATION_REQUEST, this._handleAuthorizationRequest.bind(this));
|
|
107
|
-
this.protocol.registerMessageHandler(BEACON_COHORT_AGGREGATED_NONCE, this._handleAggregatedNonce.bind(this));
|
|
108
|
-
this.protocol.start();
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Retrieves the HD key for a specific cohort based on its ID.
|
|
112
|
-
* @param {string} cohortId The ID of the cohort for which to retrieve the key.
|
|
113
|
-
* @returns {HDKey} The HD key for the cohort, or throws an error if not found.
|
|
114
|
-
* @throws {BeaconParticipantError} If the cohort key state is not found for the given cohort ID.
|
|
115
|
-
*/
|
|
116
|
-
getCohortKey(cohortId) {
|
|
117
|
-
const keyIndex = this.cohortKeyState.get(cohortId);
|
|
118
|
-
if (keyIndex === undefined) {
|
|
119
|
-
throw new BeaconParticipantError(`Cohort key state for cohort ${cohortId} not found.`, 'COHORT_KEY_NOT_FOUND');
|
|
120
|
-
}
|
|
121
|
-
return this.hdKey.deriveChild(keyIndex);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Sets the state of the cohort key for a given cohort ID and key index.
|
|
125
|
-
* @param {string} cohortId The ID of the cohort for which to set the key state.
|
|
126
|
-
* @returns {void}
|
|
127
|
-
*/
|
|
128
|
-
setCohortKey(cohortId) {
|
|
129
|
-
if (this.cohortKeyState.size > 0) {
|
|
130
|
-
this.beaconKeyIndex = this.cohortKeyState.size + 1;
|
|
131
|
-
}
|
|
132
|
-
if (this.cohortKeyState.has(cohortId)) {
|
|
133
|
-
console.warn(`Cohort key state for cohort ${cohortId} already exists. Updating key index.`);
|
|
134
|
-
}
|
|
135
|
-
this.cohortKeyState.set(cohortId, this.beaconKeyIndex);
|
|
136
|
-
console.info(`Cohort key state updated. Next beacon key index: ${this.beaconKeyIndex + 1}`);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Finalizes the placeholder "__UNSET__" key and assigns it to the provided cohortId.
|
|
140
|
-
* If no "__UNSET__" entry exists, throws an error.
|
|
141
|
-
* If cohortId already exists, logs a warning and does nothing.
|
|
142
|
-
* @param {string} cohortId The ID of the cohort to finalize the unset key for.
|
|
143
|
-
* @throws {BeaconParticipantError} If no "__UNSET__" cohort key state is found.
|
|
144
|
-
* @returns {void}
|
|
145
|
-
*/
|
|
146
|
-
finalizeUnsetCohortKey(cohortId) {
|
|
147
|
-
const unsetKey = '__UNSET__';
|
|
148
|
-
if (!this.cohortKeyState.has(unsetKey)) {
|
|
149
|
-
throw new BeaconParticipantError(`No '__UNSET__' cohort key to finalize for ${this.did}`, 'UNSET_KEY_NOT_FOUND');
|
|
150
|
-
}
|
|
151
|
-
if (this.cohortKeyState.has(cohortId)) {
|
|
152
|
-
console.warn(`Cohort key state already exists for ${cohortId}. Skipping migration from '__UNSET__'.`);
|
|
153
|
-
this.cohortKeyState.delete(unsetKey);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
this.setCohortKey(cohortId);
|
|
157
|
-
this.cohortKeyState.delete(unsetKey);
|
|
158
|
-
console.info(`Finalized '__UNSET__' CohortKeyState with ${cohortId} for ${this.did}`);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Handle subscription acceptance from a coordinator.
|
|
162
|
-
* @param {CohortOptInAcceptMessage} message The message containing the subscription acceptance.
|
|
163
|
-
* @returns {Promise<void>}
|
|
164
|
-
*/
|
|
165
|
-
async _handleSubscribeAccept(message) {
|
|
166
|
-
const subscribeAcceptMessage = BeaconCohortOptInAcceptMessage.fromJSON(message);
|
|
167
|
-
const coordinatorDid = subscribeAcceptMessage.from;
|
|
168
|
-
if (!this.coordinatorDids.includes(coordinatorDid)) {
|
|
169
|
-
this.coordinatorDids.push(coordinatorDid);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Handles a cohort advertisement message.
|
|
174
|
-
* @param {Maybe<BeaconCohortAdvertMessage>} message The cohort advertisement message.
|
|
175
|
-
* @returns {Promise<void>}
|
|
176
|
-
*/
|
|
177
|
-
async _handleCohortAdvert(message) {
|
|
178
|
-
console.debug('_handleCohortAdvert', message);
|
|
179
|
-
const cohortAdvertMessage = BeaconCohortAdvertMessage.fromJSON(message);
|
|
180
|
-
console.info(`Received new cohort announcement from ${cohortAdvertMessage.from}`, cohortAdvertMessage);
|
|
181
|
-
const cohortId = cohortAdvertMessage.body?.cohortId;
|
|
182
|
-
if (!cohortId) {
|
|
183
|
-
console.warn('Received malformed cohort advert message: missing cohortId', cohortAdvertMessage);
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const network = cohortAdvertMessage.body?.network;
|
|
187
|
-
if (!network) {
|
|
188
|
-
console.warn('Received malformed cohort advert message: missing network', cohortAdvertMessage);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
const minParticipants = cohortAdvertMessage.body?.cohortSize;
|
|
192
|
-
if (!cohortId || !network || !minParticipants) {
|
|
193
|
-
console.warn('Received malformed cohort advert message: missing minParticipants', cohortAdvertMessage);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const from = cohortAdvertMessage.from;
|
|
197
|
-
const cohort = new AggregateBeaconCohort({
|
|
198
|
-
network,
|
|
199
|
-
minParticipants,
|
|
200
|
-
id: cohortId,
|
|
201
|
-
coordinatorDid: from,
|
|
202
|
-
});
|
|
203
|
-
this.cohorts.push(cohort);
|
|
204
|
-
await this.joinCohort(cohort.id, from);
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Handles a cohort set message.
|
|
208
|
-
* @param {Maybe<CohortReadyMessage>} message The cohort set message.
|
|
209
|
-
* @returns {Promise<void>}
|
|
210
|
-
*/
|
|
211
|
-
async _handleCohortReady(message) {
|
|
212
|
-
const cohortSetMessage = BeaconCohortReadyMessage.fromJSON(message);
|
|
213
|
-
const cohortId = cohortSetMessage.body?.cohortId;
|
|
214
|
-
const cohort = this.cohorts.find(c => c.id === cohortId);
|
|
215
|
-
if (!cohortId || !cohort) {
|
|
216
|
-
console.warn(`Cohort with ID ${cohortId} not found or not joined by participant ${this.did}.`);
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
this.finalizeUnsetCohortKey(cohortId);
|
|
220
|
-
const participantPkBytes = this.getCohortKey(cohortId).publicKey;
|
|
221
|
-
if (!participantPkBytes) {
|
|
222
|
-
console.error(`Failed to derive public key for cohort ${cohortId}`);
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
const participantPk = bytesToHex(participantPkBytes);
|
|
226
|
-
const beaconAddress = cohortSetMessage.body?.beaconAddress;
|
|
227
|
-
if (!beaconAddress) {
|
|
228
|
-
console.error(`Beacon address not provided in cohort set message for ${cohortId}`);
|
|
229
|
-
return;
|
|
230
|
-
}
|
|
231
|
-
const cohortKeys = cohortSetMessage.body?.cohortKeys;
|
|
232
|
-
if (!cohortKeys) {
|
|
233
|
-
console.error(`Cohort keys not provided in cohort set message for ${cohortId}`);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
const keys = cohortKeys.map(key => bytesToHex(new Uint8Array(key)));
|
|
237
|
-
cohort.validateCohort([participantPk], keys, beaconAddress);
|
|
238
|
-
console.info(`BeaconParticipant w/ pk ${participantPk} successfully joined cohort ${cohortId} with beacon address ${beaconAddress}.`);
|
|
239
|
-
console.info(`Cohort status: ${cohort.status}`);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Handles an authorization request message.
|
|
243
|
-
* @param {Maybe<CohortAuthorizationRequestMessage>} message The authorization request message.
|
|
244
|
-
* @returns {Promise<void>}
|
|
245
|
-
*/
|
|
246
|
-
async _handleAuthorizationRequest(message) {
|
|
247
|
-
const authRequest = BeaconCohortAuthorizationRequestMessage.fromJSON(message);
|
|
248
|
-
const cohort = this.cohorts.find(c => c.id === authRequest.body?.cohortId);
|
|
249
|
-
if (!cohort) {
|
|
250
|
-
console.warn(`Authorization request for unknown cohort ${authRequest.body?.cohortId} from ${authRequest.from}`);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
const id = authRequest.body?.sessionId;
|
|
254
|
-
if (!id) {
|
|
255
|
-
console.warn(`Authorization request missing session ID from ${authRequest.from}`);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const pendingTx = authRequest.body?.pendingTx;
|
|
259
|
-
if (!pendingTx) {
|
|
260
|
-
console.warn(`Authorization request missing pending transaction from ${authRequest.from}`);
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
const session = new BeaconCohortSigningSession({
|
|
264
|
-
cohort,
|
|
265
|
-
id,
|
|
266
|
-
pendingTx: Transaction.fromHex(pendingTx),
|
|
267
|
-
});
|
|
268
|
-
this.activeSigningSessions.set(session.id, session);
|
|
269
|
-
const nonceContribution = this.generateNonceContribution(cohort, session);
|
|
270
|
-
await this.sendNonceContribution(cohort, nonceContribution, session);
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Handles an aggregated nonce message.
|
|
274
|
-
* @param {Maybe<CohortAggregatedNonceMessage>} message The aggregated nonce message.
|
|
275
|
-
* @returns {Promise<void>}
|
|
276
|
-
*/
|
|
277
|
-
async _handleAggregatedNonce(message) {
|
|
278
|
-
const aggNonceMessage = BeaconCohortAggregatedNonceMessage.fromJSON(message);
|
|
279
|
-
const sessionId = aggNonceMessage.body?.sessionId;
|
|
280
|
-
if (!sessionId) {
|
|
281
|
-
console.warn(`Aggregated nonce message missing session ID from ${aggNonceMessage.from}`);
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const session = this.activeSigningSessions.get(sessionId);
|
|
285
|
-
if (!session) {
|
|
286
|
-
console.warn(`Aggregated nonce message received for unknown session ${sessionId}`);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
const aggregatedNonce = aggNonceMessage.body?.aggregatedNonce;
|
|
290
|
-
if (!aggregatedNonce) {
|
|
291
|
-
console.warn(`Aggregated nonce message missing aggregated nonce from ${aggNonceMessage.from}`);
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
session.aggregatedNonce = aggregatedNonce;
|
|
295
|
-
const participantSk = this.getCohortKey(session.cohort.id).privateKey;
|
|
296
|
-
if (!participantSk) {
|
|
297
|
-
console.error(`Failed to derive secret key for cohort ${session.cohort.id}`);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
const partialSig = session.generatePartialSignature(participantSk);
|
|
301
|
-
await this.sendPartialSignature(session, partialSig);
|
|
302
|
-
}
|
|
303
|
-
;
|
|
304
|
-
/**
|
|
305
|
-
* Subscribes to a coordinator's messages.
|
|
306
|
-
* @param {string} coordinatorDid The DID of the coordinator to subscribe to.
|
|
307
|
-
* @returns {Promise<void>}
|
|
308
|
-
*/
|
|
309
|
-
async subscribeToCoordinator(coordinatorDid) {
|
|
310
|
-
if (this.coordinatorDids.includes(coordinatorDid)) {
|
|
311
|
-
console.info(`Already subscribed to coordinator ${coordinatorDid}`);
|
|
312
|
-
return;
|
|
313
|
-
}
|
|
314
|
-
const subMessage = new BeaconCohortSubscribeMessage({ to: coordinatorDid, from: this.did });
|
|
315
|
-
return await this.protocol.sendMessage(subMessage, this.did, coordinatorDid);
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* Joins a cohort with the given ID and coordinator DID.
|
|
319
|
-
* @param {string} cohortId The ID of the cohort to join.
|
|
320
|
-
* @param {string} coordinatorDid The DID of the cohort coordinator.
|
|
321
|
-
* @returns {Promise<void>}
|
|
322
|
-
*/
|
|
323
|
-
async joinCohort(cohortId, coordinatorDid) {
|
|
324
|
-
console.info(`BeaconParticipant ${this.did} joining cohort ${cohortId} with coordinator ${coordinatorDid}`);
|
|
325
|
-
this.finalizeUnsetCohortKey(cohortId);
|
|
326
|
-
const cohort = this.cohorts.find(c => c.id === cohortId);
|
|
327
|
-
if (!cohort) {
|
|
328
|
-
console.warn(`Cohort with ID ${cohortId} not found.`);
|
|
329
|
-
return;
|
|
330
|
-
}
|
|
331
|
-
const pk = this.getCohortKey(cohortId).publicKey;
|
|
332
|
-
if (!pk) {
|
|
333
|
-
console.error(`Failed to derive public key for cohort ${cohortId} at index ${this.beaconKeyIndex}`);
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
this.setCohortKey(cohortId);
|
|
337
|
-
const optInMessage = new BeaconCohortOptInMessage({
|
|
338
|
-
cohortId,
|
|
339
|
-
participantPk: pk,
|
|
340
|
-
from: this.did,
|
|
341
|
-
to: coordinatorDid,
|
|
342
|
-
});
|
|
343
|
-
await this.protocol.sendMessage(optInMessage, this.did, coordinatorDid);
|
|
344
|
-
cohort.status = COHORT_STATUS.COHORT_OPTED_IN;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Requests a signature for the given cohort and data.
|
|
348
|
-
* @param {string} cohortId The ID of the cohort for which to request a signature.
|
|
349
|
-
* @param {string} data The data for which to request a signature.
|
|
350
|
-
* @returns {Promise<boolean>} Whether the signature request was successful.
|
|
351
|
-
*/
|
|
352
|
-
async requestCohortSignature(cohortId, data) {
|
|
353
|
-
const cohort = this.cohorts.find(c => c.id === cohortId);
|
|
354
|
-
if (!cohort) {
|
|
355
|
-
console.warn(`Cohort with ID ${cohortId} not found.`);
|
|
356
|
-
return false;
|
|
357
|
-
}
|
|
358
|
-
if (cohort.status !== COHORT_STATUS.COHORT_SET_STATUS) {
|
|
359
|
-
console.warn(`Cohort ${cohortId} not in a set state. Current status: ${cohort.status}`);
|
|
360
|
-
return false;
|
|
361
|
-
}
|
|
362
|
-
const reqSigMessage = new BeaconCohortRequestSignatureMessage({
|
|
363
|
-
to: cohort.coordinatorDid,
|
|
364
|
-
from: this.did,
|
|
365
|
-
data,
|
|
366
|
-
cohortId
|
|
367
|
-
});
|
|
368
|
-
await this.protocol.sendMessage(reqSigMessage, this.did, cohort.coordinatorDid);
|
|
369
|
-
return true;
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* Generates a nonce contribution for the given cohort and session.
|
|
373
|
-
* @param {AggregateBeaconCohort} cohort The cohort for which to generate the nonce contribution.
|
|
374
|
-
* @param {BeaconCohortSigningSession} session The session for which to generate the nonce contribution.
|
|
375
|
-
* @returns {Promise<string[]>} An array of nonce points in hexadecimal format.
|
|
376
|
-
*/
|
|
377
|
-
generateNonceContribution(cohort, session) {
|
|
378
|
-
const cohortKey = this.getCohortKey(cohort.id);
|
|
379
|
-
if (!cohortKey) {
|
|
380
|
-
throw new BeaconParticipantError(`Cohort key state not found for cohort ${cohort.id}`, 'COHORT_KEY_NOT_FOUND', cohortKey);
|
|
381
|
-
}
|
|
382
|
-
const { publicKey, privateKey } = cohortKey;
|
|
383
|
-
if (!publicKey || !privateKey) {
|
|
384
|
-
throw new BeaconParticipantError(`Failed to derive public key for cohort ${cohort.id}`, 'PARTICIPANT_PK_NOT_FOUND', cohortKey);
|
|
385
|
-
}
|
|
386
|
-
session.aggregatedNonce ??= session.generateAggregatedNonce();
|
|
387
|
-
return musig2.nonceGen(publicKey, privateKey, session.aggregatedNonce, cohort.trMerkleRoot).public;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Sends a nonce contribution message to the cohort coordinator.
|
|
391
|
-
* @param {AggregateBeaconCohort} cohort The cohort to which the nonce contribution is sent.
|
|
392
|
-
* @param {Uint8Array} nonceContribution The nonce contribution points in hexadecimal format.
|
|
393
|
-
* @param {BeaconCohortSigningSession} session The session associated with the nonce contribution.
|
|
394
|
-
*/
|
|
395
|
-
async sendNonceContribution(cohort, nonceContribution, session) {
|
|
396
|
-
const nonceContributionMessage = BeaconCohortNonceContributionMessage.fromJSON({
|
|
397
|
-
to: cohort.coordinatorDid,
|
|
398
|
-
from: this.did,
|
|
399
|
-
sessionId: session.id,
|
|
400
|
-
cohortId: cohort.id,
|
|
401
|
-
nonceContribution
|
|
402
|
-
});
|
|
403
|
-
await this.protocol.sendMessage(nonceContributionMessage, this.did, cohort.coordinatorDid);
|
|
404
|
-
console.info(`Nonce contribution sent for session ${session.id} in cohort ${cohort.id} by participant ${this.did}`);
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Sends a partial signature for the given session.
|
|
408
|
-
* @param {BeaconCohortSigningSession} session The session for which the partial signature is sent.
|
|
409
|
-
* @param {Uint8Array} partialSig The partial signature to send.
|
|
410
|
-
* @returns {Promise<void>}
|
|
411
|
-
*/
|
|
412
|
-
async sendPartialSignature(session, partialSig) {
|
|
413
|
-
const sigAuthMessage = new BeaconCohortSignatureAuthorizationMessage({
|
|
414
|
-
to: session.cohort.coordinatorDid,
|
|
415
|
-
from: this.did,
|
|
416
|
-
cohortId: session.cohort.id,
|
|
417
|
-
sessionId: session.id,
|
|
418
|
-
partialSignature: partialSig,
|
|
419
|
-
});
|
|
420
|
-
await this.protocol.sendMessage(sigAuthMessage, this.did, session.cohort.coordinatorDid);
|
|
421
|
-
console.info(`Partial signature sent for session ${session.id} in cohort ${session.cohort.id} by participant ${this.did}`);
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Initializes a new BeaconParticipant instance.
|
|
425
|
-
* @param {Seed | Mnemonic} ent The secret key used for signing.
|
|
426
|
-
* @param {CommunicationService} protocol The communication protocol used by the participant.
|
|
427
|
-
* @param {string} [name] The name of the participant.
|
|
428
|
-
* @param {string} [did] The decentralized identifier (DID) of the participant.
|
|
429
|
-
* @returns {BeaconParticipant} A new instance of BeaconParticipant.
|
|
430
|
-
*/
|
|
431
|
-
static initialize(ent, protocol, did, name) {
|
|
432
|
-
return new BeaconParticipant({ ent, protocol, name, did });
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
//# sourceMappingURL=participant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"participant.js","sourceRoot":"","sources":["../../../../../src/core/beacon/aggregation/participant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,mCAAmC,EACnC,2BAA2B,EAC3B,mBAAmB,EACpB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAEtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAErF,OAAO,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAEhG,OAAO,EAAE,uCAAuC,EAAE,MAAM,iDAAiD,CAAC;AAC1G,OAAO,EAAE,oCAAoC,EAAE,MAAM,8CAA8C,CAAC;AACpG,OAAO,EAAE,mCAAmC,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,yCAAyC,EAAE,MAAM,mDAAmD,CAAC;AAC9G,O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