tss::dkg

Struct Dkg

Source
pub struct Dkg {
    id: Identifier,
    members: BTreeSet<Identifier>,
    threshold: u16,
    secret_package: Option<SecretPackage>,
    commitment: Option<VerifiableSecretSharingCommitment>,
    sent_round2_packages: bool,
    round2_packages: HashMap<Identifier, Package>,
}
Expand description

Distributed key generation state machine.

Fields§

§id: Identifier§members: BTreeSet<Identifier>§threshold: u16§secret_package: Option<SecretPackage>§commitment: Option<VerifiableSecretSharingCommitment>§sent_round2_packages: bool§round2_packages: HashMap<Identifier, Package>

Implementations§

Source§

impl Dkg

Source

pub fn new( id: Identifier, members: BTreeSet<Identifier>, threshold: u16, ) -> Self

Creates a new instance of the DKG state machine.

§Arguments
  • id - The identifier of the current participant.
  • members - A set of identifiers for all participants.
  • threshold - The threshold number of participants needed to reconstruct the secret.
§Returns

A new Dkg instance.

Source

pub fn on_commit(&mut self, commitment: VerifiableSecretSharingCommitment)

Handles the receipt of a commitment from another participant.

§Arguments
  • commitment - The commitment received from another participant.
Source

pub fn on_message(&mut self, peer: Identifier, msg: DkgMessage)

Handles the receipt of a message from another participant.

§Arguments
  • peer - The identifier of the peer who sent the message.
  • msg - The message received from the peer.
Source

pub fn next_action(&mut self) -> Option<DkgAction>

Determines the next action to be taken in the DKG process.

§Returns

An optional DkgAction representing the next action to be taken.

Auto Trait Implementations§

§

impl Freeze for Dkg

§

impl RefUnwindSafe for Dkg

§

impl Send for Dkg

§

impl Sync for Dkg

§

impl Unpin for Dkg

§

impl UnwindSafe for Dkg

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more