import { BytearrayWrapper } from './bytearray-wrapper'; import { PublicKeyBase } from './types'; import { BBSPlusSignatureParamsG1 } from './bbs-plus'; import { BBSSignatureParams } from './bbs'; import { ThresholdPublicKey } from './threshold-sigs'; /** * Message to be sent in round 1 */ export declare class Round1Msg extends BytearrayWrapper { } /** * Share to be sent in round 2 */ export declare class Share extends BytearrayWrapper { } /** * Participant in the FROST DKG mentioned in Figure 1 of the paper https://eprint.iacr.org/2020/852.pdf * Each participant has a unique integer id > 0 and ids form a contiguous set, i.e. no gaps. Protocol has 2 rounds and * in each round each participant sends message to others */ export declare abstract class FrostDkgParticipant { /** Id of this participant */ readonly id: number; readonly threshold: number; readonly total: number; /** Id of this execution of the DKG. Use different ids in different protocol executions. */ readonly protocolId: Uint8Array; /** Message to be sent in round 1 */ round1Msg?: Round1Msg; /** Shares to be sent in round 2 */ shares?: Share[]; /** Count of messages received from others in round 1 */ receivedFromInRound1Count?: number; /** Sender ids who sent message in round 2 */ receivedFromInRound2?: Set; /** The secret key of the participant */ secretKey?: Uint8Array; /** The public key of the participant */ publicKey?: Uint8Array; /** The threshold public key and all participants will have the same public key */ thresholdPublicKey?: Uint8Array; private round1State?; private round2State?; constructor(id: number, threshold: number, total: number, protocolId: Uint8Array); /** * Returns the message to be broadcast to all others * @param pkBase */ startRound1(pkBase: PublicKeyBase): Round1Msg; processReceivedMessageInRound1(msg: Round1Msg, pkBase: PublicKeyBase): void; finishRound1(unchecked?: boolean): Share[]; processReceivedSharesInRound2(senderId: number, share: Share, pkBase: PublicKeyBase): void; /** * Returns the secret key, public key and the threshold key * @param pkBase * @param unchecked */ finishRound2(pkBase: PublicKeyBase, unchecked?: boolean): [Uint8Array, Uint8Array, Uint8Array]; generateThresholdPublicKeyFromPublicKeys(pubkeys: [number, Uint8Array][]): ThresholdPublicKey; hasStarted(): boolean; hasFinishedRound1(): boolean; hasFinishedRound2(): boolean; hasThresholdParticipatedInRound1(): boolean; haveAllParticipatedInRound1(): boolean; hasThresholdParticipatedInRound2(): boolean; haveAllParticipatedInRound2(): boolean; protected abstract startRound1Func(): (participantId: number, threshold: number, total: number, protocolId: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array]; protected abstract processRound1MsgFunc(): (roundState: Uint8Array, msg: Uint8Array, protocolId: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected abstract finishRound1Func(): (roundState: Uint8Array) => [Uint8Array, Uint8Array[]]; protected abstract processRound2MsgFunc(): (roundState: Uint8Array, senderId: number, share: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected abstract finishRound2Func(): (roundState: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array, Uint8Array]; protected abstract thresholdPublicKeyFromPublicKeysFunc(): (pubkeys: [number, Uint8Array][], threshold: number) => Uint8Array; } /** * Participant when the public key is in group G1 */ export declare class FrostDkgParticipantG1 extends FrostDkgParticipant { protected startRound1Func(): (participantId: number, threshold: number, total: number, protocolId: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array]; protected processRound1MsgFunc(): (roundState: Uint8Array, msg: Uint8Array, protocolId: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected finishRound1Func(): (roundState: Uint8Array) => [Uint8Array, Uint8Array[]]; protected processRound2MsgFunc(): (roundState: Uint8Array, senderId: number, share: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected finishRound2Func(): (roundState: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array, Uint8Array]; protected thresholdPublicKeyFromPublicKeysFunc(): (pubkeys: [number, Uint8Array][], threshold: number) => Uint8Array; } /** * Participant when the public key is in group G2 */ export declare class FrostDkgParticipantG2 extends FrostDkgParticipant { protected startRound1Func(): (participantId: number, threshold: number, total: number, protocolId: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array]; protected processRound1MsgFunc(): (roundState: Uint8Array, msg: Uint8Array, protocolId: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected finishRound1Func(): (roundState: Uint8Array) => [Uint8Array, Uint8Array[]]; protected processRound2MsgFunc(): (roundState: Uint8Array, senderId: number, share: Uint8Array, pkBase: Uint8Array) => Uint8Array; protected finishRound2Func(): (roundState: Uint8Array, pkBase: Uint8Array) => [Uint8Array, Uint8Array, Uint8Array]; protected thresholdPublicKeyFromPublicKeysFunc(): (pubkeys: [number, Uint8Array][], threshold: number) => Uint8Array; /** * The public key in BBS+ uses the elliptic curve point from the signature params so returns that * @param params */ static generatePublicKeyBaseFromBbsPlusParams(params: BBSPlusSignatureParamsG1): PublicKeyBase; /** * The public key in BBS uses the elliptic curve point from the signature params so returns that * @param params */ static generatePublicKeyBaseFromBbsParams(params: BBSSignatureParams): PublicKeyBase; } //# sourceMappingURL=frost-dkg.d.ts.map