43 lines
17 KiB
HTML
43 lines
17 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="Constants associated with a given Zcash network."><title>NetworkConstants in zcash_protocol::consensus - 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_protocol" 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_protocol/index.html">zcash_<wbr>protocol</a><span class="version">0.5.2</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Network<wbr>Constants</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.b58_pubkey_address_prefix" title="b58_pubkey_address_prefix">b58_pubkey_address_prefix</a></li><li><a href="#tymethod.b58_script_address_prefix" title="b58_script_address_prefix">b58_script_address_prefix</a></li><li><a href="#tymethod.b58_sprout_address_prefix" title="b58_sprout_address_prefix">b58_sprout_address_prefix</a></li><li><a href="#tymethod.coin_type" title="coin_type">coin_type</a></li><li><a href="#tymethod.hrp_sapling_extended_full_viewing_key" title="hrp_sapling_extended_full_viewing_key">hrp_sapling_extended_full_viewing_key</a></li><li><a href="#tymethod.hrp_sapling_extended_spending_key" title="hrp_sapling_extended_spending_key">hrp_sapling_extended_spending_key</a></li><li><a href="#tymethod.hrp_sapling_payment_address" title="hrp_sapling_payment_address">hrp_sapling_payment_address</a></li><li><a href="#tymethod.hrp_tex_address" title="hrp_tex_address">hrp_tex_address</a></li><li><a href="#tymethod.hrp_unified_address" title="hrp_unified_address">hrp_unified_address</a></li><li><a href="#tymethod.hrp_unified_fvk" title="hrp_unified_fvk">hrp_unified_fvk</a></li><li><a href="#tymethod.hrp_unified_ivk" title="hrp_unified_ivk">hrp_unified_ivk</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In zcash_<wbr>protocol::<wbr>consensus</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_protocol</a>::<wbr><a href="index.html">consensus</a></div><h1>Trait <span class="trait">NetworkConstants</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_protocol/consensus.rs.html#130-206">Source</a> </span></div><pre class="rust item-decl"><code>pub trait NetworkConstants: <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> {
|
|
// Required methods
|
|
fn <a href="#tymethod.coin_type" class="fn">coin_type</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_sapling_extended_spending_key" class="fn">hrp_sapling_extended_spending_key</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_sapling_extended_full_viewing_key" class="fn">hrp_sapling_extended_full_viewing_key</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_sapling_payment_address" class="fn">hrp_sapling_payment_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.b58_sprout_address_prefix" class="fn">b58_sprout_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>];
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.b58_pubkey_address_prefix" class="fn">b58_pubkey_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>];
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.b58_script_address_prefix" class="fn">b58_script_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>];
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_tex_address" class="fn">hrp_tex_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_unified_address" class="fn">hrp_unified_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_unified_fvk" class="fn">hrp_unified_fvk</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
<span class="item-spacer"></span> fn <a href="#tymethod.hrp_unified_ivk" class="fn">hrp_unified_ivk</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>;
|
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Constants associated with a given Zcash network.</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.coin_type" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#134">Source</a><h4 class="code-header">fn <a href="#tymethod.coin_type" class="fn">coin_type</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></h4></section></summary><div class="docblock"><p>The coin type for ZEC, as defined by <a href="https://github.com/satoshilabs/slips/blob/master/slip-0044.md">SLIP 44</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_sapling_extended_spending_key" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#142">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_sapling_extended_spending_key" class="fn">hrp_sapling_extended_spending_key</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the human-readable prefix for Bech32-encoded Sapling extended spending keys
|
|
for the network to which this NetworkConstants value applies.</p>
|
|
<p>Defined in <a href="https://github.com/zcash/zips/blob/main/zips/zip-0032.rst">ZIP 32</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_sapling_extended_full_viewing_key" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#150">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_sapling_extended_full_viewing_key" class="fn">hrp_sapling_extended_full_viewing_key</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the human-readable prefix for Bech32-encoded Sapling extended full
|
|
viewing keys for the network to which this NetworkConstants value applies.</p>
|
|
<p>Defined in <a href="https://github.com/zcash/zips/blob/master/zip-0032.rst">ZIP 32</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_sapling_payment_address" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#158">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_sapling_payment_address" class="fn">hrp_sapling_payment_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the Bech32-encoded human-readable prefix for Sapling payment addresses
|
|
for the network to which this NetworkConstants value applies.</p>
|
|
<p>Defined in section 5.6.4 of the <a href="https://github.com/zcash/zips/blob/main/rendered/protocol/protocol.pdf">Zcash Protocol Specification</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.b58_sprout_address_prefix" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#167">Source</a><h4 class="code-header">fn <a href="#tymethod.b58_sprout_address_prefix" class="fn">b58_sprout_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]</h4></section></summary><div class="docblock"><p>Returns the human-readable prefix for Base58Check-encoded Sprout
|
|
payment addresses for the network to which this NetworkConstants value
|
|
applies.</p>
|
|
<p>Defined in the <a href="https://zips.z.cash/protocol/protocol.pdf#sproutpaymentaddrencoding">Zcash Protocol Specification section 5.6.3</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.b58_pubkey_address_prefix" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#172">Source</a><h4 class="code-header">fn <a href="#tymethod.b58_pubkey_address_prefix" class="fn">b58_pubkey_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]</h4></section></summary><div class="docblock"><p>Returns the human-readable prefix for Base58Check-encoded transparent
|
|
pay-to-public-key-hash payment addresses for the network to which this NetworkConstants value
|
|
applies.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.b58_script_address_prefix" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#176">Source</a><h4 class="code-header">fn <a href="#tymethod.b58_script_address_prefix" class="fn">b58_script_address_prefix</a>(&self) -> [<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">2</a>]</h4></section></summary><div class="docblock"><p>Returns the human-readable prefix for Base58Check-encoded transparent pay-to-script-hash
|
|
payment addresses for the network to which this NetworkConstants value applies.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_tex_address" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#184">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_tex_address" class="fn">hrp_tex_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the Bech32-encoded human-readable prefix for TEX addresses, for the
|
|
network to which this <code>NetworkConstants</code> value applies.</p>
|
|
<p>Defined in <a href="https://zips.z.cash/zip-0320">ZIP 320</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_unified_address" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#191">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_unified_address" class="fn">hrp_unified_address</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>The HRP for a Bech32m-encoded mainnet Unified Address.</p>
|
|
<p>Defined in <a href="https://zips.z.cash/zip-0316">ZIP 316</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_unified_fvk" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#198">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_unified_fvk" class="fn">hrp_unified_fvk</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>The HRP for a Bech32m-encoded mainnet Unified FVK.</p>
|
|
<p>Defined in <a href="https://zips.z.cash/zip-0316">ZIP 316</a>.</p>
|
|
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.hrp_unified_ivk" class="method"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#205">Source</a><h4 class="code-header">fn <a href="#tymethod.hrp_unified_ivk" class="fn">hrp_unified_ivk</a>(&self) -> &'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>The HRP for a Bech32m-encoded mainnet Unified IVK.</p>
|
|
<p>Defined in <a href="https://zips.z.cash/zip-0316">ZIP 316</a>.</p>
|
|
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/nightly/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-NetworkConstants-for-NetworkType" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#225-313">Source</a><a href="#impl-NetworkConstants-for-NetworkType" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.NetworkConstants.html" title="trait zcash_protocol::consensus::NetworkConstants">NetworkConstants</a> for <a class="enum" href="enum.NetworkType.html" title="enum zcash_protocol::consensus::NetworkType">NetworkType</a></h3></section><section id="impl-NetworkConstants-for-P" class="impl"><a class="src rightside" href="../../src/zcash_protocol/consensus.rs.html#341-385">Source</a><a href="#impl-NetworkConstants-for-P" class="anchor">§</a><h3 class="code-header">impl<P: <a class="trait" href="trait.Parameters.html" title="trait zcash_protocol::consensus::Parameters">Parameters</a>> <a class="trait" href="trait.NetworkConstants.html" title="trait zcash_protocol::consensus::NetworkConstants">NetworkConstants</a> for P</h3></section></div><script src="../../trait.impl/zcash_protocol/consensus/trait.NetworkConstants.js" async></script></section></div></main></body></html> |