pub trait IncomingViewingKey: Sized + SealedChangeLevelKey {
// Provided methods
fn derive_address(
&self,
address_index: NonHardenedChildIndex,
) -> Result<TransparentAddress, Error> { ... }
fn derive_pubkey(
&self,
address_index: NonHardenedChildIndex,
) -> Result<PublicKey, Error> { ... }
fn default_address(&self) -> (TransparentAddress, NonHardenedChildIndex) { ... }
fn serialize(&self) -> Vec<u8> ⓘ { ... }
fn deserialize(data: &[u8; 65]) -> Result<Self, Error> { ... }
}transparent-inputs only.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 derive_pubkey(
&self,
address_index: NonHardenedChildIndex,
) -> Result<PublicKey, Error>
fn derive_pubkey( &self, address_index: NonHardenedChildIndex, ) -> Result<PublicKey, Error>
Derives the public key at the provided child index.
This is the key material derive_address hashes, which a
caller needs directly when the address is determined by a script over several keys
rather than by a single key hash.
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".