zebra_chain/parameters/
constants.rs

1//! Definitions of Zebra chain constants, including:
2//! - slow start interval,
3//! - slow start shift
4
5use crate::block::Height;
6
7/// An initial period from Genesis to this Height where the block subsidy is gradually incremented. [What is slow-start mining][slow-mining]
8///
9/// [slow-mining]: https://z.cash/support/faq/#what-is-slow-start-mining
10pub const SLOW_START_INTERVAL: Height = Height(20_000);
11
12/// `SlowStartShift()` as described in [protocol specification §7.8][7.8]
13///
14/// [7.8]: https://zips.z.cash/protocol/protocol.pdf#subsidies
15///
16/// This calculation is exact, because `SLOW_START_INTERVAL` is divisible by 2.
17pub const SLOW_START_SHIFT: Height = Height(SLOW_START_INTERVAL.0 / 2);
18
19/// Magic numbers used to identify different Zcash networks.
20pub mod magics {
21    use crate::parameters::network::magic::Magic;
22
23    /// The production mainnet.
24    pub const MAINNET: Magic = Magic([0x24, 0xe9, 0x27, 0x64]);
25    /// The testnet.
26    pub const TESTNET: Magic = Magic([0xfa, 0x1a, 0xf9, 0xbf]);
27    /// The regtest, see <https://github.com/zcash/zcash/blob/master/src/chainparams.cpp#L716-L719>
28    pub const REGTEST: Magic = Magic([0xaa, 0xe8, 0x3f, 0x5f]);
29}