pub enum Ivk {
    Orchard([u8; 64]),
    Sapling([u8; 64]),
    P2pkh([u8; 65]),
    Unknown {
        typecode: u32,
        data: Vec<u8>,
    },
}
Expand description

The set of known IVKs for Unified IVKs.

Variants§

§

Orchard([u8; 64])

The raw encoding of an Orchard Incoming Viewing Key.

(dk, ivk) each 32 bytes.

§

Sapling([u8; 64])

Data contained within the Sapling component of a Unified Incoming Viewing Key.

In order to ensure that Unified Addresses can always be derived from UIVKs, we store more data here than was specified to be part of a Sapling IVK. Specifically, we store the same data here as we do for Orchard.

(dk, ivk) each 32 bytes.

§

P2pkh([u8; 65])

A pruned version of the extended public key for the BIP 44 account corresponding to the transparent address subtree from which transparent addresses are derived, at the external change BIP 44 path, i.e. m/44'/133'/<account_id>'/0. This includes just the chain code (32 bytes) and the compressed public key (33 bytes), and excludes the depth of in the derivation tree, the parent key fingerprint, and the child key number (which would reveal the wallet account number for which this UFVK was generated).

Transparent addresses don’t have “viewing keys” - the addresses themselves serve that purpose. However, we want the ability to derive diversified Unified Addresses from Unified Viewing Keys, and to not break the unlinkability property when they include transparent receivers. To achieve this, we treat the last hardened node in the BIP 44 derivation path as the “transparent viewing key”; all addresses derived from this node use non-hardened derivation, and can thus be derived just from this pruned extended public key.

§

Unknown

Fields

§typecode: u32
§data: Vec<u8>

Trait Implementations§

source§

impl Clone for Ivk

source§

fn clone(&self) -> Ivk

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ivk

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for Ivk

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Ivk

source§

fn eq(&self, other: &Ivk) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<(u32, &[u8])> for Ivk

§

type Error = ParseError

The type returned in the event of a conversion error.
source§

fn try_from((typecode, data): (u32, &[u8])) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for Ivk

source§

impl StructuralPartialEq for Ivk

Auto Trait Implementations§

§

impl RefUnwindSafe for Ivk

§

impl Send for Ivk

§

impl Sync for Ivk

§

impl Unpin for Ivk

§

impl UnwindSafe for Ivk

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.