pub struct ExtendedKey(pub [u8; 78]);
Expand description
A private or public key in an hierarchical deterministic wallet
Tuple Fields§
§0: [u8; 78]
Implementations§
Source§impl ExtendedKey
impl ExtendedKey
Sourcepub fn new_public_key(
network: Network,
depth: u8,
parent_fingerprint: &[u8],
index: u32,
chain_code: &[u8],
public_key: &[u8],
) -> Result<ExtendedKey>
pub fn new_public_key( network: Network, depth: u8, parent_fingerprint: &[u8], index: u32, chain_code: &[u8], public_key: &[u8], ) -> Result<ExtendedKey>
Creates a new extended public key
Sourcepub fn new_private_key(
network: Network,
depth: u8,
parent_fingerprint: &[u8],
index: u32,
chain_code: &[u8],
private_key: &[u8],
) -> Result<ExtendedKey>
pub fn new_private_key( network: Network, depth: u8, parent_fingerprint: &[u8], index: u32, chain_code: &[u8], private_key: &[u8], ) -> Result<ExtendedKey>
Creates a new extended private key
Sourcepub fn key_type(&self) -> Result<ExtendedKeyType>
pub fn key_type(&self) -> Result<ExtendedKeyType>
Gets the key type
Sourcepub fn parent_fingerprint(&self) -> [u8; 4]
pub fn parent_fingerprint(&self) -> [u8; 4]
Gets the first 4 bytes of the parent key, or 0 if this is the master key
Sourcepub fn chain_code(&self) -> [u8; 32]
pub fn chain_code(&self) -> [u8; 32]
Gets the chain code
Sourcepub fn public_key(&self) -> Result<[u8; 33]>
pub fn public_key(&self) -> Result<[u8; 33]>
Gets the public key if this is an extended public key
Sourcepub fn private_key(&self) -> Result<[u8; 32]>
pub fn private_key(&self) -> Result<[u8; 32]>
Gets the private key if this is an extended private key
Sourcepub fn fingerprint(&self) -> Result<[u8; 4]>
pub fn fingerprint(&self) -> Result<[u8; 4]>
Gets the fingerprint of the public key hash
Sourcepub fn extended_public_key(&self) -> Result<ExtendedKey>
pub fn extended_public_key(&self) -> Result<ExtendedKey>
Gets the extenced public key for this key
Sourcepub fn derive_private_key(&self, index: u32) -> Result<ExtendedKey>
pub fn derive_private_key(&self, index: u32) -> Result<ExtendedKey>
Derives an extended child private key from an extended parent private key
Sourcepub fn derive_public_key(&self, index: u32) -> Result<ExtendedKey>
pub fn derive_public_key(&self, index: u32) -> Result<ExtendedKey>
Derives an extended child public key from an extended parent public key
Sourcepub fn decode(s: &str) -> Result<ExtendedKey>
pub fn decode(s: &str) -> Result<ExtendedKey>
Decodes an extended key from a string
Trait Implementations§
Source§impl Clone for ExtendedKey
impl Clone for ExtendedKey
Source§fn clone(&self) -> ExtendedKey
fn clone(&self) -> ExtendedKey
Returns a duplicate 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 ExtendedKey
impl Debug for ExtendedKey
Source§impl PartialEq for ExtendedKey
impl PartialEq for ExtendedKey
Source§impl Serializable<ExtendedKey> for ExtendedKey
impl Serializable<ExtendedKey> for ExtendedKey
impl Copy for ExtendedKey
impl Eq for ExtendedKey
Auto Trait Implementations§
impl Freeze for ExtendedKey
impl RefUnwindSafe for ExtendedKey
impl Send for ExtendedKey
impl Sync for ExtendedKey
impl Unpin for ExtendedKey
impl UnwindSafe for ExtendedKey
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