Function run

Source
pub async fn run<T, R>(
    setup: T,
    seed: Seed,
    relay: R,
) -> Result<Keyshare, KeygenError>
Expand description

Executes the Distributed Key Generation protocol

This is the main entry point for the DKG protocol. It orchestrates the entire process of generating a distributed key among the participants.

§Type Parameters

  • T - A type implementing the KeygenSetupMessage trait
  • R - A type implementing the Relay trait for message communication

§Arguments

  • setup - The protocol setup configuration
  • seed - The random seed for cryptographic operations
  • relay - The message relay for communication between parties

§Returns

  • Ok(Keyshare) - The generated key share if the protocol succeeds
  • Err(KeygenError) - If the protocol fails

§Errors

This function may return the following errors:

  • KeygenError::AbortProtocol - If the protocol is aborted by a participant
  • KeygenError::SendMessage - If there’s an error sending messages
  • Other KeygenError variants for various protocol failures