pub struct Keyshare { /* private fields */ }
Expand description
A key share representing a party’s portion of a distributed secret key.
This struct encapsulates all the information needed for a party to participate in distributed key generation and signing protocols. It includes:
- The party’s secret share
- Public key components
- Party ranks and identifiers
- Oblivious transfer seeds
- Additional protocol-specific data
The key share is stored in a compact binary format and provides methods for accessing its components and deriving child keys.
Implementations§
Sourcepub fn from_bytes(buffer: &[u8]) -> Option<Self>
pub fn from_bytes(buffer: &[u8]) -> Option<Self>
Sourcepub fn public_key(&self) -> ProjectivePoint
pub fn public_key(&self) -> ProjectivePoint
Returns the public key as a ProjectivePoint
.
Sourcepub fn x_i_list(&self) -> Vec<NonZeroScalar>
pub fn x_i_list(&self) -> Vec<NonZeroScalar>
Returns a vector of x-coordinates for all parties.
Sourcepub fn zero_ranks(&self) -> bool
pub fn zero_ranks(&self) -> bool
Returns true if all parties have rank zero.
Sourcepub fn extra_data(&self) -> &[u8] ⓘ
pub fn extra_data(&self) -> &[u8] ⓘ
Returns the user-defined data embedded in the key share.
This data is passed via the setup message during key generation and is immutable.
Sourcepub fn root_chain_code(&self) -> [u8; 32]
pub fn root_chain_code(&self) -> [u8; 32]
Returns the root chain code.
Sourcepub fn root_public_key(&self) -> ProjectivePoint
pub fn root_public_key(&self) -> ProjectivePoint
Returns the root public key.
Sourcepub fn get_finger_print(&self) -> KeyFingerPrint
pub fn get_finger_print(&self) -> KeyFingerPrint
Returns the key fingerprint.
Sourcepub fn derive_with_offset(
&self,
chain_path: &DerivationPath,
) -> Result<(Scalar, ProjectivePoint), BIP32Error>
pub fn derive_with_offset( &self, chain_path: &DerivationPath, ) -> Result<(Scalar, ProjectivePoint), BIP32Error>
Sourcepub fn derive_child_pubkey(
&self,
chain_path: &DerivationPath,
) -> Result<ProjectivePoint, BIP32Error>
pub fn derive_child_pubkey( &self, chain_path: &DerivationPath, ) -> Result<ProjectivePoint, BIP32Error>
Sourcepub fn derive_xpub(
&self,
prefix: Prefix,
chain_path: DerivationPath,
) -> Result<XPubKey, BIP32Error>
pub fn derive_xpub( &self, prefix: Prefix, chain_path: DerivationPath, ) -> Result<XPubKey, BIP32Error>
Trait Implementations§
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more