Class: BeaconParticipant ​
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:51
Represents a participant in the did:btc1 Beacon Aggregation protocol. BeaconParticipant
Constructors ​
Constructor ​
new BeaconParticipant(
params):BeaconParticipant
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:114
Creates an instance of BeaconParticipant.
Parameters ​
params ​
BeaconParticipantParams
The parameters for the participant.
Returns ​
BeaconParticipant
Properties ​
activeSigningSessions ​
activeSigningSessions:
ActiveSigningSessions
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:104
A mapping of active Session IDs to their sessions (sessionId => BeaconCohortSigningSession).
beaconKeyIndex ​
beaconKeyIndex:
number=0
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:80
The current index for the beacon key.
cohortKeyState ​
cohortKeyState:
CohortKeyState
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:98
A mapping of Cohort IDs to HDKey indexes (CohortId => KeyIndex).
cohorts ​
cohorts:
AggregateBeaconCohort[]
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:92
The cohorts that the participant is part of.
coordinatorDids ​
coordinatorDids:
string[]
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:86
The coordinator DIDs that the participant is subscribed to.
did ​
did:
string
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:62
The DID of the BeaconParticipant.
hdKey ​
hdKey:
HDKey
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:74
The HD key used by the BeaconParticipant.
name ​
name:
string
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:56
The name of the BeaconParticipant service.
protocol ​
protocol:
CommunicationService
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:68
The communication protocol used by the BeaconParticipant.
Methods ​
_handleAggregatedNonce() ​
_handleAggregatedNonce(
message):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:336
Handles an aggregated nonce message.
Parameters ​
message ​
any
The aggregated nonce message.
Returns ​
Promise<void>
_handleAuthorizationRequest() ​
_handleAuthorizationRequest(
message):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:304
Handles an authorization request message.
Parameters ​
message ​
any
The authorization request message.
Returns ​
Promise<void>
_handleCohortAdvert() ​
_handleCohortAdvert(
message):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:228
Handles a cohort advertisement message.
Parameters ​
message ​
any
The cohort advertisement message.
Returns ​
Promise<void>
_handleCohortReady() ​
_handleCohortReady(
message):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:269
Handles a cohort set message.
Parameters ​
message ​
any
The cohort set message.
Returns ​
Promise<void>
finalizeUnsetCohortKey() ​
finalizeUnsetCohortKey(
cohortId):void
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:188
Finalizes the placeholder "UNSET" key and assigns it to the provided cohortId. If no "UNSET" entry exists, throws an error. If cohortId already exists, logs a warning and does nothing.
Parameters ​
cohortId ​
string
The ID of the cohort to finalize the unset key for.
Returns ​
void
Throws ​
If no "UNSET" cohort key state is found.
generateNonceContribution() ​
generateNonceContribution(
cohort,session):Uint8Array
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:440
Generates a nonce contribution for the given cohort and session.
Parameters ​
cohort ​
The cohort for which to generate the nonce contribution.
session ​
The session for which to generate the nonce contribution.
Returns ​
Uint8Array
An array of nonce points in hexadecimal format.
getCohortKey() ​
getCohortKey(
cohortId):HDKey
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:156
Retrieves the HD key for a specific cohort based on its ID.
Parameters ​
cohortId ​
string
The ID of the cohort for which to retrieve the key.
Returns ​
HDKey
The HD key for the cohort, or throws an error if not found.
Throws ​
If the cohort key state is not found for the given cohort ID.
joinCohort() ​
joinCohort(
cohortId,coordinatorDid):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:383
Joins a cohort with the given ID and coordinator DID.
Parameters ​
cohortId ​
string
The ID of the cohort to join.
coordinatorDid ​
string
The DID of the cohort coordinator.
Returns ​
Promise<void>
requestCohortSignature() ​
requestCohortSignature(
cohortId,data):Promise<boolean>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:414
Requests a signature for the given cohort and data.
Parameters ​
cohortId ​
string
The ID of the cohort for which to request a signature.
data ​
string
The data for which to request a signature.
Returns ​
Promise<boolean>
Whether the signature request was successful.
sendNonceContribution() ​
sendNonceContribution(
cohort,nonceContribution,session):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:465
Sends a nonce contribution message to the cohort coordinator.
Parameters ​
cohort ​
The cohort to which the nonce contribution is sent.
nonceContribution ​
Uint8Array
The nonce contribution points in hexadecimal format.
session ​
The session associated with the nonce contribution.
Returns ​
Promise<void>
sendPartialSignature() ​
sendPartialSignature(
session,partialSig):Promise<void>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:489
Sends a partial signature for the given session.
Parameters ​
session ​
The session for which the partial signature is sent.
partialSig ​
Uint8Array
The partial signature to send.
Returns ​
Promise<void>
setCohortKey() ​
setCohortKey(
cohortId):void
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:169
Sets the state of the cohort key for a given cohort ID and key index.
Parameters ​
cohortId ​
string
The ID of the cohort for which to set the key state.
Returns ​
void
start() ​
start():
void
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:140
Setup and start the BeaconParticipant communication protocol..
Returns ​
void
subscribeToCoordinator() ​
subscribeToCoordinator(
coordinatorDid):Promise<any>
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:368
Subscribes to a coordinator's messages.
Parameters ​
coordinatorDid ​
string
The DID of the coordinator to subscribe to.
Returns ​
Promise<any>
initialize() ​
staticinitialize(ent,protocol,did?,name?):BeaconParticipant
Defined in: packages/method/src/core/beacon/aggregation/participant.ts:509
Initializes a new BeaconParticipant instance.
Parameters ​
ent ​
The secret key used for signing.
string | Bytes
protocol ​
The communication protocol used by the participant.
did? ​
string
The decentralized identifier (DID) of the participant.
name? ​
string
The name of the participant.
Returns ​
BeaconParticipant
A new instance of BeaconParticipant.