Struct grin_keychain::extkey_bip32::ExtendedPubKey
source · 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,
}
Expand description
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
Implementations§
source§impl ExtendedPubKey
impl ExtendedPubKey
sourcepub fn from_private<H>(
secp: &Secp256k1,
sk: &ExtendedPrivKey,
hasher: &mut H
) -> ExtendedPubKeywhere
H: BIP32Hasher,
pub fn from_private<H>(
secp: &Secp256k1,
sk: &ExtendedPrivKey,
hasher: &mut H
) -> ExtendedPubKeywhere
H: BIP32Hasher,
Derives a public key from a private key
sourcepub fn derive_pub<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
cnums: &[ChildNumber]
) -> Result<ExtendedPubKey, Error>where
H: BIP32Hasher,
pub fn derive_pub<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
cnums: &[ChildNumber]
) -> Result<ExtendedPubKey, Error>where
H: BIP32Hasher,
Attempts to derive an extended public key from a path.
sourcepub fn ckd_pub_tweak<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
i: ChildNumber
) -> Result<(SecretKey, ChainCode), Error>where
H: BIP32Hasher,
pub fn ckd_pub_tweak<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
i: ChildNumber
) -> Result<(SecretKey, ChainCode), Error>where
H: BIP32Hasher,
Compute the scalar tweak added to this key to get a child key
sourcepub fn ckd_pub<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
i: ChildNumber
) -> Result<ExtendedPubKey, Error>where
H: BIP32Hasher,
pub fn ckd_pub<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
i: ChildNumber
) -> Result<ExtendedPubKey, Error>where
H: BIP32Hasher,
Public->Public child key derivation
sourcepub fn identifier<H>(&self, secp: &Secp256k1, hasher: &mut H) -> [u8; 20]where
H: BIP32Hasher,
pub fn identifier<H>(&self, secp: &Secp256k1, hasher: &mut H) -> [u8; 20]where
H: BIP32Hasher,
Returns the HASH160 of the chaincode
sourcepub fn fingerprint<H>(&self, secp: &Secp256k1, hasher: &mut H) -> Fingerprintwhere
H: BIP32Hasher,
pub fn fingerprint<H>(&self, secp: &Secp256k1, hasher: &mut H) -> Fingerprintwhere
H: BIP32Hasher,
Returns the first four bytes of the identifier
Trait Implementations§
source§impl Clone for ExtendedPubKey
impl Clone for ExtendedPubKey
source§fn clone(&self) -> ExtendedPubKey
fn clone(&self) -> ExtendedPubKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ExtendedPubKey
impl Debug for ExtendedPubKey
source§impl Display for ExtendedPubKey
impl Display for ExtendedPubKey
source§impl FromStr for ExtendedPubKey
impl FromStr for ExtendedPubKey
source§impl PartialEq for ExtendedPubKey
impl PartialEq for ExtendedPubKey
source§fn eq(&self, other: &ExtendedPubKey) -> bool
fn eq(&self, other: &ExtendedPubKey) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ExtendedPubKey
impl Eq for ExtendedPubKey
impl StructuralPartialEq for ExtendedPubKey
Auto Trait Implementations§
impl Freeze for ExtendedPubKey
impl RefUnwindSafe for ExtendedPubKey
impl Send for ExtendedPubKey
impl Sync for ExtendedPubKey
impl Unpin for ExtendedPubKey
impl UnwindSafe for ExtendedPubKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.