Struct key_share::DirtyCoreKeyShare
source · pub struct DirtyCoreKeyShare<E: Curve> {
pub i: u16,
pub key_info: DirtyKeyInfo<E>,
pub x: NonZero<SecretScalar<E>>,
}Expand description
Dirty (unvalidated) core key share
Key share can be either polynomial or additive:
-
Polynomial key share:
- Supports any threshold $2 \le t \le n$
- All signers co-share a secret polynomial $F(x)$ with degree $deg(F) = t-1$
- Signer with index $i$ (index is in range $0 \le i < n$) holds secret share $x_i = F(I_i)$
- Shared secret key is $\sk = F(0)$.
If key share is polynomial,
vss_setupfiels should beSome(_).$I_j$ mentioned above is defined in
VssSetup::I. Reasonable default would be $I_j = j+1$. -
Additive key share:
- Always non-threshold (i.e. $t=n$)
- Signer with index $i$ holds a secret share $x_i$
- All signers share a secret key that is sum of all secret shares $\sk = \sum_{j \in [n]} x_j$.
Advantage of additive share is that DKG protocol that yields additive share is a bit more efficient.
§HD wallets support
If hd-wallets feature is enabled, key share provides basic support of deterministic key derivation:
chain_codefield is added. If it’sSome(_), then the key is HD-capable.(shared_public_key, chain_code)is extended public key of the wallet (can be retrieved via extended_public_key method).- Setting
chain_codetoNonedisables HD wallets support for the key
- Setting
- Convenient methods are provided such as derive_child_public_key
Fields§
§i: u16Index of local party in key generation protocol
key_info: DirtyKeyInfo<E>Public key info
x: NonZero<SecretScalar<E>>Secret share $x_i$
Methods from Deref<Target = DirtyKeyInfo<E>>§
Returns share preimage associated with j-th signer
- For additive shares, share preimage is defined as
j+1 - For VSS-shares, share preimage is scalar $I_j$ such that $x_j = F(I_j)$ where $F(x)$ is polynomial co-shared by the signers and $x_j$ is secret share of j-th signer
Note: if you have no idea what it is, probably you don’t need it.
Trait Implementations§
source§fn as_ref(&self) -> &DirtyKeyInfo<E>
fn as_ref(&self) -> &DirtyKeyInfo<E>
Converts this type into a shared reference of the (usually inferred) input type.
source§fn clone(&self) -> DirtyCoreKeyShare<E>
fn clone(&self) -> DirtyCoreKeyShare<E>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§fn validate_parts(
(i, key_info, x): &(u16, DirtyKeyInfo<E>, NonZero<SecretScalar<E>>)
) -> Result<(), Self::Error>
fn validate_parts( (i, key_info, x): &(u16, DirtyKeyInfo<E>, NonZero<SecretScalar<E>>) ) -> Result<(), Self::Error>
Validates parts Read more
source§fn from_parts(
(i, key_info, x): (u16, DirtyKeyInfo<E>, NonZero<SecretScalar<E>>)
) -> Self
fn from_parts( (i, key_info, x): (u16, DirtyKeyInfo<E>, NonZero<SecretScalar<E>>) ) -> Self
Constructs
Self from partsAuto 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