Skip to main content

zebra_chain/parameters/network/subsidy/constants/
mainnet.rs

1//! Mainnet-specific constants for block subsidies.
2
3use lazy_static::lazy_static;
4
5use crate::parameters::{
6    constants::activation_heights,
7    network::{Amount, Height, NonNegative},
8    subsidy::{
9        constants::POST_NU6_FUNDING_STREAM_NUM_BLOCKS, FundingStreamReceiver,
10        FundingStreamRecipient, FundingStreams,
11    },
12};
13
14/// The start height of post-NU6 funding streams on Mainnet as described in [ZIP-1015](https://zips.z.cash/zip-1015).
15pub(crate) const POST_NU6_FUNDING_STREAM_START_HEIGHT: u32 = 2_726_400;
16
17/// The one-time lockbox disbursement output addresses and amounts expected in the NU6.1 activation block's
18/// coinbase transaction on Mainnet.
19///
20/// See:
21///
22/// - <https://zips.z.cash/zip-0271#one-timelockboxdisbursement>
23/// - <https://zips.z.cash/zip-0214#mainnet-recipients-for-revision-2>
24pub(crate) const NU6_1_LOCKBOX_DISBURSEMENTS: [(&str, Amount<NonNegative>); 10] = [(
25    "t3ev37Q2uL1sfTsiJQJiWJoFzQpDhmnUwYo",
26    EXPECTED_NU6_1_LOCKBOX_DISBURSEMENTS_TOTAL.div_exact(10),
27); 10];
28
29/// The expected total amount of the one-time lockbox disbursement on Mainnet.
30/// See: <https://zips.z.cash/zip-0271#one-timelockboxdisbursement>.
31pub(crate) const EXPECTED_NU6_1_LOCKBOX_DISBURSEMENTS_TOTAL: Amount<NonNegative> =
32    Amount::new_from_zec(78_750);
33
34/// The post-NU6 funding stream height range on Mainnet
35pub(crate) const POST_NU6_FUNDING_STREAM_START_RANGE: std::ops::Range<Height> =
36    Height(POST_NU6_FUNDING_STREAM_START_HEIGHT)
37        ..Height(POST_NU6_FUNDING_STREAM_START_HEIGHT + POST_NU6_FUNDING_STREAM_NUM_BLOCKS);
38
39/// Number of addresses for each funding stream in the Mainnet.
40/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
41/// however we know this value beforehand so we prefer to make it a constant instead.
42///
43/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
44pub(crate) const FUNDING_STREAMS_NUM_ADDRESSES: usize = 48;
45
46/// List of addresses for the ECC funding stream in the Mainnet.
47pub(crate) const FUNDING_STREAM_ECC_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] = [
48    "t3LmX1cxWPPPqL4TZHx42HU3U5ghbFjRiif",
49    "t3Toxk1vJQ6UjWQ42tUJz2rV2feUWkpbTDs",
50    "t3ZBdBe4iokmsjdhMuwkxEdqMCFN16YxKe6",
51    "t3ZuaJziLM8xZ32rjDUzVjVtyYdDSz8GLWB",
52    "t3bAtYWa4bi8VrtvqySxnbr5uqcG9czQGTZ",
53    "t3dktADfb5Rmxncpe1HS5BRS5Gcj7MZWYBi",
54    "t3hgskquvKKoCtvxw86yN7q8bzwRxNgUZmc",
55    "t3R1VrLzwcxAZzkX4mX3KGbWpNsgtYtMntj",
56    "t3ff6fhemqPMVujD3AQurxRxTdvS1pPSaa2",
57    "t3cEUQFG3KYnFG6qYhPxSNgGi3HDjUPwC3J",
58    "t3WR9F5U4QvUFqqx9zFmwT6xFqduqRRXnaa",
59    "t3PYc1LWngrdUrJJbHkYPCKvJuvJjcm85Ch",
60    "t3bgkjiUeatWNkhxY3cWyLbTxKksAfk561R",
61    "t3Z5rrR8zahxUpZ8itmCKhMSfxiKjUp5Dk5",
62    "t3PU1j7YW3fJ67jUbkGhSRto8qK2qXCUiW3",
63    "t3S3yaT7EwNLaFZCamfsxxKwamQW2aRGEkh",
64    "t3eutXKJ9tEaPSxZpmowhzKhPfJvmtwTEZK",
65    "t3gbTb7brxLdVVghSPSd3ycGxzHbUpukeDm",
66    "t3UCKW2LrHFqPMQFEbZn6FpjqnhAAbfpMYR",
67    "t3NyHsrnYbqaySoQqEQRyTWkjvM2PLkU7Uu",
68    "t3QEFL6acxuZwiXtW3YvV6njDVGjJ1qeaRo",
69    "t3PdBRr2S1XTDzrV8bnZkXF3SJcrzHWe1wj",
70    "t3ZWyRPpWRo23pKxTLtWsnfEKeq9T4XPxKM",
71    "t3he6QytKCTydhpztykFsSsb9PmBT5JBZLi",
72    "t3VWxWDsLb2TURNEP6tA1ZSeQzUmPKFNxRY",
73    "t3NmWLvZkbciNAipauzsFRMxoZGqmtJksbz",
74    "t3cKr4YxVPvPBG1mCvzaoTTdBNokohsRJ8n",
75    "t3T3smGZn6BoSFXWWXa1RaoQdcyaFjMfuYK",
76    "t3gkDUe9Gm4GGpjMk86TiJZqhztBVMiUSSA",
77    "t3eretuBeBXFHe5jAqeSpUS1cpxVh51fAeb",
78    "t3dN8g9zi2UGJdixGe9txeSxeofLS9t3yFQ",
79    "t3S799pq9sYBFwccRecoTJ3SvQXRHPrHqvx",
80    "t3fhYnv1S5dXwau7GED3c1XErzt4n4vDxmf",
81    "t3cmE3vsBc5xfDJKXXZdpydCPSdZqt6AcNi",
82    "t3h5fPdjJVHaH4HwynYDM5BB3J7uQaoUwKi",
83    "t3Ma35c68BgRX8sdLDJ6WR1PCrKiWHG4Da9",
84    "t3LokMKPL1J8rkJZvVpfuH7dLu6oUWqZKQK",
85    "t3WFFGbEbhJWnASZxVLw2iTJBZfJGGX73mM",
86    "t3L8GLEsUn4QHNaRYcX3EGyXmQ8kjpT1zTa",
87    "t3PgfByBhaBSkH8uq4nYJ9ZBX4NhGCJBVYm",
88    "t3WecsqKDhWXD4JAgBVcnaCC2itzyNZhJrv",
89    "t3ZG9cSfopnsMQupKW5v9sTotjcP5P6RTbn",
90    "t3hC1Ywb5zDwUYYV8LwhvF5rZ6m49jxXSG5",
91    "t3VgMqDL15ZcyQDeqBsBW3W6rzfftrWP2yB",
92    "t3LC94Y6BwLoDtBoK2NuewaEbnko1zvR9rm",
93    "t3cWCUZJR3GtALaTcatrrpNJ3MGbMFVLRwQ",
94    "t3YYF4rPLVxDcF9hHFsXyc5Yq1TFfbojCY6",
95    "t3XHAGxRP2FNfhAjxGjxbrQPYtQQjc3RCQD",
96];
97
98/// Number of founder addresses on Mainnet.
99pub(crate) const NUM_FOUNDER_ADDRESSES: usize = 48;
100
101/// List of founder addresses on Mainnet.
102pub(crate) const FOUNDER_ADDRESS_LIST: [&str; NUM_FOUNDER_ADDRESSES] = [
103    "t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd",
104    "t3cL9AucCajm3HXDhb5jBnJK2vapVoXsop3",
105    "t3fqvkzrrNaMcamkQMwAyHRjfDdM2xQvDTR",
106    "t3TgZ9ZT2CTSK44AnUPi6qeNaHa2eC7pUyF",
107    "t3SpkcPQPfuRYHsP5vz3Pv86PgKo5m9KVmx",
108    "t3Xt4oQMRPagwbpQqkgAViQgtST4VoSWR6S",
109    "t3ayBkZ4w6kKXynwoHZFUSSgXRKtogTXNgb",
110    "t3adJBQuaa21u7NxbR8YMzp3km3TbSZ4MGB",
111    "t3K4aLYagSSBySdrfAGGeUd5H9z5Qvz88t2",
112    "t3RYnsc5nhEvKiva3ZPhfRSk7eyh1CrA6Rk",
113    "t3Ut4KUq2ZSMTPNE67pBU5LqYCi2q36KpXQ",
114    "t3ZnCNAvgu6CSyHm1vWtrx3aiN98dSAGpnD",
115    "t3fB9cB3eSYim64BS9xfwAHQUKLgQQroBDG",
116    "t3cwZfKNNj2vXMAHBQeewm6pXhKFdhk18kD",
117    "t3YcoujXfspWy7rbNUsGKxFEWZqNstGpeG4",
118    "t3bLvCLigc6rbNrUTS5NwkgyVrZcZumTRa4",
119    "t3VvHWa7r3oy67YtU4LZKGCWa2J6eGHvShi",
120    "t3eF9X6X2dSo7MCvTjfZEzwWrVzquxRLNeY",
121    "t3esCNwwmcyc8i9qQfyTbYhTqmYXZ9AwK3X",
122    "t3M4jN7hYE2e27yLsuQPPjuVek81WV3VbBj",
123    "t3gGWxdC67CYNoBbPjNvrrWLAWxPqZLxrVY",
124    "t3LTWeoxeWPbmdkUD3NWBquk4WkazhFBmvU",
125    "t3P5KKX97gXYFSaSjJPiruQEX84yF5z3Tjq",
126    "t3f3T3nCWsEpzmD35VK62JgQfFig74dV8C9",
127    "t3Rqonuzz7afkF7156ZA4vi4iimRSEn41hj",
128    "t3fJZ5jYsyxDtvNrWBeoMbvJaQCj4JJgbgX",
129    "t3Pnbg7XjP7FGPBUuz75H65aczphHgkpoJW",
130    "t3WeKQDxCijL5X7rwFem1MTL9ZwVJkUFhpF",
131    "t3Y9FNi26J7UtAUC4moaETLbMo8KS1Be6ME",
132    "t3aNRLLsL2y8xcjPheZZwFy3Pcv7CsTwBec",
133    "t3gQDEavk5VzAAHK8TrQu2BWDLxEiF1unBm",
134    "t3Rbykhx1TUFrgXrmBYrAJe2STxRKFL7G9r",
135    "t3aaW4aTdP7a8d1VTE1Bod2yhbeggHgMajR",
136    "t3YEiAa6uEjXwFL2v5ztU1fn3yKgzMQqNyo",
137    "t3g1yUUwt2PbmDvMDevTCPWUcbDatL2iQGP",
138    "t3dPWnep6YqGPuY1CecgbeZrY9iUwH8Yd4z",
139    "t3QRZXHDPh2hwU46iQs2776kRuuWfwFp4dV",
140    "t3enhACRxi1ZD7e8ePomVGKn7wp7N9fFJ3r",
141    "t3PkLgT71TnF112nSwBToXsD77yNbx2gJJY",
142    "t3LQtHUDoe7ZhhvddRv4vnaoNAhCr2f4oFN",
143    "t3fNcdBUbycvbCtsD2n9q3LuxG7jVPvFB8L",
144    "t3dKojUU2EMjs28nHV84TvkVEUDu1M1FaEx",
145    "t3aKH6NiWN1ofGd8c19rZiqgYpkJ3n679ME",
146    "t3MEXDF9Wsi63KwpPuQdD6by32Mw2bNTbEa",
147    "t3WDhPfik343yNmPTqtkZAoQZeqA83K7Y3f",
148    "t3PSn5TbMMAEw7Eu36DYctFezRzpX1hzf3M",
149    "t3R3Y5vnBLrEn8L6wFjPjBLnxSUQsKnmFpv",
150    "t3Pcm737EsVkGTbhsu2NekKtJeG92mvYyoN",
151];
152
153/// List of addresses for the Zcash Foundation funding stream in the Mainnet.
154pub(crate) const FUNDING_STREAM_ZF_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] =
155    ["t3dvVE3SQEi7kqNzwrfNePxZ1d4hUyztBA1"; FUNDING_STREAMS_NUM_ADDRESSES];
156
157/// List of addresses for the Major Grants funding stream in the Mainnet.
158pub(crate) const FUNDING_STREAM_MG_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] =
159    ["t3XyYW8yBFRuMnfvm5KLGFbEVz25kckZXym"; FUNDING_STREAMS_NUM_ADDRESSES];
160
161/// Number of addresses for each post-NU6 funding stream on Mainnet.
162/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
163/// however we know this value beforehand so we prefer to make it a constant instead.
164///
165/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
166pub(crate) const POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES: usize = 12;
167
168/// List of addresses for the Major Grants post-NU6 funding stream on Mainnet administered by the Financial Privacy Fund (FPF).
169pub(crate) const POST_NU6_FUNDING_STREAM_FPF_ADDRESSES: [&str;
170    POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES] =
171    ["t3cFfPt1Bcvgez9ZbMBFWeZsskxTkPzGCow"; POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES];
172
173/// Number of addresses for each post-NU6.1 funding stream on Mainnet.
174/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
175/// however we know this value beforehand so we prefer to make it a constant instead.
176///
177/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
178pub(crate) const POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES: usize = 36;
179
180/// List of addresses for the Major Grants post-NU6.1 funding stream on Mainnet administered by the Financial Privacy Fund (FPF).
181pub(crate) const POST_NU6_1_FUNDING_STREAM_FPF_ADDRESSES: [&str;
182    POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES] =
183    ["t3cFfPt1Bcvgez9ZbMBFWeZsskxTkPzGCow"; POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES];
184
185lazy_static! {
186    /// The funding streams for Mainnet as described in:
187    /// - [protocol specification §7.10.1][7.10.1]
188    /// - [ZIP-1015](https://zips.z.cash/zip-1015)
189    /// - [ZIP-214#funding-streams](https://zips.z.cash/zip-0214#funding-streams)
190    ///
191    /// [7.10.1]: https://zips.z.cash/protocol/protocol.pdf#zip214fundingstreams
192    pub(crate) static ref FUNDING_STREAMS: Vec<FundingStreams> = vec![
193        FundingStreams {
194            height_range: Height(1_046_400)..Height(2_726_400),
195            recipients: [
196                (
197                    FundingStreamReceiver::Ecc,
198                    FundingStreamRecipient::new(7, FUNDING_STREAM_ECC_ADDRESSES),
199                ),
200                (
201                    FundingStreamReceiver::ZcashFoundation,
202                    FundingStreamRecipient::new(5, FUNDING_STREAM_ZF_ADDRESSES),
203                ),
204                (
205                    FundingStreamReceiver::MajorGrants,
206                    FundingStreamRecipient::new(8, FUNDING_STREAM_MG_ADDRESSES),
207                ),
208            ]
209            .into_iter()
210            .collect(),
211        },
212        FundingStreams {
213            height_range: POST_NU6_FUNDING_STREAM_START_RANGE,
214            recipients: [
215                (
216                    FundingStreamReceiver::Deferred,
217                    FundingStreamRecipient::new::<[&str; 0], &str>(12, []),
218                ),
219                (
220                    FundingStreamReceiver::MajorGrants,
221                    FundingStreamRecipient::new(8, POST_NU6_FUNDING_STREAM_FPF_ADDRESSES),
222                ),
223            ]
224            .into_iter()
225            .collect(),
226        },
227
228        FundingStreams {
229            height_range: activation_heights::mainnet::NU6_1..Height(4_406_400),
230            recipients: [
231                (
232                    FundingStreamReceiver::Deferred,
233                    FundingStreamRecipient::new::<[&str; 0], &str>(12, []),
234                ),
235                (
236                    FundingStreamReceiver::MajorGrants,
237                    FundingStreamRecipient::new(8, POST_NU6_1_FUNDING_STREAM_FPF_ADDRESSES),
238                ),
239            ]
240            .into_iter()
241            .collect(),
242        },
243    ];
244
245}