Skip to main content

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

1//! Testnet-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 first halving height in the testnet is at block height `1_116_000`
15/// as specified in [protocol specification §7.10.1][7.10.1]
16///
17/// [7.10.1]: https://zips.z.cash/protocol/protocol.pdf#zip214fundingstreams
18pub(crate) const FIRST_HALVING: Height = Height(1_116_000);
19
20/// The start height of post-NU6 funding streams on Testnet as described in [ZIP-1015](https://zips.z.cash/zip-1015).
21pub(crate) const POST_NU6_FUNDING_STREAM_START_HEIGHT: u32 = 2_976_000;
22
23/// The one-time lockbox disbursement output addresses and amounts expected in the NU6.1 activation block's
24/// coinbase transaction on Testnet.
25/// See:
26/// - <https://zips.z.cash/zip-0271#one-timelockboxdisbursement>
27/// - <https://zips.z.cash/zip-0214#testnet-recipients-for-revision-2>
28pub(crate) const NU6_1_LOCKBOX_DISBURSEMENTS: [(&str, Amount<NonNegative>); 10] = [(
29    "t2RnBRiqrN1nW4ecZs1Fj3WWjNdnSs4kiX8",
30    EXPECTED_NU6_1_LOCKBOX_DISBURSEMENTS_TOTAL.div_exact(10),
31); 10];
32
33/// The expected total amount of the one-time lockbox disbursement on Testnet.
34/// See <https://zips.z.cash/zip-0271#one-timelockboxdisbursement>.
35pub(crate) const EXPECTED_NU6_1_LOCKBOX_DISBURSEMENTS_TOTAL: Amount<NonNegative> =
36    Amount::new_from_zec(78_750);
37
38/// The post-NU6 funding stream height range on Testnet
39pub(crate) const POST_NU6_FUNDING_STREAM_START_RANGE: std::ops::Range<Height> =
40    Height(POST_NU6_FUNDING_STREAM_START_HEIGHT)
41        ..Height(POST_NU6_FUNDING_STREAM_START_HEIGHT + POST_NU6_FUNDING_STREAM_NUM_BLOCKS);
42
43/// Number of addresses for each funding stream in the Testnet.
44/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
45/// however we know this value beforehand so we prefer to make it a constant instead.
46///
47/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
48pub(crate) const FUNDING_STREAMS_NUM_ADDRESSES: usize = 51;
49
50/// List of addresses for the ECC funding stream in the Testnet.
51pub(crate) const FUNDING_STREAM_ECC_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] = [
52    "t26ovBdKAJLtrvBsE2QGF4nqBkEuptuPFZz",
53    "t26ovBdKAJLtrvBsE2QGF4nqBkEuptuPFZz",
54    "t26ovBdKAJLtrvBsE2QGF4nqBkEuptuPFZz",
55    "t26ovBdKAJLtrvBsE2QGF4nqBkEuptuPFZz",
56    "t2NNHrgPpE388atmWSF4DxAb3xAoW5Yp45M",
57    "t2VMN28itPyMeMHBEd9Z1hm6YLkQcGA1Wwe",
58    "t2CHa1TtdfUV8UYhNm7oxbzRyfr8616BYh2",
59    "t2F77xtr28U96Z2bC53ZEdTnQSUAyDuoa67",
60    "t2ARrzhbgcpoVBDPivUuj6PzXzDkTBPqfcT",
61    "t278aQ8XbvFR15mecRguiJDQQVRNnkU8kJw",
62    "t2Dp1BGnZsrTXZoEWLyjHmg3EPvmwBnPDGB",
63    "t2KzeqXgf4ju33hiSqCuKDb8iHjPCjMq9iL",
64    "t2Nyxqv1BiWY1eUSiuxVw36oveawYuo18tr",
65    "t2DKFk5JRsVoiuinK8Ti6eM4Yp7v8BbfTyH",
66    "t2CUaBca4k1x36SC4q8Nc8eBoqkMpF3CaLg",
67    "t296SiKL7L5wvFmEdMxVLz1oYgd6fTfcbZj",
68    "t29fBCFbhgsjL3XYEZ1yk1TUh7eTusB6dPg",
69    "t2FGofLJXa419A76Gpf5ncxQB4gQXiQMXjK",
70    "t2ExfrnRVnRiXDvxerQ8nZbcUQvNvAJA6Qu",
71    "t28JUffLp47eKPRHKvwSPzX27i9ow8LSXHx",
72    "t2JXWPtrtyL861rFWMZVtm3yfgxAf4H7uPA",
73    "t2QdgbJoWfYHgyvEDEZBjHmgkr9yNJff3Hi",
74    "t2QW43nkco8r32ZGRN6iw6eSzyDjkMwCV3n",
75    "t2DgYDXMJTYLwNcxighQ9RCgPxMVATRcUdC",
76    "t2Bop7dg33HGZx3wunnQzi2R2ntfpjuti3M",
77    "t2HVeEwovcLq9RstAbYkqngXNEsCe2vjJh9",
78    "t2HxbP5keQSx7p592zWQ5bJ5GrMmGDsV2Xa",
79    "t2TJzUg2matao3mztBRJoWnJY6ekUau6tPD",
80    "t29pMzxmo6wod25YhswcjKv3AFRNiBZHuhj",
81    "t2QBQMRiJKYjshJpE6RhbF7GLo51yE6d4wZ",
82    "t2F5RqnqguzZeiLtYHFx4yYfy6pDnut7tw5",
83    "t2CHvyZANE7XCtg8AhZnrcHCC7Ys1jJhK13",
84    "t2BRzpMdrGWZJ2upsaNQv6fSbkbTy7EitLo",
85    "t2BFixHGQMAWDY67LyTN514xRAB94iEjXp3",
86    "t2Uvz1iVPzBEWfQBH1p7NZJsFhD74tKaG8V",
87    "t2CmFDj5q6rJSRZeHf1SdrowinyMNcj438n",
88    "t2ErNvWEReTfPDBaNizjMPVssz66aVZh1hZ",
89    "t2GeJQ8wBUiHKDVzVM5ZtKfY5reCg7CnASs",
90    "t2L2eFtkKv1G6j55kLytKXTGuir4raAy3yr",
91    "t2EK2b87dpPazb7VvmEGc8iR6SJ289RywGL",
92    "t2DJ7RKeZJxdA4nZn8hRGXE8NUyTzjujph9",
93    "t2K1pXo4eByuWpKLkssyMLe8QKUbxnfFC3H",
94    "t2TB4mbSpuAcCWkH94Leb27FnRxo16AEHDg",
95    "t2Phx4gVL4YRnNsH3jM1M7jE4Fo329E66Na",
96    "t2VQZGmeNomN8c3USefeLL9nmU6M8x8CVzC",
97    "t2RicCvTVTY5y9JkreSRv3Xs8q2K67YxHLi",
98    "t2JrSLxTGc8wtPDe9hwbaeUjCrCfc4iZnDD",
99    "t2Uh9Au1PDDSw117sAbGivKREkmMxVC5tZo",
100    "t2FDwoJKLeEBMTy3oP7RLQ1Fihhvz49a3Bv",
101    "t2FY18mrgtb7QLeHA8ShnxLXuW8cNQ2n1v8",
102    "t2L15TkDYum7dnQRBqfvWdRe8Yw3jVy9z7g",
103];
104
105/// Number of founder addresses on Testnet.
106pub(crate) const NUM_FOUNDER_ADDRESSES: usize = 48;
107
108/// List of founder addresses on Testnet.
109pub(crate) const FOUNDER_ADDRESS_LIST: [&str; NUM_FOUNDER_ADDRESSES] = [
110    "t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi",
111    "t2N9PH9Wk9xjqYg9iin1Ua3aekJqfAtE543",
112    "t2NGQjYMQhFndDHguvUw4wZdNdsssA6K7x2",
113    "t2ENg7hHVqqs9JwU5cgjvSbxnT2a9USNfhy",
114    "t2BkYdVCHzvTJJUTx4yZB8qeegD8QsPx8bo",
115    "t2J8q1xH1EuigJ52MfExyyjYtN3VgvshKDf",
116    "t2Crq9mydTm37kZokC68HzT6yez3t2FBnFj",
117    "t2EaMPUiQ1kthqcP5UEkF42CAFKJqXCkXC9",
118    "t2F9dtQc63JDDyrhnfpzvVYTJcr57MkqA12",
119    "t2LPirmnfYSZc481GgZBa6xUGcoovfytBnC",
120    "t26xfxoSw2UV9Pe5o3C8V4YybQD4SESfxtp",
121    "t2D3k4fNdErd66YxtvXEdft9xuLoKD7CcVo",
122    "t2DWYBkxKNivdmsMiivNJzutaQGqmoRjRnL",
123    "t2C3kFF9iQRxfc4B9zgbWo4dQLLqzqjpuGQ",
124    "t2MnT5tzu9HSKcppRyUNwoTp8MUueuSGNaB",
125    "t2AREsWdoW1F8EQYsScsjkgqobmgrkKeUkK",
126    "t2Vf4wKcJ3ZFtLj4jezUUKkwYR92BLHn5UT",
127    "t2K3fdViH6R5tRuXLphKyoYXyZhyWGghDNY",
128    "t2VEn3KiKyHSGyzd3nDw6ESWtaCQHwuv9WC",
129    "t2F8XouqdNMq6zzEvxQXHV1TjwZRHwRg8gC",
130    "t2BS7Mrbaef3fA4xrmkvDisFVXVrRBnZ6Qj",
131    "t2FuSwoLCdBVPwdZuYoHrEzxAb9qy4qjbnL",
132    "t2SX3U8NtrT6gz5Db1AtQCSGjrpptr8JC6h",
133    "t2V51gZNSoJ5kRL74bf9YTtbZuv8Fcqx2FH",
134    "t2FyTsLjjdm4jeVwir4xzj7FAkUidbr1b4R",
135    "t2EYbGLekmpqHyn8UBF6kqpahrYm7D6N1Le",
136    "t2NQTrStZHtJECNFT3dUBLYA9AErxPCmkka",
137    "t2GSWZZJzoesYxfPTWXkFn5UaxjiYxGBU2a",
138    "t2RpffkzyLRevGM3w9aWdqMX6bd8uuAK3vn",
139    "t2JzjoQqnuXtTGSN7k7yk5keURBGvYofh1d",
140    "t2AEefc72ieTnsXKmgK2bZNckiwvZe3oPNL",
141    "t2NNs3ZGZFsNj2wvmVd8BSwSfvETgiLrD8J",
142    "t2ECCQPVcxUCSSQopdNquguEPE14HsVfcUn",
143    "t2JabDUkG8TaqVKYfqDJ3rqkVdHKp6hwXvG",
144    "t2FGzW5Zdc8Cy98ZKmRygsVGi6oKcmYir9n",
145    "t2DUD8a21FtEFn42oVLp5NGbogY13uyjy9t",
146    "t2UjVSd3zheHPgAkuX8WQW2CiC9xHQ8EvWp",
147    "t2TBUAhELyHUn8i6SXYsXz5Lmy7kDzA1uT5",
148    "t2Tz3uCyhP6eizUWDc3bGH7XUC9GQsEyQNc",
149    "t2NysJSZtLwMLWEJ6MH3BsxRh6h27mNcsSy",
150    "t2KXJVVyyrjVxxSeazbY9ksGyft4qsXUNm9",
151    "t2J9YYtH31cveiLZzjaE4AcuwVho6qjTNzp",
152    "t2QgvW4sP9zaGpPMH1GRzy7cpydmuRfB4AZ",
153    "t2NDTJP9MosKpyFPHJmfjc5pGCvAU58XGa4",
154    "t29pHDBWq7qN4EjwSEHg8wEqYe9pkmVrtRP",
155    "t2Ez9KM8VJLuArcxuEkNRAkhNvidKkzXcjJ",
156    "t2D5y7J5fpXajLbGrMBQkFg2mFN8fo3n8cX",
157    "t2UV2wr1PTaUiybpkV3FdSdGxUJeZdZztyt",
158];
159
160/// List of addresses for the Zcash Foundation funding stream in the Testnet.
161pub(crate) const FUNDING_STREAM_ZF_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] =
162    ["t27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v"; FUNDING_STREAMS_NUM_ADDRESSES];
163
164/// List of addresses for the Major Grants funding stream in the Testnet.
165pub(crate) const FUNDING_STREAM_MG_ADDRESSES: [&str; FUNDING_STREAMS_NUM_ADDRESSES] =
166    ["t2Gvxv2uNM7hbbACjNox4H6DjByoKZ2Fa3P"; FUNDING_STREAMS_NUM_ADDRESSES];
167
168/// Number of addresses for each post-NU6 funding stream in the Testnet.
169/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
170/// however we know this value beforehand so we prefer to make it a constant instead.
171///
172/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
173pub(crate) const POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES: usize = 13;
174
175/// Number of addresses for each post-NU6 funding stream in the Testnet.
176/// In the spec ([protocol specification §7.10][7.10]) this is defined as: `fs.addressindex(fs.endheight - 1)`
177/// however we know this value beforehand so we prefer to make it a constant instead.
178///
179/// There are 27 funding stream periods across the 939,500 blocks for which the post-NU6.1 funding streams are
180/// active. See Testnet funding streams in revision 2 of <https://zips.z.cash/zip-0214#funding-streams>.
181///
182/// [7.10]: https://zips.z.cash/protocol/protocol.pdf#fundingstreams
183pub(crate) const POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES: usize = 27;
184
185/// List of addresses for the Major Grants post-NU6 funding stream on Testnet administered by the Financial Privacy Fund (FPF).
186pub(crate) const POST_NU6_FUNDING_STREAM_FPF_ADDRESSES: [&str;
187    POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES] =
188    ["t2HifwjUj9uyxr9bknR8LFuQbc98c3vkXtu"; POST_NU6_FUNDING_STREAMS_NUM_ADDRESSES];
189
190/// List of addresses for the Major Grants post-NU6.1 funding stream on Testnet administered by the Financial Privacy Fund (FPF).
191pub(crate) const POST_NU6_1_FUNDING_STREAM_FPF_ADDRESSES: [&str;
192    POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES] =
193    ["t2HifwjUj9uyxr9bknR8LFuQbc98c3vkXtu"; POST_NU6_1_FUNDING_STREAMS_NUM_ADDRESSES];
194
195lazy_static! {
196    /// The funding streams for Testnet as described in:
197    /// - [protocol specification §7.10.1][7.10.1]
198    /// - [ZIP-1015](https://zips.z.cash/zip-1015)
199    /// - [ZIP-214#funding-streams](https://zips.z.cash/zip-0214#funding-streams)
200    ///
201    /// [7.10.1]: https://zips.z.cash/protocol/protocol.pdf#zip214fundingstreams
202    pub(crate) static ref FUNDING_STREAMS: Vec<FundingStreams> = vec![
203        FundingStreams {
204            height_range: Height(1_028_500)..Height(2_796_000),
205            recipients: [
206                (
207                    FundingStreamReceiver::Ecc,
208                    FundingStreamRecipient::new(7, FUNDING_STREAM_ECC_ADDRESSES),
209                ),
210                (
211                    FundingStreamReceiver::ZcashFoundation,
212                    FundingStreamRecipient::new(5, FUNDING_STREAM_ZF_ADDRESSES),
213                ),
214                (
215                    FundingStreamReceiver::MajorGrants,
216                    FundingStreamRecipient::new(8, FUNDING_STREAM_MG_ADDRESSES),
217                ),
218            ]
219            .into_iter()
220            .collect(),
221        },
222        FundingStreams {
223            height_range: POST_NU6_FUNDING_STREAM_START_RANGE,
224            recipients: [
225                (
226                    FundingStreamReceiver::Deferred,
227                    FundingStreamRecipient::new::<[&str; 0], &str>(12, []),
228                ),
229                (
230                    FundingStreamReceiver::MajorGrants,
231                    FundingStreamRecipient::new(8, POST_NU6_FUNDING_STREAM_FPF_ADDRESSES),
232                ),
233            ]
234            .into_iter()
235            .collect(),
236        },
237        FundingStreams {
238            height_range: activation_heights::testnet::NU6_1..Height(4_476_000),
239            recipients: [
240                (
241                    FundingStreamReceiver::Deferred,
242                    FundingStreamRecipient::new::<[&str; 0], &str>(12, []),
243                ),
244                (
245                    FundingStreamReceiver::MajorGrants,
246                    FundingStreamRecipient::new(8, POST_NU6_1_FUNDING_STREAM_FPF_ADDRESSES),
247                ),
248            ]
249            .into_iter()
250            .collect(),
251        },
252    ];
253}