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: 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
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 ExtendedPubKey
impl Send for ExtendedPubKey
impl Sync for ExtendedPubKey
impl Unpin for ExtendedPubKey
impl UnwindSafe for ExtendedPubKey
Blanket Implementations
Mutably borrows from an owned value. Read more