1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use crate::format::ZcashFormat;
use wagyu_model::{AddressError, ChildIndex, Network, NetworkError, PrivateKeyError};
pub mod mainnet;
pub use self::mainnet::*;
pub mod testnet;
pub use self::testnet::*;
pub trait ZcashNetwork: Network {
const HD_PURPOSE: ChildIndex = ChildIndex::Hardened(32);
const HD_COIN_TYPE: ChildIndex;
fn to_address_prefix(format: &ZcashFormat) -> Vec<u8>;
fn from_address_prefix(prefix: &Vec<u8>) -> Result<Self, AddressError>;
fn to_wif_prefix() -> u8;
fn from_wif_prefix(prefix: u8) -> Result<Self, PrivateKeyError>;
fn to_sprout_spending_key_prefix() -> [u8; 2];
fn to_sprout_viewing_key_prefix() -> [u8; 3];
fn to_sapling_spending_key_prefix() -> String;
fn to_sapling_viewing_key_prefix() -> String;
fn to_extended_private_key_prefix() -> String;
fn from_extended_private_key_prefix(prefix: &str) -> Result<Self, NetworkError>;
fn to_extended_public_key_prefix() -> String;
fn from_extended_public_key_prefix(prefix: &str) -> Result<Self, NetworkError>;
}