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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.