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