diff --git a/frost-client/src/args.rs b/frost-client/src/args.rs index 145d75d..ff48b73 100644 --- a/frost-client/src/args.rs +++ b/frost-client/src/args.rs @@ -67,6 +67,10 @@ pub(crate) enum Command { /// dealer process via the FROST server (TODO: this is not supported yet) #[arg(short, long)] config: Vec, + /// A description of the group being created. Will be written to the + /// participant's config files and will help them identify groups. + #[arg(short, long)] + description: String, /// The comma-separated name of each participant. #[arg(short = 'N', long, value_delimiter = ',')] names: Vec, diff --git a/frost-client/src/config.rs b/frost-client/src/config.rs index a5373c3..716770a 100644 --- a/frost-client/src/config.rs +++ b/frost-client/src/config.rs @@ -57,9 +57,12 @@ pub struct CommunicationKey { } /// A FROST group the user belongs to. -// TODO: add a textual name for the group? #[derive(Clone, Debug, Serialize, Deserialize)] pub struct Group { + /// A human-readable description of the group to make it easier to select + /// groups + pub description: String, + /// The ciphersuite being used for the group pub ciphersuite: String, /// The encoded public key package for the group. #[serde( @@ -67,13 +70,13 @@ pub struct Group { deserialize_with = "serdect::slice::deserialize_hex_or_bin_vec" )] pub public_key_package: Vec, - /// The user's encodede key package for the group. + /// The user's encoded key package for the group. #[serde( serialize_with = "serdect::slice::serialize_hex_lower_or_bin", deserialize_with = "serdect::slice::deserialize_hex_or_bin_vec" )] pub key_package: Vec, - /// The server the participants are registered in, if any. + /// The default server the participants are using, if any. pub server_url: Option, /// The group participants, keyed by hex-encoded identifier pub participant: BTreeMap, @@ -86,7 +89,8 @@ impl Group { let helper = ciphersuite_helper(&self.ciphersuite)?; let info = helper.group_info(&self.key_package, &self.public_key_package)?; let mut s = format!( - "Group with public key {}\nServer URL: {}\nThreshold: {}\nParticipants: {}\n", + "Group \"{}\"\nPublic key {}\nServer URL: {}\nThreshold: {}\nParticipants: {}\n", + self.description, info.hex_verifying_key, self.server_url.clone().unwrap_or_default(), info.threshold, diff --git a/frost-client/src/trusted_dealer.rs b/frost-client/src/trusted_dealer.rs index ff1a475..7484a5e 100644 --- a/frost-client/src/trusted_dealer.rs +++ b/frost-client/src/trusted_dealer.rs @@ -33,6 +33,7 @@ pub(crate) fn trusted_dealer_for_ciphersuite Result<(), Box> { let Command::TrustedDealer { config, + description, ciphersuite: _, threshold, num_signers, @@ -91,6 +92,7 @@ pub(crate) fn trusted_dealer_for_ciphersuite = share.clone().try_into()?; let group = Group { ciphersuite: C::ID.to_string(), + description: description.clone(), key_package: postcard::to_allocvec(&key_package)?, public_key_package: postcard::to_allocvec(&public_key_package)?, participant: participants.clone(),