zcash_protocol/constants/regtest.rs
1//! # Regtest constants
2//!
3//! `regtest` is a `zcashd`-specific environment used for local testing. They mostly reuse
4//! the testnet constants.
5//! These constants are defined in [the `zcashd` codebase].
6//!
7//! [the `zcashd` codebase]: <https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L482-L496>
8
9/// The regtest cointype reuses the testnet cointype
10pub const COIN_TYPE: u32 = 1;
11
12/// The HRP for a Bech32-encoded regtest Sapling [`ExtendedSpendingKey`].
13///
14/// It is defined in [the `zcashd` codebase].
15///
16/// [`ExtendedSpendingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedSpendingKey.html
17/// [the `zcashd` codebase]: <https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L496>
18pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest";
19
20/// The HRP for a Bech32-encoded regtest Sapling [`ExtendedFullViewingKey`].
21///
22/// It is defined in [the `zcashd` codebase].
23///
24/// [`ExtendedFullViewingKey`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/zip32/struct.ExtendedFullViewingKey.html
25/// [the `zcashd` codebase]: <https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L494>
26pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling";
27
28/// The HRP for a Bech32-encoded regtest Sapling [`PaymentAddress`].
29///
30/// It is defined in [the `zcashd` codebase].
31///
32/// [`PaymentAddress`]: https://docs.rs/sapling-crypto/latest/sapling_crypto/struct.PaymentAddress.html
33/// [the `zcashd` codebase]: <https://github.com/zcash/zcash/blob/128d863fb8be39ee294fda397c1ce3ba3b889cb2/src/chainparams.cpp#L493>
34pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "zregtestsapling";
35
36/// The prefix for a Base58Check-encoded regtest Sprout address.
37///
38/// Defined in the [Zcash Protocol Specification section 5.6.3][sproutpaymentaddrencoding].
39/// Same as the testnet prefix.
40///
41/// [sproutpaymentaddrencoding]: https://zips.z.cash/protocol/protocol.pdf#sproutpaymentaddrencoding
42pub const B58_SPROUT_ADDRESS_PREFIX: [u8; 2] = [0x16, 0xb6];
43
44/// The prefix for a Base58Check-encoded regtest transparent [`PublicKeyHash`].
45/// Same as the testnet prefix.
46///
47/// [`PublicKeyHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html
48pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25];
49
50/// The prefix for a Base58Check-encoded regtest transparent [`ScriptHash`].
51/// Same as the testnet prefix.
52///
53/// [`ScriptHash`]: https://docs.rs/zcash_primitives/latest/zcash_primitives/legacy/enum.TransparentAddress.html
54pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba];
55
56/// The HRP for a Bech32m-encoded regtest [ZIP 320] TEX address.
57///
58/// [ZIP 320]: https://zips.z.cash/zip-0320
59pub const HRP_TEX_ADDRESS: &str = "texregtest";
60
61/// The HRP for a Bech32m-encoded regtest Unified Address.
62///
63/// Defined in [ZIP 316][zip-0316].
64///
65/// [zip-0316]: https://zips.z.cash/zip-0316
66pub const HRP_UNIFIED_ADDRESS: &str = "uregtest";
67
68/// The HRP for a Bech32m-encoded regtest Unified FVK.
69pub const HRP_UNIFIED_FVK: &str = "uviewregtest";
70
71/// The HRP for a Bech32m-encoded regtest Unified IVK.
72pub const HRP_UNIFIED_IVK: &str = "uivkregtest";