Struct bitcoin::util::bip32::ExtendedPrivKey[][src]

pub struct ExtendedPrivKey {
    pub network: Network,
    pub depth: u8,
    pub parent_fingerprint: Fingerprint,
    pub child_number: ChildNumber,
    pub private_key: PrivateKey,
    pub chain_code: ChainCode,
}

Extended private key

Fields

network: Network

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)

private_key: PrivateKey

Private key

chain_code: ChainCode

Chain code

Implementations

impl ExtendedPrivKey[src]

pub fn new_master(
    network: Network,
    seed: &[u8]
) -> Result<ExtendedPrivKey, Error>
[src]

Construct a new master key from a seed value

pub fn derive_priv<C: Signing, P: AsRef<[ChildNumber]>>(
    &self,
    secp: &Secp256k1<C>,
    path: &P
) -> Result<ExtendedPrivKey, Error>
[src]

Attempts to derive an extended private key from a path.

The path argument can be both of type DerivationPath or Vec<ChildNumber>.

pub fn ckd_priv<C: Signing>(
    &self,
    secp: &Secp256k1<C>,
    i: ChildNumber
) -> Result<ExtendedPrivKey, Error>
[src]

Private->Private child key derivation

pub fn decode(data: &[u8]) -> Result<ExtendedPrivKey, Error>[src]

Decoding extended private key from binary data according to BIP 32

pub fn encode(&self) -> [u8; 78][src]

Extended private key binary encoding according to BIP 32

pub fn identifier<C: Signing>(&self, secp: &Secp256k1<C>) -> XpubIdentifier[src]

Returns the HASH160 of the public key belonging to the xpriv

pub fn fingerprint<C: Signing>(&self, secp: &Secp256k1<C>) -> Fingerprint[src]

Returns the first four bytes of the identifier

Trait Implementations

impl Clone for ExtendedPrivKey[src]

impl Debug for ExtendedPrivKey[src]

impl<'de> Deserialize<'de> 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.

impl PartialEq<ExtendedPrivKey> for ExtendedPrivKey[src]

impl<'de> Serialize for ExtendedPrivKey[src]

impl Copy for ExtendedPrivKey[src]

impl Eq for ExtendedPrivKey[src]

impl StructuralEq for ExtendedPrivKey[src]

impl StructuralPartialEq for ExtendedPrivKey[src]

Auto Trait Implementations

impl RefUnwindSafe for ExtendedPrivKey

impl Send for ExtendedPrivKey

impl Sync for ExtendedPrivKey

impl Unpin for ExtendedPrivKey

impl UnwindSafe for ExtendedPrivKey

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]