Struct coins_bip32::derived::DerivedXPriv
source · pub struct DerivedXPriv { /* private fields */ }
Expand description
An XPriv with its derivation.
Implementations§
source§impl DerivedXPriv
impl DerivedXPriv
sourcepub fn sign_digest_recoverable<D>(
&self,
digest: D
) -> Result<(Signature, RecoveryId), Error>where
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
pub fn sign_digest_recoverable<D>( &self, digest: D ) -> Result<(Signature, RecoveryId), Error>where D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
Sign the given message digest, returning a signature and recovery ID. See ECDSA docs here
source§impl DerivedXPriv
impl DerivedXPriv
sourcepub const fn new(xpriv: XPriv, derivation: KeyDerivation) -> Self
pub const fn new(xpriv: XPriv, derivation: KeyDerivation) -> Self
Instantiate a derived XPub from the XPub and derivatin. This usually should not be called directly. Prefer deriving keys from parents.
sourcepub fn is_private_ancestor_of(
&self,
other: &DerivedXPub
) -> Result<bool, Bip32Error>
pub fn is_private_ancestor_of( &self, other: &DerivedXPub ) -> Result<bool, Bip32Error>
Check if this XPriv is the private ancestor of some other derived key. To check ancestry of another private key, derive its public key first
sourcepub fn root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn root_node( hmac_key: &[u8], data: &[u8], hint: Option<Hint> ) -> Result<DerivedXPriv, Bip32Error>
Generate a customized root node using the stati
sourcepub fn root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn root_from_seed( data: &[u8], hint: Option<Hint> ) -> Result<DerivedXPriv, Bip32Error>
Generate a root node from some seed data. Uses the BIP32-standard hmac key.
Important:
Use a seed of AT LEAST 128 bits.
sourcepub fn custom_root_node(
hmac_key: &[u8],
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn custom_root_node( hmac_key: &[u8], data: &[u8], hint: Option<Hint> ) -> Result<DerivedXPriv, Bip32Error>
Instantiate a root node using a custom HMAC key.
sourcepub fn custom_root_from_seed(
data: &[u8],
hint: Option<Hint>
) -> Result<DerivedXPriv, Bip32Error>
pub fn custom_root_from_seed( data: &[u8], hint: Option<Hint> ) -> Result<DerivedXPriv, Bip32Error>
Generate a root node from some seed data. Uses the BIP32-standard hmac key.
Important:
Use a seed of AT LEAST 128 bits.
sourcepub fn verify_key(&self) -> DerivedXPub
pub fn verify_key(&self) -> DerivedXPub
Derive the corresponding xpub
Trait Implementations§
source§impl AsRef<SigningKey<Secp256k1>> for DerivedXPriv
impl AsRef<SigningKey<Secp256k1>> for DerivedXPriv
source§fn as_ref(&self) -> &SigningKey
fn as_ref(&self) -> &SigningKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl AsRef<XKeyInfo> for DerivedXPriv
impl AsRef<XKeyInfo> for DerivedXPriv
source§impl AsRef<XPriv> for DerivedXPriv
impl AsRef<XPriv> for DerivedXPriv
source§impl Clone for DerivedXPriv
impl Clone for DerivedXPriv
source§fn clone(&self) -> DerivedXPriv
fn clone(&self) -> DerivedXPriv
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 DerivedXPriv
impl Debug for DerivedXPriv
source§impl DerivedKey for DerivedXPriv
impl DerivedKey for DerivedXPriv
source§fn derivation(&self) -> &KeyDerivation
fn derivation(&self) -> &KeyDerivation
Return this key’s derivation
source§fn same_root<K: DerivedKey>(&self, other: &K) -> bool
fn same_root<K: DerivedKey>(&self, other: &K) -> bool
true
if the keys share a root fingerprint, false
otherwise. Note that on key
fingerprints, which may collide accidentally, or be intentionally collided.source§fn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool
fn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool
source§fn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>
fn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>
Returns the path to the descendant, or
None
if the argument is definitely not a
descendant. Read moresource§impl<'de> Deserialize<'de> for DerivedXPriv
impl<'de> Deserialize<'de> for DerivedXPriv
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<D> DigestSigner<D, (Signature<Secp256k1>, RecoveryId)> for DerivedXPrivwhere
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, (Signature<Secp256k1>, RecoveryId)> for DerivedXPrivwhere D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
source§fn try_sign_digest(&self, digest: D) -> Result<(Signature, RecoveryId), Error>
fn try_sign_digest(&self, digest: D) -> Result<(Signature, RecoveryId), Error>
Attempt to sign the given prehashed message
Digest
, returning a
digital signature on success, or an error if something went wrong.§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl<D> DigestSigner<D, Signature<Secp256k1>> for DerivedXPrivwhere
D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
impl<D> DigestSigner<D, Signature<Secp256k1>> for DerivedXPrivwhere D: FixedOutput<OutputSize = U32> + Clone + Default + Reset + Update + HashMarker,
source§fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
fn try_sign_digest(&self, digest: D) -> Result<Signature, Error>
Attempt to sign the given prehashed message
Digest
, returning a
digital signature on success, or an error if something went wrong.§fn sign_digest(&self, digest: D) -> S
fn sign_digest(&self, digest: D) -> S
source§impl Parent for DerivedXPriv
impl Parent for DerivedXPriv
source§fn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
fn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
Derive the child at
index
. Note that this may produce the child at
index+1
in rare circumstances. For public keys this will derive public
children. For private keys it will derive private children.source§fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error>where
E: Into<Bip32Error>,
P: TryInto<DerivationPath, Error = E>,
fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error>where E: Into<Bip32Error>, P: TryInto<DerivationPath, Error = E>,
Derive a series of child indices. Allows traversing several levels of the tree at once.
Accepts an iterator producing u32, or a string.
Auto Trait Implementations§
impl RefUnwindSafe for DerivedXPriv
impl Send for DerivedXPriv
impl Sync for DerivedXPriv
impl Unpin for DerivedXPriv
impl UnwindSafe for DerivedXPriv
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