Skip to content

Commit

Permalink
DKG level method for validators to create refresh transcripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed May 20, 2024
1 parent 0819612 commit 3339680
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ferveo/src/dkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ use rand::RngCore;
use serde::{Deserialize, Serialize};

use crate::{
assert_no_share_duplicates, AggregatedTranscript, Error, EthereumAddress,
PubliclyVerifiableParams, PubliclyVerifiableSS, Result, Validator,
assert_no_share_duplicates, refresh, AggregatedTranscript, Error,
EthereumAddress, PubliclyVerifiableParams, PubliclyVerifiableSS, Result,
UpdateTranscript, Validator,
};

pub type DomainPoint<E> = <E as Pairing>::ScalarField;
Expand Down Expand Up @@ -226,6 +227,19 @@ impl<E: Pairing> PubliclyVerifiableDkg<E> {

Ok(())
}

// Returns a new refresh transcript for current validators in DKG
// TODO: Allow to pass a parameter to restrict target validators
pub fn generate_refresh_transcript<R: RngCore>(
&self,
rng: &mut R,
) -> Result<refresh::UpdateTranscript<E>> {
Ok(UpdateTranscript::create_refresh_updates(
&self.domain_and_key_map(),
self.dkg_params.security_threshold(),
rng,
))
}
}

/// Test initializing DKG
Expand Down

0 comments on commit 3339680

Please sign in to comment.