pub struct Bip32PublicKey(pub PublicKey<Ed25519Bip32>);
Tuple Fields§
§0: PublicKey<Ed25519Bip32>
Implementations§
Source§impl Bip32PublicKey
impl Bip32PublicKey
Sourcepub fn derive(&self, index: u32) -> Result<Bip32PublicKey, DerivationError>
pub fn derive(&self, index: u32) -> Result<Bip32PublicKey, DerivationError>
derive this public key with the given index.
§Errors
If the index is not a soft derivation index (< 0x80000000) then calling this method will fail.
§Security considerations
- hard derivation index cannot be soft derived with the public key
§Hard derivation vs Soft derivation
If you pass an index below 0x80000000 then it is a soft derivation. The advantage of soft derivation is that it is possible to derive the public key too. I.e. derivation the private key with a soft derivation index and then retrieving the associated public key is equivalent to deriving the public key associated to the parent private key.
Hard derivation index does not allow public key derivation.
This is why deriving the private key should not fail while deriving the public key may fail (if the derivation index is invalid).
pub fn to_raw_key(&self) -> PublicKey
pub fn from_bech32(bech32_str: &str) -> Result<Bip32PublicKey, CryptoError>
pub fn to_bech32(&self) -> String
pub fn chaincode(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for Bip32PublicKey
impl Clone for Bip32PublicKey
Source§fn clone(&self) -> Bip32PublicKey
fn clone(&self) -> Bip32PublicKey
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 Bip32PublicKey
impl Debug for Bip32PublicKey
Source§impl<'de> Deserialize<'de> for Bip32PublicKey
impl<'de> Deserialize<'de> for Bip32PublicKey
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 From<PublicKey<Ed25519Bip32>> for Bip32PublicKey
impl From<PublicKey<Ed25519Bip32>> for Bip32PublicKey
Source§fn from(key: PublicKey<Ed25519Bip32>) -> Self
fn from(key: PublicKey<Ed25519Bip32>) -> Self
Converts to this type from the input type.
Source§impl Hash for Bip32PublicKey
impl Hash for Bip32PublicKey
Source§impl JsonSchema for Bip32PublicKey
impl JsonSchema for Bip32PublicKey
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for Bip32PublicKey
impl PartialEq for Bip32PublicKey
Source§impl RawBytesEncoding for Bip32PublicKey
impl RawBytesEncoding for Bip32PublicKey
fn to_raw_bytes(&self) -> &[u8] ⓘ
fn from_raw_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>
fn to_raw_hex(&self) -> String
fn from_raw_hex(hex_str: &str) -> Result<Self, DeserializeError>where
Self: Sized,
Source§impl Serialize for Bip32PublicKey
impl Serialize for Bip32PublicKey
impl Eq for Bip32PublicKey
impl StructuralPartialEq for Bip32PublicKey
Auto Trait Implementations§
impl Freeze for Bip32PublicKey
impl RefUnwindSafe for Bip32PublicKey
impl Send for Bip32PublicKey
impl Sync for Bip32PublicKey
impl Unpin for Bip32PublicKey
impl UnwindSafe for Bip32PublicKey
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