Struct ExtendedPubKey
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§
§impl ExtendedPubKey
impl ExtendedPubKey
pub fn from_private<C>(
secp: &Secp256k1<C>,
sk: &ExtendedPrivKey,
) -> ExtendedPubKeywhere
C: Signing,
👎Deprecated since 0.28.0: use ExtendedPubKey::from_priv
pub fn from_private<C>(
secp: &Secp256k1<C>,
sk: &ExtendedPrivKey,
) -> ExtendedPubKeywhere
C: Signing,
Derives a public key from a private key
pub fn from_priv<C>(secp: &Secp256k1<C>, sk: &ExtendedPrivKey) -> ExtendedPubKeywhere
C: Signing,
pub fn from_priv<C>(secp: &Secp256k1<C>, sk: &ExtendedPrivKey) -> ExtendedPubKeywhere
C: Signing,
Derives a public key from a private key
pub fn to_pub(self) -> PublicKey
pub fn to_pub(self) -> PublicKey
Constructs ECDSA compressed public key matching internal public key representation.
pub fn to_x_only_pub(self) -> XOnlyPublicKey
pub fn to_x_only_pub(self) -> XOnlyPublicKey
Constructs BIP340 x-only public key for BIP-340 signatures and Taproot use matching the internal public key representation.
pub fn derive_pub<C, P>(
&self,
secp: &Secp256k1<C>,
path: &P,
) -> Result<ExtendedPubKey, Error>
pub fn derive_pub<C, P>( &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<(SecretKey, ChainCode), Error>
pub fn ckd_pub_tweak( &self, i: ChildNumber, ) -> Result<(SecretKey, ChainCode), Error>
Compute the scalar tweak added to this key to get a child key
pub fn ckd_pub<C>(
&self,
secp: &Secp256k1<C>,
i: ChildNumber,
) -> Result<ExtendedPubKey, Error>where
C: Verification,
pub fn ckd_pub<C>(
&self,
secp: &Secp256k1<C>,
i: ChildNumber,
) -> Result<ExtendedPubKey, Error>where
C: Verification,
Public->Public child key derivation
pub fn decode(data: &[u8]) -> Result<ExtendedPubKey, Error>
pub fn decode(data: &[u8]) -> Result<ExtendedPubKey, Error>
Decoding extended public key from binary data according to BIP 32
pub fn identifier(&self) -> XpubIdentifier
pub fn identifier(&self) -> XpubIdentifier
Returns the HASH160 of the chaincode
pub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
Returns the first four bytes of the identifier
Trait Implementations§
§impl Clone for ExtendedPubKey
impl Clone for ExtendedPubKey
§fn clone(&self) -> ExtendedPubKey
fn clone(&self) -> ExtendedPubKey
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ExtendedPubKey
impl Debug for ExtendedPubKey
§impl Display for ExtendedPubKey
impl Display for ExtendedPubKey
§impl FromStr for ExtendedPubKey
impl FromStr for ExtendedPubKey
§impl Hash for ExtendedPubKey
impl Hash for ExtendedPubKey
§impl Ord for ExtendedPubKey
impl Ord for ExtendedPubKey
§impl PartialEq for ExtendedPubKey
impl PartialEq for ExtendedPubKey
§impl PartialOrd for ExtendedPubKey
impl PartialOrd for ExtendedPubKey
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request