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_setup fiels should be Some(_).

    $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_code field is added. If it’s Some(_), 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_code to None disables HD wallets support for the key
  • Convenient methods are provided such as derive_child_public_key

Fields§

§i: u16

Index 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>>§

source

pub fn share_preimage(&self, j: u16) -> Option<NonZero<Scalar<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§

impl<E: Curve> AsRef<DirtyKeyInfo<E>> for DirtyCoreKeyShare<E>

source§

fn as_ref(&self) -> &DirtyKeyInfo<E>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<E: Clone + Curve> Clone for DirtyCoreKeyShare<E>

source§

fn clone(&self) -> DirtyCoreKeyShare<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Curve> Deref for DirtyCoreKeyShare<E>

§

type Target = DirtyKeyInfo<E>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<E: Curve> Validate for DirtyCoreKeyShare<E>

§

type Error = InvalidCoreShare

Validation error
source§

fn is_valid(&self) -> Result<(), Self::Error>

Checks whether value is valid Read more
source§

fn validate(self) -> Result<Valid<Self>, ValidateError<Self, Self::Error>>
where Self: Sized,

Validates the value Read more
source§

fn validate_ref(&self) -> Result<&Valid<Self>, Self::Error>
where Self: Sized,

Validates the value by reference Read more
source§

impl<E: Curve> ValidateFromParts<(u16, DirtyKeyInfo<E>, NonZero<SecretScalar<E>>)> for DirtyCoreKeyShare<E>

source§

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

Constructs Self from parts

Auto Trait Implementations§

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.

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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.