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,
}Expand description
Extended public key
Fields
network: NetworkThe network this key is to be used on
depth: u8How many derivations this key is from the master (which is 0)
parent_fingerprint: FingerprintFingerprint of the parent key
child_number: ChildNumberChild number of the key used to derive from parent (0 for master)
public_key: PublicKeyPublic key
chain_code: ChainCodeChain code
Implementations
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>
pub fn derive_pub<C: Verification, P: AsRef<[ChildNumber]>>(
&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>.
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>
pub fn ckd_pub<C: Verification>(
&self,
secp: &Secp256k1<C>,
i: ChildNumber
) -> Result<ExtendedPubKey, Error>Public->Public child key derivation
Decoding extended public key from binary data according to BIP 32
Returns the HASH160 of the chaincode
Returns the first four bytes of the identifier
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for ExtendedPubKeyimpl Send for ExtendedPubKeyimpl Sync for ExtendedPubKeyimpl Unpin for ExtendedPubKeyimpl UnwindSafe for ExtendedPubKeyBlanket Implementations
Mutably borrows from an owned value. Read more