Struct bitcoin::util::bip32::ExtendedPubKey [−][src]
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
Implementations
impl ExtendedPubKey
[src]
impl ExtendedPubKey
[src]pub fn from_private<C: Signing>(
secp: &Secp256k1<C>,
sk: &ExtendedPrivKey
) -> ExtendedPubKey
[src]
secp: &Secp256k1<C>,
sk: &ExtendedPrivKey
) -> ExtendedPubKey
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]
&self,
secp: &Secp256k1<C>,
path: &P
) -> Result<ExtendedPubKey, Error>
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]
&self,
i: ChildNumber
) -> Result<(PrivateKey, ChainCode), Error>
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]
&self,
secp: &Secp256k1<C>,
i: ChildNumber
) -> Result<ExtendedPubKey, Error>
Public->Public child key derivation
pub fn decode(data: &[u8]) -> Result<ExtendedPubKey, Error>
[src]
Decoding extended public key from binary data according to BIP 32
pub fn encode(&self) -> [u8; 78]
[src]
Extended public key binary encoding according to BIP 32
pub fn identifier(&self) -> XpubIdentifier
[src]
Returns the HASH160 of the chaincode
pub fn fingerprint(&self) -> Fingerprint
[src]
Returns the first four bytes of the identifier
Trait Implementations
impl Clone for ExtendedPubKey
[src]
impl Clone for ExtendedPubKey
[src]fn clone(&self) -> ExtendedPubKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for ExtendedPubKey
[src]
impl<'de> Deserialize<'de> for ExtendedPubKey
[src]fn deserialize<D>(deserializer: D) -> Result<ExtendedPubKey, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl FromStr for ExtendedPubKey
[src]
impl FromStr for ExtendedPubKey
[src]impl Hash for ExtendedPubKey
[src]
impl Hash for ExtendedPubKey
[src]impl Ord for ExtendedPubKey
[src]
impl Ord for ExtendedPubKey
[src]impl PartialEq<ExtendedPubKey> for ExtendedPubKey
[src]
impl PartialEq<ExtendedPubKey> for ExtendedPubKey
[src]fn eq(&self, other: &ExtendedPubKey) -> bool
[src]
fn ne(&self, other: &ExtendedPubKey) -> bool
[src]
impl PartialOrd<ExtendedPubKey> for ExtendedPubKey
[src]
impl PartialOrd<ExtendedPubKey> for ExtendedPubKey
[src]fn partial_cmp(&self, other: &ExtendedPubKey) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl<'de> Serialize for ExtendedPubKey
[src]
impl<'de> Serialize for ExtendedPubKey
[src]