Trait ScanningKeyOps

Source
pub trait ScanningKeyOps<D: Domain, AccountId, Nf> {
    // Required methods
    fn prepare(&self) -> D::IncomingViewingKey;
    fn account_id(&self) -> &AccountId;
    fn key_scope(&self) -> Option<Scope>;
    fn nf(&self, note: &D::Note, note_position: Position) -> Option<Nf>;
}
Expand description

A key that can be used to perform trial decryption and nullifier computation for a CompactSaplingOutput or CompactOrchardAction.

The purpose of this trait is to enable scan_block and related methods to be used with either incoming viewing keys or full viewing keys, with the data returned from trial decryption being dependent upon the type of key used. In the case that an incoming viewing key is used, only the note and payment address will be returned; in the case of a full viewing key, the nullifier for the note can also be obtained.

Required Methods§

Source

fn prepare(&self) -> D::IncomingViewingKey

Prepare the key for use in batch trial decryption.

Source

fn account_id(&self) -> &AccountId

Returns the account identifier for this key. An account identifier corresponds to at most a single unified spending key’s worth of spend authority, such that both received notes and change spendable by that spending authority will be interpreted as belonging to that account.

Source

fn key_scope(&self) -> Option<Scope>

Returns the [zip32::Scope] for which this key was derived, if known.

Source

fn nf(&self, note: &D::Note, note_position: Position) -> Option<Nf>

Produces the nullifier for the specified note and witness, if possible.

IVK-based implementations of this trait cannot successfully derive nullifiers, in which this function will always return None.

Trait Implementations§

Source§

impl<D: Domain, AccountId, Nf> ScanningKeyOps<D, AccountId, Nf> for Box<dyn ScanningKeyOps<D, AccountId, Nf>>

Source§

fn prepare(&self) -> D::IncomingViewingKey

Prepare the key for use in batch trial decryption.
Source§

fn account_id(&self) -> &AccountId

Returns the account identifier for this key. An account identifier corresponds to at most a single unified spending key’s worth of spend authority, such that both received notes and change spendable by that spending authority will be interpreted as belonging to that account.
Source§

fn key_scope(&self) -> Option<Scope>

Returns the [zip32::Scope] for which this key was derived, if known.
Source§

fn nf(&self, note: &D::Note, note_position: Position) -> Option<Nf>

Produces the nullifier for the specified note and witness, if possible. Read more

Implementations on Foreign Types§

Source§

impl<AccountId> ScanningKeyOps<SaplingDomain, AccountId, Nullifier> for (AccountId, SaplingIvk)

Source§

fn prepare(&self) -> PreparedIncomingViewingKey

Source§

fn nf(&self, _note: &Note, _position: Position) -> Option<Nullifier>

Source§

fn account_id(&self) -> &AccountId

Source§

fn key_scope(&self) -> Option<Scope>

Source§

impl<D: Domain, AccountId, Nf> ScanningKeyOps<D, AccountId, Nf> for Box<dyn ScanningKeyOps<D, AccountId, Nf>>

Source§

fn prepare(&self) -> D::IncomingViewingKey

Source§

fn account_id(&self) -> &AccountId

Source§

fn key_scope(&self) -> Option<Scope>

Source§

fn nf(&self, note: &D::Note, note_position: Position) -> Option<Nf>

Source§

impl<D: Domain, AccountId, Nf, K: ScanningKeyOps<D, AccountId, Nf>> ScanningKeyOps<D, AccountId, Nf> for &K

Source§

fn prepare(&self) -> D::IncomingViewingKey

Source§

fn account_id(&self) -> &AccountId

Source§

fn key_scope(&self) -> Option<Scope>

Source§

fn nf(&self, note: &D::Note, note_position: Position) -> Option<Nf>

Implementors§

Source§

impl<AccountId> ScanningKeyOps<OrchardDomain, AccountId, Nullifier> for ScanningKey<IncomingViewingKey, FullViewingKey, AccountId>

Available on crate feature orchard only.
Source§

impl<AccountId> ScanningKeyOps<SaplingDomain, AccountId, Nullifier> for ScanningKey<SaplingIvk, NullifierDerivingKey, AccountId>