pub struct XPub(/* private fields */);
Expand description
Extended Public Key (Point + ChainCode)
Implementations§
Source§impl XPub
impl XPub
Sourcepub fn from_bytes(bytes: [u8; 64]) -> Self
pub fn from_bytes(bytes: [u8; 64]) -> Self
create a XPub
by taking ownership of the given array
Sourcepub fn from_pk_and_chaincode(pk: &[u8; 32], chain_code: &[u8; 32]) -> Self
pub fn from_pk_and_chaincode(pk: &[u8; 32], chain_code: &[u8; 32]) -> Self
create a XPub
by its components (a 32 bytes public key, and a 32 bytes chain code)
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, PublicKeyError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, PublicKeyError>
create a XPub
from the given slice. This slice must be of size XPUB_SIZE
otherwise it will return Option::None
.
pub fn derive( &self, scheme: DerivationScheme, index: DerivationIndex, ) -> Result<Self, DerivationError>
pub fn get_without_chaincode(&self, out: &mut [u8; 32])
pub fn public_key_bytes(&self) -> &[u8; 32]
pub fn public_key_slice(&self) -> &[u8] ⓘ
pub fn chain_code_slice(&self) -> &[u8] ⓘ
pub fn public_key(&self) -> [u8; 32]
pub fn chain_code(&self) -> &[u8; 32]
Trait Implementations§
impl Copy for XPub
impl Eq for XPub
Auto Trait Implementations§
impl Freeze for XPub
impl RefUnwindSafe for XPub
impl Send for XPub
impl Sync for XPub
impl Unpin for XPub
impl UnwindSafe for XPub
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