[][src]Struct grin_keychain::extkey_bip32::ExtendedPrivKey

pub struct ExtendedPrivKey {
    pub network: [u8; 4],
    pub depth: u8,
    pub parent_fingerprint: Fingerprint,
    pub child_number: ChildNumber,
    pub secret_key: SecretKey,
    pub chain_code: ChainCode,
}

Extended private key

Fields

network: [u8; 4]

The network this key is to be used on

depth: u8

How many derivations this key is from the master (which is 0)

parent_fingerprint: Fingerprint

Fingerprint of the parent key (0 for master)

child_number: ChildNumber

Child number of the key used to derive from parent (0 for master)

secret_key: SecretKey

Secret key

chain_code: ChainCode

Chain code

Methods

impl ExtendedPrivKey[src]

pub fn new_master<H>(
    secp: &Secp256k1,
    hasher: &mut H,
    seed: &[u8]
) -> Result<ExtendedPrivKey, Error> where
    H: BIP32Hasher
[src]

Construct a new master key from a seed value

pub fn from_mnemonic(
    secp: &Secp256k1,
    mnemonic: &str,
    passphrase: &str,
    is_floo: bool
) -> Result<ExtendedPrivKey, Error>
[src]

Construct a new master key from a mnemonic and a passphrase

pub fn derive_priv<H>(
    &self,
    secp: &Secp256k1,
    hasher: &mut H,
    cnums: &[ChildNumber]
) -> Result<ExtendedPrivKey, Error> where
    H: BIP32Hasher
[src]

Attempts to derive an extended private key from a path.

pub fn ckd_priv<H>(
    &self,
    secp: &Secp256k1,
    hasher: &mut H,
    i: ChildNumber
) -> Result<ExtendedPrivKey, Error> where
    H: BIP32Hasher
[src]

Private->Private child key derivation

pub fn identifier<H>(&self, hasher: &mut H) -> [u8; 20] where
    H: BIP32Hasher
[src]

Returns the HASH160 of the chaincode

pub fn fingerprint<H>(&self, hasher: &mut H) -> Fingerprint where
    H: BIP32Hasher
[src]

Returns the first four bytes of the identifier

Trait Implementations

impl PartialEq<ExtendedPrivKey> for ExtendedPrivKey[src]

impl Eq for ExtendedPrivKey[src]

impl Clone for ExtendedPrivKey[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ExtendedPrivKey[src]

impl Display for ExtendedPrivKey[src]

impl FromStr for ExtendedPrivKey[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Erased for T

impl<T> Same<T> for T

type Output = T

Should always be Self