Edwards

Struct Edwards 

Source
pub struct Edwards;
Expand description

HD derivation for Ed25519 curve

This type of derivation isn’t defined in any known to us standards, but it can be often found in other libraries. It is secure and efficient.

§Example

use hd_wallet::{HdWallet, Edwards, curves::Ed25519};

let parent_key: hd_wallet::ExtendedKeyPair<Ed25519> = load_key();

let child_key_pair = Edwards::derive_child_key_pair_with_path(
    &parent_key,
    [1 + hd_wallet::H, 10],
);

Trait Implementations§

Source§

impl DeriveShift<Ed25519> for Edwards

Source§

fn derive_public_shift( parent_public_key: &ExtendedPublicKey<Ed25519>, child_index: NonHardenedIndex, ) -> DerivedShift<Ed25519>

Derives a shift for non-hardened child Read more
Source§

fn derive_hardened_shift( parent_key: &ExtendedKeyPair<Ed25519>, child_index: HardenedIndex, ) -> DerivedShift<Ed25519>

Derive a shift for hardened child Read more

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<E, S> HdWallet<E> for S
where E: Curve, S: DeriveShift<E>,

Source§

fn derive_child_public_key( parent_public_key: &ExtendedPublicKey<E>, child_index: NonHardenedIndex, ) -> ExtendedPublicKey<E>

Derives child extended public key from parent extended public key Read more
Source§

fn derive_child_key_pair( parent_key: &ExtendedKeyPair<E>, child_index: impl Into<ChildIndex>, ) -> ExtendedKeyPair<E>

Derives child key pair (extended secret key + public key) from parent key pair Read more
Source§

fn try_derive_child_key_pair_with_path<Err>( parent_key: &ExtendedKeyPair<E>, path: impl IntoIterator<Item = Result<impl Into<ChildIndex>, Err>>, ) -> Result<ExtendedKeyPair<E>, Err>

Derives a child key pair with specified derivation path from parent key pair Read more
Source§

fn derive_child_key_pair_with_path( parent_key: &ExtendedKeyPair<E>, path: impl IntoIterator<Item = impl Into<ChildIndex>>, ) -> ExtendedKeyPair<E>

Derives a child key pair with specified derivation path from parent key pair Read more
Source§

fn try_derive_child_public_key_with_path<Err>( parent_public_key: &ExtendedPublicKey<E>, path: impl IntoIterator<Item = Result<NonHardenedIndex, Err>>, ) -> Result<ExtendedPublicKey<E>, Err>

Derives a child public key with specified derivation path Read more
Source§

fn derive_child_public_key_with_path( parent_public_key: &ExtendedPublicKey<E>, path: impl IntoIterator<Item = NonHardenedIndex>, ) -> ExtendedPublicKey<E>

Derives a child public key with specified derivation path Read more
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

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

Source§

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.