pub trait IncomingViewingKey: SealedChangeLevelKey + Sized {
// Provided methods
fn derive_address(
&self,
address_index: NonHardenedChildIndex,
) -> Result<TransparentAddress, Error> { ... }
fn default_address(&self) -> (TransparentAddress, NonHardenedChildIndex) { ... }
fn serialize(&self) -> Vec<u8> ⓘ { ... }
fn deserialize(data: &[u8; 65]) -> Result<Self, Error> { ... }
}
Expand description
Trait representing a transparent “incoming viewing key”.
Unlike the Sapling and Orchard shielded protocols (which have viewing keys built into their key trees and bound to specific spending keys), the transparent protocol has no “viewing key” concept. Transparent viewing keys are instead emulated by making two observations:
- BIP32 hierarchical derivation is structured as a tree.
- The BIP44 key paths use non-hardened derivation below the account level.
A transparent viewing key for an account is thus defined as the root of a specific non-hardened subtree underneath the account’s path.
Provided Methods§
Sourcefn derive_address(
&self,
address_index: NonHardenedChildIndex,
) -> Result<TransparentAddress, Error>
fn derive_address( &self, address_index: NonHardenedChildIndex, ) -> Result<TransparentAddress, Error>
Derives a transparent address at the provided child index.
Sourcefn default_address(&self) -> (TransparentAddress, NonHardenedChildIndex)
fn default_address(&self) -> (TransparentAddress, NonHardenedChildIndex)
Searches the space of child indexes for an index that will generate a valid transparent address, and returns the resulting address and the index at which it was generated.
fn serialize(&self) -> Vec<u8> ⓘ
fn deserialize(data: &[u8; 65]) -> Result<Self, Error>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.