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

pub struct ExtendedPubKey {
    pub network: Network,
    pub depth: u8,
    pub parent_fingerprint: Fingerprint,
    pub child_number: ChildNumber,
    pub public_key: PublicKey,
    pub chain_code: ChainCode,
}

Extended public 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

child_number: ChildNumber

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

public_key: PublicKey

Public key

chain_code: ChainCode

Chain code

Methods

impl ExtendedPubKey[src]

pub fn from_private<C: Signing>(
    secp: &Secp256k1<C>,
    sk: &ExtendedPrivKey
) -> ExtendedPubKey
[src]

Derives a public key from a private key

pub fn derive_pub<C: Verification, P: AsRef<[ChildNumber]>>(
    &self,
    secp: &Secp256k1<C>,
    path: &P
) -> Result<ExtendedPubKey, Error>
[src]

Attempts to derive an extended public key from a path.

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

pub fn ckd_pub_tweak(
    &self,
    i: ChildNumber
) -> Result<(PrivateKey, ChainCode), Error>
[src]

Compute the scalar tweak added to this key to get a child key

pub fn ckd_pub<C: Verification>(
    &self,
    secp: &Secp256k1<C>,
    i: ChildNumber
) -> Result<ExtendedPubKey, Error>
[src]

Public->Public child key derivation

pub fn identifier(&self) -> Hash[src]

Returns the HASH160 of the chaincode

pub fn fingerprint(&self) -> Fingerprint[src]

Returns the first four bytes of the identifier

Trait Implementations

impl Eq for ExtendedPubKey[src]

impl Clone for ExtendedPubKey[src]

impl PartialEq<ExtendedPubKey> for ExtendedPubKey[src]

impl Copy for ExtendedPubKey[src]

impl Debug for ExtendedPubKey[src]

impl Display for ExtendedPubKey[src]

impl FromStr for ExtendedPubKey[src]

type Err = Error

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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