65 lines
14 KiB
HTML
65 lines
14 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 crate for implementing Zcash light clients."><title>zcash_client_backend - 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-1a91846b.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.88.0-nightly (27d6200a7 2025-05-06)" 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="../crates.js"></script><script defer src="../static.files/main-7ef8a74a.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.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 mod crate"><!--[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.18.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#design" title="Design">Design</a><ul><li><a href="#wallet-sync" title="Wallet sync">Wallet sync</a></li><li><a href="#feature-flags" title="Feature flags">Feature flags</a></li></ul></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li><li><a href="#types" title="Type Aliases">Type Aliases</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>zcash_client_backend</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/lib.rs.html#1-107">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><em>A crate for implementing Zcash light clients.</em></p>
|
||
<p><code>zcash_client_backend</code> contains Rust structs and traits for creating shielded Zcash
|
||
light clients.</p>
|
||
<h2 id="design"><a class="doc-anchor" href="#design">§</a>Design</h2><h3 id="wallet-sync"><a class="doc-anchor" href="#wallet-sync">§</a>Wallet sync</h3>
|
||
<p>The APIs in the <a href="data_api/chain/index.html" title="mod zcash_client_backend::data_api::chain"><code>data_api::chain</code></a> module can be used to implement the following
|
||
synchronization flow:</p>
|
||
<div class="example-wrap"><pre class="language-text"><code> ┌─────────────┐ ┌─────────────┐
|
||
│Get required │ │ Update │
|
||
│subtree root │─▶│subtree roots│
|
||
│ range │ └─────────────┘
|
||
└─────────────┘ │
|
||
▼
|
||
┌─────────┐
|
||
│ Update │
|
||
┌────────────────────────────────▶│chain tip│◀──────┐
|
||
│ └─────────┘ │
|
||
│ │ │
|
||
│ ▼ │
|
||
┌─────────────┐ ┌────────────┐ ┌─────────────┐ │
|
||
│ Truncate │ │Split range │ │Get suggested│ │
|
||
│ wallet to │ │into batches│◀─│ scan ranges │ │
|
||
│rewind height│ └────────────┘ └─────────────┘ │
|
||
└─────────────┘ │ │
|
||
▲ ╱│╲ │
|
||
│ ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │
|
||
┌────────┐ ┌───────────────┐ │ │
|
||
│ Choose │ │ │Download blocks│ │
|
||
│ rewind │ │ to cache │ │ │
|
||
│ height │ │ └───────────────┘ .───────────────────.
|
||
└────────┘ │ │ ( Scan ranges updated )
|
||
▲ │ ▼ `───────────────────'
|
||
│ ┌───────────┐ │ ▲
|
||
.───────────────┴─. │Scan cached│ .─────────. │
|
||
( Continuity error )◀────│ blocks │──▶( Success )───────┤
|
||
`───────────────┬─' └───────────┘ `─────────' │
|
||
│ │ │
|
||
│ ┌──────┴───────┐ │
|
||
▼ ▼ │ ▼
|
||
│┌─────────────┐┌─────────────┐ ┌──────────────────────┐
|
||
│Delete blocks││ Enhance ││ │Update wallet balance │
|
||
││ from cache ││transactions │ │ and sync progress │
|
||
└─────────────┘└─────────────┘│ └──────────────────────┘
|
||
└ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─</code></pre></div><h3 id="feature-flags"><a class="doc-anchor" href="#feature-flags">§</a>Feature flags</h3>
|
||
<ul>
|
||
<li><strong><code>lightwalletd-tonic</code></strong> — Enables the <code>tonic</code> gRPC client bindings for connecting to a <code>lightwalletd</code> server.</li>
|
||
<li><strong><code>lightwalletd-tonic-tls-webpki-roots</code></strong> — Enables the <code>tls-webpki-roots</code> feature of <code>tonic</code>.</li>
|
||
<li><strong><code>lightwalletd-tonic-transport</code></strong> — Enables the <code>transport</code> feature of <code>tonic</code> producing a fully-featured client and server implementation</li>
|
||
<li><strong><code>transparent-inputs</code></strong> — Enables receiving transparent funds and shielding them.</li>
|
||
<li><strong><code>orchard</code></strong> — Enables receiving and spending Orchard funds.</li>
|
||
<li><strong><code>pczt</code></strong> — Enables creating partially-constructed transactions for use in hardware wallet and multisig scenarios.</li>
|
||
<li><strong><code>sync</code></strong> — Exposes a wallet synchronization function that implements the necessary state machine.</li>
|
||
<li><strong><code>tor</code></strong> — Exposes a Tor client for hiding a wallet’s IP address while performing certain wallet
|
||
operations.</li>
|
||
<li><strong><code>test-dependencies</code></strong> — Exposes APIs that are useful for testing, such as <code>proptest</code> strategies.</li>
|
||
<li><strong><code>non-standard-fees</code></strong> — Exposes APIs that allow calculation of non-standard fees.</li>
|
||
</ul>
|
||
<h4 id="experimental-features"><a class="doc-anchor" href="#experimental-features">§</a>Experimental features</h4>
|
||
<ul>
|
||
<li><strong><code>unstable</code></strong> — Exposes unstable APIs. Their behaviour may change at any time.</li>
|
||
<li><strong><code>unstable-serialization</code></strong> — Exposes APIs for unstable serialization formats. These may change at any time.</li>
|
||
<li><strong><code>unstable-spanning-tree</code></strong> — Exposes the <a href="data_api/scanning/spanning_tree/index.html" title="mod zcash_client_backend::data_api::scanning::spanning_tree"><code>data_api::scanning::spanning_tree</code></a> module.</li>
|
||
</ul>
|
||
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="address/index.html" title="mod zcash_client_backend::address">address</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dt><a class="mod" href="data_api/index.html" title="mod zcash_client_backend::data_api">data_<wbr>api</a></dt><dd>Utilities for Zcash wallet construction</dd><dt><a class="mod" href="encoding/index.html" title="mod zcash_client_backend::encoding">encoding</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dt><a class="mod" href="fees/index.html" title="mod zcash_client_backend::fees">fees</a></dt><dt><a class="mod" href="keys/index.html" title="mod zcash_client_backend::keys">keys</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dt><a class="mod" href="proposal/index.html" title="mod zcash_client_backend::proposal">proposal</a></dt><dd>Types related to the construction and evaluation of transaction proposals.</dd><dt><a class="mod" href="proto/index.html" title="mod zcash_client_backend::proto">proto</a></dt><dd>This module contains generated code for handling light client protobuf structs.</dd><dt><a class="mod" href="scan/index.html" title="mod zcash_client_backend::scan">scan</a></dt><dt><a class="mod" href="scanning/index.html" title="mod zcash_client_backend::scanning">scanning</a></dt><dd>Tools for scanning a compact representation of the Zcash block chain.</dd><dt><a class="mod" href="serialization/index.html" title="mod zcash_client_backend::serialization">serialization</a><wbr><span class="stab portability" title="Available on crate feature `unstable-serialization` only"><code>unstable-serialization</code></span></dt><dt><a class="mod" href="sync/index.html" title="mod zcash_client_backend::sync">sync</a><wbr><span class="stab portability" title="Available on crate feature `sync` only"><code>sync</code></span></dt><dd>Implementation of the synchronization flow described in the crate root.</dd><dt><a class="mod" href="wallet/index.html" title="mod zcash_client_backend::wallet">wallet</a></dt><dd>Structs representing transaction data scanned from the block chain by a wallet or
|
||
light client.</dd><dt><a class="mod" href="zip321/index.html" title="mod zcash_client_backend::zip321">zip321</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.DecryptedOutput.html" title="struct zcash_client_backend::DecryptedOutput">Decrypted<wbr>Output</a></dt><dd>A decrypted shielded output.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.TransferType.html" title="enum zcash_client_backend::TransferType">Transfer<wbr>Type</a></dt><dd>An enumeration of the possible relationships a TXO can have to the wallet.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.decrypt_transaction.html" title="fn zcash_client_backend::decrypt_transaction">decrypt_<wbr>transaction</a></dt><dd>Scans a [<code>Transaction</code>] for any information that can be decrypted by the set of
|
||
<a href="keys/struct.UnifiedFullViewingKey.html" title="struct zcash_client_backend::keys::UnifiedFullViewingKey"><code>UnifiedFullViewingKey</code></a>s.</dd></dl><h2 id="types" class="section-header">Type Aliases<a href="#types" class="anchor">§</a></h2><dl class="item-table"><dt><a class="type" href="type.PoolType.html" title="type zcash_client_backend::PoolType">Pool<wbr>Type</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt><dt><a class="type" href="type.ShieldedProtocol.html" title="type zcash_client_backend::ShieldedProtocol">Shielded<wbr>Protocol</a><wbr><span class="stab deprecated" title="">Deprecated</span></dt></dl></section></div></main></body></html> |