[][src]Struct grin_keychain::extkey_bip32::ExtendedPubKey

pub struct ExtendedPubKey {
    pub network: [u8; 4],
    pub depth: u8,
    pub parent_fingerprint: Fingerprint,
    pub child_number: ChildNumber,
    pub public_key: PublicKey,
    pub chain_code: ChainCode,
}

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

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<H>(
    secp: &Secp256k1,
    sk: &ExtendedPrivKey,
    hasher: &mut H
) -> ExtendedPubKey where
    H: BIP32Hasher
[src]

Derives a public key from a private key

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

Attempts to derive an extended public key from a path.

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

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

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

Public->Public child key derivation

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

Returns the HASH160 of the chaincode

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

Returns the first four bytes of the identifier

Trait Implementations

impl Clone for ExtendedPubKey[src]

impl Copy for ExtendedPubKey[src]

impl Debug for ExtendedPubKey[src]

impl Display for ExtendedPubKey[src]

impl Eq for ExtendedPubKey[src]

impl FromStr for ExtendedPubKey[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<ExtendedPubKey> for ExtendedPubKey[src]

impl StructuralEq for ExtendedPubKey[src]

impl StructuralPartialEq for ExtendedPubKey[src]

Auto Trait Implementations

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> CloneAny for T where
    T: Clone + Any

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

impl<T> Erased for T

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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> UnsafeAny for T where
    T: Any