28 lines
22 KiB
HTML
28 lines
22 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A key that can be used to perform trial decryption and nullifier computation for a `CompactSaplingOutput` or `CompactOrchardAction`."><title>ScanningKeyOps in zcash_client_backend::scanning - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="zcash_client_backend" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0-nightly (99e7c15e8 2025-06-01)" data-channel="nightly" data-search-js="search-f7877310.js" data-settings-js="settings-5514c975.js" ><script src="../../static.files/storage-4e99c027.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../zcash_client_backend/index.html">zcash_<wbr>client_<wbr>backend</a><span class="version">0.19.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Scanning<wbr>KeyOps</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.account_id" title="account_id">account_id</a></li><li><a href="#tymethod.key_scope" title="key_scope">key_scope</a></li><li><a href="#tymethod.nf" title="nf">nf</a></li><li><a href="#tymethod.prepare" title="prepare">prepare</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-%26K" title="&K">&K</a></li><li><a href="#impl-ScanningKeyOps%3CSaplingDomain,+AccountId,+Nullifier%3E-for-(AccountId,+SaplingIvk)" title="(AccountId, SaplingIvk)">(AccountId, SaplingIvk)</a></li><li><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E" title="Box<dyn ScanningKeyOps<D, AccountId, Nf>>">Box<dyn ScanningKeyOps<D, AccountId, Nf>></a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block trait-implementation"><li><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E" title="ScanningKeyOps<D, AccountId, Nf>">ScanningKeyOps<D, AccountId, Nf></a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In zcash_<wbr>client_<wbr>backend::<wbr>scanning</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">zcash_client_backend</a>::<wbr><a href="index.html">scanning</a></div><h1>Trait <span class="trait">ScanningKeyOps</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/zcash_client_backend/scanning.rs.html#55-73">Source</a> </span></div><pre class="rust item-decl"><code>pub trait ScanningKeyOps<D: Domain, AccountId, Nf> {
|
||
// Required methods
|
||
fn <a href="#tymethod.prepare" class="fn">prepare</a>(&self) -> D::IncomingViewingKey;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope>;
|
||
<span class="item-spacer"></span> fn <a href="#tymethod.nf" class="fn">nf</a>(&self, note: &D::Note, note_position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nf>;
|
||
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A key that can be used to perform trial decryption and nullifier
|
||
computation for a <a href="../proto/compact_formats/struct.CompactSaplingOutput.html" title="struct zcash_client_backend::proto::compact_formats::CompactSaplingOutput"><code>CompactSaplingOutput</code></a> or <a href="../proto/compact_formats/struct.CompactOrchardAction.html" title="struct zcash_client_backend::proto::compact_formats::CompactOrchardAction"><code>CompactOrchardAction</code></a>.</p>
|
||
<p>The purpose of this trait is to enable <a href="fn.scan_block.html" title="fn zcash_client_backend::scanning::scan_block"><code>scan_block</code></a>
|
||
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.</p>
|
||
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.prepare" class="method"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#57">Source</a><h4 class="code-header">fn <a href="#tymethod.prepare" class="fn">prepare</a>(&self) -> D::IncomingViewingKey</h4></section></summary><div class="docblock"><p>Prepare the key for use in batch trial decryption.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.account_id" class="method"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#63">Source</a><h4 class="code-header">fn <a href="#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a></h4></section></summary><div class="docblock"><p>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.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.key_scope" class="method"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#66">Source</a><h4 class="code-header">fn <a href="#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope></h4></section></summary><div class="docblock"><p>Returns the [<code>zip32::Scope</code>] for which this key was derived, if known.</p>
|
||
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.nf" class="method"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#72">Source</a><h4 class="code-header">fn <a href="#tymethod.nf" class="fn">nf</a>(&self, note: &D::Note, note_position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nf></h4></section></summary><div class="docblock"><p>Produces the nullifier for the specified note and witness, if possible.</p>
|
||
<p>IVK-based implementations of this trait cannot successfully derive
|
||
nullifiers, in which this function will always return <code>None</code>.</p>
|
||
</div></details></div><h2 id="trait-implementations" class="section-header">Trait Implementations<a href="#trait-implementations" class="anchor">§</a></h2><div id="trait-implementations-list"><details class="toggle implementors-toggle" open><summary><section id="impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#95-113">Source</a><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E" class="anchor">§</a><h3 class="code-header">impl<D: Domain, AccountId, Nf> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf>></h3></section></summary><div class="impl-items"><details class="toggle method-toggle" open><summary><section id="method.prepare" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#98-100">Source</a><a href="#method.prepare" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ScanningKeyOps.html#tymethod.prepare" class="fn">prepare</a>(&self) -> D::IncomingViewingKey</h4></section></summary><div class='docblock'>Prepare the key for use in batch trial decryption.</div></details><details class="toggle method-toggle" open><summary><section id="method.account_id" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#102-104">Source</a><a href="#method.account_id" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ScanningKeyOps.html#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a></h4></section></summary><div class='docblock'>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.</div></details><details class="toggle method-toggle" open><summary><section id="method.key_scope" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#106-108">Source</a><a href="#method.key_scope" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ScanningKeyOps.html#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope></h4></section></summary><div class='docblock'>Returns the [<code>zip32::Scope</code>] for which this key was derived, if known.</div></details><details class="toggle method-toggle" open><summary><section id="method.nf" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#110-112">Source</a><a href="#method.nf" class="anchor">§</a><h4 class="code-header">fn <a href="trait.ScanningKeyOps.html#tymethod.nf" class="fn">nf</a>(&self, note: &D::Note, note_position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nf></h4></section></summary><div class='docblock'>Produces the nullifier for the specified note and witness, if possible. <a href="trait.ScanningKeyOps.html#tymethod.nf">Read more</a></div></details></div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-ScanningKeyOps%3CSaplingDomain,+AccountId,+Nullifier%3E-for-(AccountId,+SaplingIvk)" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#143-161">Source</a><a href="#impl-ScanningKeyOps%3CSaplingDomain,+AccountId,+Nullifier%3E-for-(AccountId,+SaplingIvk)" class="anchor">§</a><h3 class="code-header">impl<AccountId> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><SaplingDomain, AccountId, Nullifier> for (AccountId, SaplingIvk)</h3></section></summary><div class="impl-items"><section id="method.prepare-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#146-148">Source</a><a href="#method.prepare-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.prepare" class="fn">prepare</a>(&self) -> PreparedIncomingViewingKey</h4></section><section id="method.nf-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#150-152">Source</a><a href="#method.nf-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.nf" class="fn">nf</a>(&self, _note: &Note, _position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nullifier></h4></section><section id="method.account_id-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#154-156">Source</a><a href="#method.account_id-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a></h4></section><section id="method.key_scope-1" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#158-160">Source</a><a href="#method.key_scope-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E-1" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#95-113">Source</a><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-Box%3Cdyn+ScanningKeyOps%3CD,+AccountId,+Nf%3E%3E-1" class="anchor">§</a><h3 class="code-header">impl<D: Domain, AccountId, Nf> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf>></h3></section></summary><div class="impl-items"><section id="method.prepare-2" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#98-100">Source</a><a href="#method.prepare-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.prepare" class="fn">prepare</a>(&self) -> D::IncomingViewingKey</h4></section><section id="method.account_id-2" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#102-104">Source</a><a href="#method.account_id-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a></h4></section><section id="method.key_scope-2" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#106-108">Source</a><a href="#method.key_scope-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope></h4></section><section id="method.nf-2" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#110-112">Source</a><a href="#method.nf-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.nf" class="fn">nf</a>(&self, note: &D::Note, note_position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nf></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-%26K" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#75-93">Source</a><a href="#impl-ScanningKeyOps%3CD,+AccountId,+Nf%3E-for-%26K" class="anchor">§</a><h3 class="code-header">impl<D: Domain, AccountId, Nf, K: <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf>> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><D, AccountId, Nf> for <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&K</a></h3></section></summary><div class="impl-items"><section id="method.prepare-3" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#78-80">Source</a><a href="#method.prepare-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.prepare" class="fn">prepare</a>(&self) -> D::IncomingViewingKey</h4></section><section id="method.account_id-3" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#82-84">Source</a><a href="#method.account_id-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.account_id" class="fn">account_id</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&AccountId</a></h4></section><section id="method.key_scope-3" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#86-88">Source</a><a href="#method.key_scope-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.key_scope" class="fn">key_scope</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Scope></h4></section><section id="method.nf-3" class="method trait-impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#90-92">Source</a><a href="#method.nf-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.nf" class="fn">nf</a>(&self, note: &D::Note, note_position: Position) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Nf></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-ScanningKeyOps%3COrchardDomain,+AccountId,+Nullifier%3E-for-ScanningKey%3CIncomingViewingKey,+FullViewingKey,+AccountId%3E" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#164-186">Source</a><a href="#impl-ScanningKeyOps%3COrchardDomain,+AccountId,+Nullifier%3E-for-ScanningKey%3CIncomingViewingKey,+FullViewingKey,+AccountId%3E" class="anchor">§</a><h3 class="code-header">impl<AccountId> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><OrchardDomain, AccountId, Nullifier> for <a class="struct" href="struct.ScanningKey.html" title="struct zcash_client_backend::scanning::ScanningKey">ScanningKey</a><IncomingViewingKey, FullViewingKey, AccountId></h3><span class="item-info"><div class="stab portability">Available on <strong>crate feature <code>orchard</code></strong> only.</div></span></section><section id="impl-ScanningKeyOps%3CSaplingDomain,+AccountId,+Nullifier%3E-for-ScanningKey%3CSaplingIvk,+NullifierDerivingKey,+AccountId%3E" class="impl"><a class="src rightside" href="../../src/zcash_client_backend/scanning.rs.html#123-141">Source</a><a href="#impl-ScanningKeyOps%3CSaplingDomain,+AccountId,+Nullifier%3E-for-ScanningKey%3CSaplingIvk,+NullifierDerivingKey,+AccountId%3E" class="anchor">§</a><h3 class="code-header">impl<AccountId> <a class="trait" href="trait.ScanningKeyOps.html" title="trait zcash_client_backend::scanning::ScanningKeyOps">ScanningKeyOps</a><SaplingDomain, AccountId, Nullifier> for <a class="struct" href="struct.ScanningKey.html" title="struct zcash_client_backend::scanning::ScanningKey">ScanningKey</a><SaplingIvk, NullifierDerivingKey, AccountId></h3></section></div><script src="../../trait.impl/zcash_client_backend/scanning/trait.ScanningKeyOps.js" data-ignore-extern-crates="alloc,std" async></script></section></div></main></body></html> |