forked from Electric-Coin-Company/dev-ci-zcash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chainparams.cpp
412 lines (368 loc) · 25.4 KB
/
chainparams.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "main.h"
#include "crypto/equihash.h"
#include "util.h"
#include "utilstrencodings.h"
#include <assert.h>
#include <boost/assign/list_of.hpp>
#include "base58.h"
using namespace std;
#include "chainparamsseeds.h"
/**
* Main network
*/
/**
* What makes a good checkpoint block?
* + Is surrounded by blocks with reasonable timestamps
* (no blocks before with a timestamp after, none after with
* timestamp before)
* + Contains no strange transactions
*/
const arith_uint256 maxUint = UintToArith256(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.fCoinbaseMustBeProtected = true;
consensus.nSubsidySlowStartInterval = 20000;
consensus.nSubsidyHalvingInterval = 840000;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 4000;
consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowAveragingWindow = 17;
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.nPowMaxAdjustDown = 32; // 32% adjustment down
consensus.nPowMaxAdjustUp = 16; // 16% adjustment up
consensus.nPowTargetSpacing = 2.5 * 60;
consensus.fPowAllowMinDifficultyBlocks = false;
/**
* The message start string is designed to be unlikely to occur in normal data.
* The characters are rarely used upper ASCII, not valid as UTF-8, and produce
* a large 32-bit integer with any alignment.
*/
pchMessageStart[0] = 0xf9;
pchMessageStart[1] = 0x1b;
pchMessageStart[2] = 0xac;
pchMessageStart[3] = 0xab;
vAlertPubKey = ParseHex("04b7ecf0baa90495ceb4e4090f6b2fd37eec1e9c85fac68a487f3ce11589692e4a317479316ee814e066638e1db54e37a10689b70286e6315b1087b6615d179264");
nDefaultPort = 8233;
nMinerThreads = 0;
nMaxTipAge = 24 * 60 * 60;
nPruneAfterHeight = 100000;
const size_t N = 200, K = 9;
BOOST_STATIC_ASSERT(equihash_parameters_acceptable(N, K));
nEquihashN = N;
nEquihashK = K;
/**
* Build the genesis block. Note that the output of its generation
* transaction cannot be spent since it did not originally exist in the
* database (and is in any case of zero value).
*/
const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
CMutableTransaction txNew;
txNew.vin.resize(1);
txNew.vout.resize(1);
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
txNew.vout[0].nValue = 0;
txNew.vout[0].scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
genesis.vtx.push_back(txNew);
genesis.hashPrevBlock.SetNull();
genesis.hashMerkleRoot = genesis.BuildMerkleTree();
genesis.nVersion = 4;
genesis.nTime = 1477539945;
genesis.nBits = 0x2007ffff;
genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000004");
genesis.nSolution = ParseHex("0198aa48905432f1be8fa21b207962b0aa694ac0490b30beadbe967576da5fc277f3590ba12c8d787f6b031e48ae9a588fb3f85de6b949db802ebcb59dbea00bada27db49fc4330af8d185b923bef5bc6b7cb1b6043ad2bf3f885ebd3b65c276adc7bfee3ec4dcd10f1551dc32b7effd23f88337499bc0a8ba31c5b913b12275d9b2c0cf2e64f24cf98dcde0d287acfbdff4772e5fd33342911618dbde042ae3da5c9a835a5ccfa3073ac0474309234c548df2ecfbc4004a7478d71f22119b9174075b586b5c80061cb1475486ca7fbe732408fb30f338506d46e022967f6ef12a1e12199bd7b858a6bc7a92209ae3670635b11dbbb22efbdf1edc990a3459d67fbca1affe7ed44807568f5a2cb9d2173b170b58bf23d1eda5390aa294baf3dea3586ddb9c660d512e1cda9cd435a52b5b72acee6ea6e6cc3b4bb71e388dd1dc2d2fcbfc15a3382eb65855a395f900280358a3b474cdbf0f0d32620207ecb033b7777dbd3f240afa0cafea3803d953b6021b73a561a976192a5d0d80bdd310ee3c7dab64b4257bd365ff2fd37d226d38d61732ea55906b7e8466e289f331ea23db71d2880baf7f13df97ffb4fb0a76cbcbc9071271a936ae1d1c01538a344b44cf5d348ac4876fbd12fc2a7a0b4830398707da3a327fe24379cc147873834a7c9aa4014003928d1f7b0abdfae458a115f85f3e2aec7472440a63c4c779446b86deb400f999dd2d608f7c556f2f2361c95c42183a6b7e19228e161d2845c538f334de103f00995beed3817d0ce476984da3be5531372c362fc38f42266140c34307189d7bdebc8347279d0c2d109bc23f06b59cd3b04af3c6d47c7f863f795a7b6b2c3006bfcf0b1a4774c124d157661c21dcbd6faa351123732106c9b728fe7bf42fe5ad25edcc743f7a9337c0ea83021beb7bda29148b223f04bbd45fff87e701dce0e8bfd6bf4d379025219b4707da27c35b367d5321558e4fa57d1387b738f13261c82a673af4958704f95edc7f0bb42de4cb96e523565dca172cdd95d80912b50a338eda932b18429baf68c591204a1cb8110d9e9a260718796f2286472e4f7f5a5b5bfb9f86772b90626cfc9c5fc7a114f68523ecabda0c8dbc255e17abcd1f5d15a4f9ab2bf33c0dbaa808f9704e263b1bc4df913152b832e68d668314c4d6c6f6b51eac700aa7e4b52f27cf236af871c7c915088510e0b1f1dc1d1920eae8489e6b226df46ee57beb619ef67bb0e40b701866bd1eae9ba315c4cebae585edafdff35f483788cf14c88e78150910438e046c992d1bb529cacd19c0fc59ecfb0235da22c69f5137f09a6ffbba4106263ebf00f1977d1dc43753aa8f2c2d6a33f7d1a4b82a4fdd5090b71ec7ca14c3b876da9f739c34ff4cd356f2cc6d501c85e771922581d6d645123e513a835401f6cffe2c4a9d2f2dd1898188cffb12a49d769cca1f425efb4c125f779fffd32ecd392be182337a7f2e0c4b00626389911d0070b38f0ca1d4431b7b1f38810fa059be149baaaf9121a1c82abf6fc78a4abd1754130e8a3599d1ce24c6c61176316c94d2e3a1395c70186956348b96eac1f472a2f5185939c61706bcdc9516dac41678de129dc73222401ba8017cf3883a2eec2d879f915a31d013cc0f59f5b9fb6b1b1dd6be000f04fbae171398b6e75aca58405eec660f0da51920cf18bb817c20d814012869d545ed3066d5adebd70e5c0f78d4f21770c8dbce9e31dc291e0fe22a0dbb74b82b249d1cd70c49bcc53b27cc8afe077e8f74dec35007a34dd0918e9e0d976384bcefd1d3472929daef9a3f663532d7a949c7f26584db3b2fcde64dc2155fd11549a16d100da0a8e32e2961d276f1beefbf7a993a2b87eb4495673dc9d15fe2c7ad9c61bdaa526e3d84");
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x055e4f392d6d63715db7b42e70a43c1faf99d5959a8e03ada11ac34a03e78667"));
assert(genesis.hashMerkleRoot == uint256S("0xdc6c10ad2a26613ae9b8a156ed9ca15e3e355a994a7e32cd7a4c3d7a478f57d2"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("z.cash", "dnsseed.z.cash")); // Zcash
vSeeds.push_back(CDNSSeedData("str4d.xyz", "dnsseed.str4d.xyz")); // @str4d
vSeeds.push_back(CDNSSeedData("znodes.org", "dnsseed.znodes.org")); // @bitcartel
// guarantees the first 2 characters, when base58 encoded, are "t1"
base58Prefixes[PUBKEY_ADDRESS] = {0x1C,0xB8};
// guarantees the first 2 characters, when base58 encoded, are "t3"
base58Prefixes[SCRIPT_ADDRESS] = {0x1C,0xBD};
// the first character, when base58 encoded, is "5" or "K" or "L" (as in Bitcoin)
base58Prefixes[SECRET_KEY] = {0x80};
// do not rely on these BIP32 prefixes; they are not specified and may change
base58Prefixes[EXT_PUBLIC_KEY] = {0x04,0x88,0xB2,0x1E};
base58Prefixes[EXT_SECRET_KEY] = {0x04,0x88,0xAD,0xE4};
// guarantees the first 2 characters, when base58 encoded, are "zc"
base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0x9A};
// guarantees the first 2 characters, when base58 encoded, are "SK"
base58Prefixes[ZCSPENDING_KEY] = {0xAB,0x36};
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
fRequireRPCPassword = true;
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = false;
checkpointData = (Checkpoints::CCheckpointData) {
boost::assign::map_list_of
( 0, consensus.hashGenesisBlock),
genesis.nTime, // * UNIX timestamp of last checkpoint block
0, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
0 // * estimated number of transactions per day after checkpoint
};
// Founders reward script expects a vector of 2-of-3 multisig addresses
vFoundersRewardAddress = {
"t3Vz22vK5z2LcKEdg16Yv4FFneEL1zg9ojd", /* main-index: 0*/
"t3cL9AucCajm3HXDhb5jBnJK2vapVoXsop3", /* main-index: 1*/
"t3fqvkzrrNaMcamkQMwAyHRjfDdM2xQvDTR", /* main-index: 2*/
"t3TgZ9ZT2CTSK44AnUPi6qeNaHa2eC7pUyF", /* main-index: 3*/
"t3SpkcPQPfuRYHsP5vz3Pv86PgKo5m9KVmx", /* main-index: 4*/
"t3Xt4oQMRPagwbpQqkgAViQgtST4VoSWR6S", /* main-index: 5*/
"t3ayBkZ4w6kKXynwoHZFUSSgXRKtogTXNgb", /* main-index: 6*/
"t3adJBQuaa21u7NxbR8YMzp3km3TbSZ4MGB", /* main-index: 7*/
"t3K4aLYagSSBySdrfAGGeUd5H9z5Qvz88t2", /* main-index: 8*/
"t3RYnsc5nhEvKiva3ZPhfRSk7eyh1CrA6Rk", /* main-index: 9*/
"t3Ut4KUq2ZSMTPNE67pBU5LqYCi2q36KpXQ", /* main-index: 10*/
"t3ZnCNAvgu6CSyHm1vWtrx3aiN98dSAGpnD", /* main-index: 11*/
"t3fB9cB3eSYim64BS9xfwAHQUKLgQQroBDG", /* main-index: 12*/
"t3cwZfKNNj2vXMAHBQeewm6pXhKFdhk18kD", /* main-index: 13*/
"t3YcoujXfspWy7rbNUsGKxFEWZqNstGpeG4", /* main-index: 14*/
"t3bLvCLigc6rbNrUTS5NwkgyVrZcZumTRa4", /* main-index: 15*/
"t3VvHWa7r3oy67YtU4LZKGCWa2J6eGHvShi", /* main-index: 16*/
"t3eF9X6X2dSo7MCvTjfZEzwWrVzquxRLNeY", /* main-index: 17*/
"t3esCNwwmcyc8i9qQfyTbYhTqmYXZ9AwK3X", /* main-index: 18*/
"t3M4jN7hYE2e27yLsuQPPjuVek81WV3VbBj", /* main-index: 19*/
"t3gGWxdC67CYNoBbPjNvrrWLAWxPqZLxrVY", /* main-index: 20*/
"t3LTWeoxeWPbmdkUD3NWBquk4WkazhFBmvU", /* main-index: 21*/
"t3P5KKX97gXYFSaSjJPiruQEX84yF5z3Tjq", /* main-index: 22*/
"t3f3T3nCWsEpzmD35VK62JgQfFig74dV8C9", /* main-index: 23*/
"t3Rqonuzz7afkF7156ZA4vi4iimRSEn41hj", /* main-index: 24*/
"t3fJZ5jYsyxDtvNrWBeoMbvJaQCj4JJgbgX", /* main-index: 25*/
"t3Pnbg7XjP7FGPBUuz75H65aczphHgkpoJW", /* main-index: 26*/
"t3WeKQDxCijL5X7rwFem1MTL9ZwVJkUFhpF", /* main-index: 27*/
"t3Y9FNi26J7UtAUC4moaETLbMo8KS1Be6ME", /* main-index: 28*/
"t3aNRLLsL2y8xcjPheZZwFy3Pcv7CsTwBec", /* main-index: 29*/
"t3gQDEavk5VzAAHK8TrQu2BWDLxEiF1unBm", /* main-index: 30*/
"t3Rbykhx1TUFrgXrmBYrAJe2STxRKFL7G9r", /* main-index: 31*/
"t3aaW4aTdP7a8d1VTE1Bod2yhbeggHgMajR", /* main-index: 32*/
"t3YEiAa6uEjXwFL2v5ztU1fn3yKgzMQqNyo", /* main-index: 33*/
"t3g1yUUwt2PbmDvMDevTCPWUcbDatL2iQGP", /* main-index: 34*/
"t3dPWnep6YqGPuY1CecgbeZrY9iUwH8Yd4z", /* main-index: 35*/
"t3QRZXHDPh2hwU46iQs2776kRuuWfwFp4dV", /* main-index: 36*/
"t3enhACRxi1ZD7e8ePomVGKn7wp7N9fFJ3r", /* main-index: 37*/
"t3PkLgT71TnF112nSwBToXsD77yNbx2gJJY", /* main-index: 38*/
"t3LQtHUDoe7ZhhvddRv4vnaoNAhCr2f4oFN", /* main-index: 39*/
"t3fNcdBUbycvbCtsD2n9q3LuxG7jVPvFB8L", /* main-index: 40*/
"t3dKojUU2EMjs28nHV84TvkVEUDu1M1FaEx", /* main-index: 41*/
"t3aKH6NiWN1ofGd8c19rZiqgYpkJ3n679ME", /* main-index: 42*/
"t3MEXDF9Wsi63KwpPuQdD6by32Mw2bNTbEa", /* main-index: 43*/
"t3WDhPfik343yNmPTqtkZAoQZeqA83K7Y3f", /* main-index: 44*/
"t3PSn5TbMMAEw7Eu36DYctFezRzpX1hzf3M", /* main-index: 45*/
"t3R3Y5vnBLrEn8L6wFjPjBLnxSUQsKnmFpv", /* main-index: 46*/
"t3Pcm737EsVkGTbhsu2NekKtJeG92mvYyoN", /* main-index: 47*/
// "t3PZ9PPcLzgL57XRSG5ND4WNBC9UTFb8DXv", /* main-index: 48*/
// "t3L1WgcyQ95vtpSgjHfgANHyVYvffJZ9iGb", /* main-index: 49*/
// "t3JtoXqsv3FuS7SznYCd5pZJGU9di15mdd7", /* main-index: 50*/
// "t3hLJHrHs3ytDgExxr1mD8DYSrk1TowGV25", /* main-index: 51*/
// "t3fmYHU2DnVaQgPhDs6TMFVmyC3qbWEWgXN", /* main-index: 52*/
// "t3T4WmAp6nrLkJ24iPpGeCe1fSWTPv47ASG", /* main-index: 53*/
// "t3fP6GrDM4QVwdjFhmCxGNbe7jXXXSDQ5dv", /* main-index: 54*/
};
assert(vFoundersRewardAddress.size() <= consensus.GetLastFoundersRewardBlockHeight());
}
};
static CMainParams mainParams;
/**
* Testnet (v3)
*/
class CTestNetParams : public CMainParams {
public:
CTestNetParams() {
strNetworkID = "test";
consensus.nMajorityEnforceBlockUpgrade = 51;
consensus.nMajorityRejectBlockOutdated = 75;
consensus.nMajorityWindow = 400;
consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.fPowAllowMinDifficultyBlocks = true;
pchMessageStart[0] = 0xf9;
pchMessageStart[1] = 0x9f;
pchMessageStart[2] = 0x24;
pchMessageStart[3] = 0xb6;
vAlertPubKey = ParseHex("044e7a1553392325c871c5ace5d6ad73501c66f4c185d6b0453cf45dec5a1322e705c672ac1a27ef7cdaf588c10effdf50ed5f95f85f2f54a5f6159fca394ed0c6");
nDefaultPort = 18233;
nMinerThreads = 0;
nPruneAfterHeight = 1000;
//! Modify the testnet genesis block so the timestamp is valid for a later start.
genesis.nTime = 1477540580;
genesis.nBits = 0x2007ffff;
genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000007");
genesis.nSolution = ParseHex("0022abafa365a23d879386c149729cca485979933d236f89a8202d0adba38fb3e08e4006494007b5a70608d3046c839d4a457b15b47397d49661feccdaed4516b4e34990c8f747d17a568cd8bcfd3a555136de9603c5d58933a1a4d34bf8b0bc7f1fd650d6ae5714b517a9afe01063a9312c4a91e15f763a7d5ad50d174c0f953e530adc50d1f28a023cad638bf552e59a4a6835119af649dd64a58289638f3dde370d6291f662c0032b32cd3755b77715c1b18c91583c1d190191b554149af773a09b1823546172fda11e0a4907854ac6d70886f28b1396d1d3e9be818f24aee3ee508bbb82fb38ec3f0ee0104f7b047c860265db138633c194645715085c2059a57b43891cc1acd2d5cc4c8bf8874a452a1ecb4b1fcd6319b10818a02f59869676111566881db437129f536e89818219f7c1e736671d663cd44c650cdfb9629b300d9c40f9d80f7533ae788a5f92d201828a1510c83024e907d73f0cc3cd2e7118beac170569efd6e891adc71ce3e384806759595d25cff23e32172a034f99f4df984ff32e05270f8dbb1d37df9b37c9f2f607e0ba8554c736eaf5d1de2239de7d0eb0069f1e3323d084a490a9027efa6644c1145b13ede63136e4332e148380fe02b5fcc37a278a5d9a571eda069faf3d39097264dc37e4abd6c5b0aded97d881fa0ab1b3158a06b896f4a2d6b7dbdfb525f784ddebb902bb496814d115970a95a1198fb80fc0855b6897381546225a15d9bf09221d873db8cfabda7f33f8ff5c197d3d6a3554fab16408499869e6779e674dd58ef52d2d2ccf83e83c2df25d9418b23b90cd53bb1c5b58049f3204ed878cb7da0f50c4613f02c4f480b069520644152e55e9efc9c4d0540524a345a7b64e5e2e891864c6f69aa2458fd61114e4d9c09555f4b08fbad22d85afc62c252bdb9cf9e64187c498e281223a3f4b042a5fc3a6902e076141f16156680b996b6e7fbb3b22dec413e5e8e67f4d1338e87de8a8328f65d5fa85445fc65ad129ae89d9b97ceae5746177dca89fdc426703a6031e63e9abb3bdd6cc04f117171d685ac2a30d44b90cf9187041784da60c0950048ea83e9b5f0a2c574eadf3cb8b83e1089595c9d3902665f934cf852c6a55e94fd4e25100636313a4d04ad527b7be47293db7e44de39550e3614066b22d630d020073d1f57c05eb5cb7ffaf7ae780c05357c8d6ebf0fddb9e4ab3123b6250c8b619bbd6f5f7ea4b5f501e10bab5680c1034424ceca0fe39764d23e98cee4f1f86575cf0e82c40ff7bbcf2a3a9dc9e02d8f8628946700cb5c68d0a1a6090b8aecabfc37beaaa1a7b676730f299ea051eeb5bded2528891ebe3a2fdf92bfe258e863edf1f10e9cad0821daa7ef177d24f93f96058a059529fc118d34f23182209e97efc7486dfdaca6af3071dd544046611c89d7095bbc419223f5c29a57d556f91614e332ca9e74a583841bd66ea6cfa6086c744613d875f07c0312c700241fb61206533c84fa50f2cf8dbbf252e8a3247b51e3ad56305b61123d6a69eb8641870a005ba3faa048ae054e43942391bed3265bbae567eee16c5c6539b2b66718a5b61841e200b14e465f53a13190a43ed4d8ff324f0e6fbf4c3e8c6938ac2dde8ed3641d4f8c3fbce65fb0e1b0486ede3431a00bd802a055aeeaa7be53aa784b4a3eb1558c4f1f293d6fb7a2f0cc7d33028bc6d5421232446f7a86cdb4a8d21a21a44c77e98987222c654558e56b9c4d769d7bc035021bfae25381f8dfddffa87647274e0b28ec7b8bc1b0dcfca73c922409b8c75d282faf2759cf78e54f578486a8498e726bbc7a83e64acc96d41cdb80336bf0b198b46d50817faedd560c404db47a43a3f21f795912d0334bd41599b8b1c7634c00feb1352b6a558a331");
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x038a2d378418e20809465984056d15d04e7b32a5ab0956a3b448ace885c22a55"));
vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("z.cash", "dnsseed.testnet.z.cash")); // Zcash
// guarantees the first 2 characters, when base58 encoded, are "tm"
base58Prefixes[PUBKEY_ADDRESS] = {0x1D,0x25};
// guarantees the first 2 characters, when base58 encoded, are "t2"
base58Prefixes[SCRIPT_ADDRESS] = {0x1C,0xBA};
// the first character, when base58 encoded, is "9" or "c" (as in Bitcoin)
base58Prefixes[SECRET_KEY] = {0xEF};
// do not rely on these BIP32 prefixes; they are not specified and may change
base58Prefixes[EXT_PUBLIC_KEY] = {0x04,0x35,0x87,0xCF};
base58Prefixes[EXT_SECRET_KEY] = {0x04,0x35,0x83,0x94};
// guarantees the first 2 characters, when base58 encoded, are "zt"
base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0xB6};
// guarantees the first 2 characters, when base58 encoded, are "ST"
base58Prefixes[ZCSPENDING_KEY] = {0xAC,0x08};
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
fRequireRPCPassword = true;
fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;
checkpointData = (Checkpoints::CCheckpointData) {
boost::assign::map_list_of
( 0, consensus.hashGenesisBlock),
genesis.nTime,
0,
0
};
// Founders reward script expects a vector of 2-of-3 multisig addresses
vFoundersRewardAddress = {
"t2UNzUUx8mWBCRYPRezvA363EYXyEpHokyi", "t2N9PH9Wk9xjqYg9iin1Ua3aekJqfAtE543", "t2NGQjYMQhFndDHguvUw4wZdNdsssA6K7x2", "t27ktmq1kbeCWiQ5TZ7w5npSzcdbBmTB7v6",
"t2GcBttAKD2WTHka8HyGc2dfvVTKYZUfHmJ", "t2Q3vxWaD9LrdqUE8Xd9Ddjpr9pUQ2aGotK", "t2TTfWDsYu998fHWzVP9Gns4fgxXXRi1Wzu", "t2KS6R4MMWdSBMjLCiw2iMyhWGRQPmyRqDn",
"t2Q2ELrgotWv3Eec6LEtMMiiQ8dtW38u8Tj", "t2AEgJA88vTWAKqxJDFUEJWyHUtQAZi5G1D", "t2HCSdmpq1TQKksuwPQevwAzPTgfJ2rkMbG", "t2HQCPFAUQaUdJWHPhg5pPBxit7inaJzubE",
"t2Fzqvq8Y9e6Mn3JNPb982aYsLmq4b5HmhH", "t2HEz7YZQqDUgC5h4y2WSD3mWneqJNVRjjJ", "t2GCR1SCk687Eeo5NEZ23MLsms7JjVWBgfG", "t2KyiPR9Lztq2w1w747X6W4nkUMAGL8M9KN",
"t2UxymadyxSyVihmbq7S1yxw5dCBqJ1S4jT", "t2AVeMy7fdmTcJhckqiKRG8B7F1vccEhSqU", "t26m7LwihQzD2sH7ZVhYpPJM5j7kzwbfKW9", "t2DgwUNTe7NxuyPU6fxsB5xJXap3E4yWXrN",
"t2U6funcXA11fC9SZehyvUL3rk3Vhuh7fzS", "t284JhyS8LGM72Tx1porSqwrcq3CejthP1p", "t29egu8QcpzKeLoPLqWS6QVMnUUPQdF6eNm", "t29LqD9p9D3B26euBwFi6mfcWu8HPA38VNs",
"t28GsAMCxAyLy85XaasddDzaYFTtfewr86y", "t2GV44QyaikQPLUfm6oTfZnw71LLjnR7gDG", "t2U2QzNLQ1jtAu4L6xxVnRXLBsQpQvGRR2g", "t2QKGr5PNan7nrwDgseyHMN9NFeeuUjCh8b",
"t2AfS8u6HwBeJpKpbuxztvRjupKQDXqnrwa", "t2CTRQUViQd3CWMhnKhFnUHqDLUyTxmWhJs", "t2CbM9EqszNURqh1UXZBXYhwp1R4GwEhWRE", "t2LM7uYiAsKDU42GNSnMwDxbZ8s1DowQzYH",
"t2AgvT35LHR378AE3ouz6xKMhkTLHLJC6nD", "t285EAQXUVyi4NMddJv2QqTrnv45GRMbP8e", "t2EpMRCD5b8f2DCQ37npNULcpZhkjC8muqA", "t2BCmWXrRPiCeQTpizSWKKRPM5X6PS7umDY",
"t2DN7X6wDFn5hYKBiBmn3Z98st419yaTVTH", "t2QJj8HeCwQ6mHwqekxxDLZntYpZTHNU62t", "t2QdHBR1Yciqn4j8gpS8DcQZZtYetKvfNj3", "t2E5cpLA1ey5VNxFNcuopeQMq2rH2NHiPdu",
"t2EVRGtzjFAyz8CF8ndvLuiJu7qZUfDa93H", "t2KoQDk3BSFadBkuaWdLwchFuQamzw9RE4L", "t2FnR3yhTmuiejEJeu6qpidWTghRd1HpjLt", "t2BAuBAAospDc9d1u5nNGEi6x4NRJBD2PQ2",
"t2RtKrLCGcyPkm4a4APg1YY9Wu2m4R2PgrB", "t28aUbSteZzBq2pFgj1K1XNZRZP5mMMyakV", "t2Urdy1ERfkvsFuy6Z4BkhvYGzWdmivfAFR", "t2ADinR4JrvCMd4Q1XGALPajzFrirqvhED6",
};
assert(vFoundersRewardAddress.size() <= consensus.GetLastFoundersRewardBlockHeight());
}
};
static CTestNetParams testNetParams;
/**
* Regression test
*/
class CRegTestParams : public CTestNetParams {
public:
CRegTestParams() {
strNetworkID = "regtest";
consensus.fCoinbaseMustBeProtected = false;
consensus.nSubsidySlowStartInterval = 0;
consensus.nSubsidyHalvingInterval = 150;
consensus.nMajorityEnforceBlockUpgrade = 750;
consensus.nMajorityRejectBlockOutdated = 950;
consensus.nMajorityWindow = 1000;
consensus.powLimit = uint256S("0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f");
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
consensus.nPowMaxAdjustDown = 0; // Turn off adjustment down
consensus.nPowMaxAdjustUp = 0; // Turn off adjustment up
pchMessageStart[0] = 0xaa;
pchMessageStart[1] = 0xe8;
pchMessageStart[2] = 0x3f;
pchMessageStart[3] = 0x5f;
nMinerThreads = 1;
nMaxTipAge = 24 * 60 * 60;
const size_t N = 48, K = 5;
BOOST_STATIC_ASSERT(equihash_parameters_acceptable(N, K));
nEquihashN = N;
nEquihashK = K;
genesis.nTime = 1296688602;
genesis.nBits = 0x200f0f0f;
genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000009");
genesis.nSolution = ParseHex("0905111770fb9072e53075375f5d77c379e30bd25270f8778abdca2ee5156f5635b9b391");
consensus.hashGenesisBlock = genesis.GetHash();
nDefaultPort = 18444;
assert(consensus.hashGenesisBlock == uint256S("0x0b9d8b1be2041720ab879592c3be0ec7ee79fcb2d1e238f93d3d1afe58d0d867"));
nPruneAfterHeight = 1000;
vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds.
vSeeds.clear(); //! Regtest mode doesn't have any DNS seeds.
fRequireRPCPassword = false;
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = true;
fRequireStandard = false;
fMineBlocksOnDemand = true;
fTestnetToBeDeprecatedFieldRPC = false;
checkpointData = (Checkpoints::CCheckpointData){
boost::assign::map_list_of
( 0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")),
0,
0,
0
};
// Founders reward script expects a vector of 2-of-3 multisig addresses
vFoundersRewardAddress = { "t2FwcEhFdNXuFMv1tcYwaBJtYVtMj8b1uTg" };
assert(vFoundersRewardAddress.size() <= consensus.GetLastFoundersRewardBlockHeight());
}
};
static CRegTestParams regTestParams;
static CChainParams *pCurrentParams = 0;
const CChainParams &Params() {
assert(pCurrentParams);
return *pCurrentParams;
}
CChainParams &Params(CBaseChainParams::Network network) {
switch (network) {
case CBaseChainParams::MAIN:
return mainParams;
case CBaseChainParams::TESTNET:
return testNetParams;
case CBaseChainParams::REGTEST:
return regTestParams;
default:
assert(false && "Unimplemented network");
return mainParams;
}
}
void SelectParams(CBaseChainParams::Network network) {
SelectBaseParams(network);
pCurrentParams = &Params(network);
// Some python qa rpc tests need to enforce the coinbase consensus rule
if (network == CBaseChainParams::REGTEST && mapArgs.count("-regtestprotectcoinbase")) {
regTestParams.SetRegTestCoinbaseMustBeProtected();
}
}
bool SelectParamsFromCommandLine()
{
CBaseChainParams::Network network = NetworkIdFromCommandLine();
if (network == CBaseChainParams::MAX_NETWORK_TYPES)
return false;
SelectParams(network);
return true;
}
// Block height must be >0 and <=last founders reward block height
// Index variable i ranges from 0 - (vFoundersRewardAddress.size()-1)
std::string CChainParams::GetFoundersRewardAddressAtHeight(int nHeight) const {
int maxHeight = consensus.GetLastFoundersRewardBlockHeight();
assert(nHeight > 0 && nHeight <= maxHeight);
size_t addressChangeInterval = (maxHeight + vFoundersRewardAddress.size()) / vFoundersRewardAddress.size();
size_t i = nHeight / addressChangeInterval;
return vFoundersRewardAddress[i];
}
// Block height must be >0 and <=last founders reward block height
// The founders reward address is expected to be a multisig (P2SH) address
CScript CChainParams::GetFoundersRewardScriptAtHeight(int nHeight) const {
assert(nHeight > 0 && nHeight <= consensus.GetLastFoundersRewardBlockHeight());
CBitcoinAddress address(GetFoundersRewardAddressAtHeight(nHeight).c_str());
assert(address.IsValid());
assert(address.IsScript());
CScriptID scriptID = get<CScriptID>(address.Get()); // Get() returns a boost variant
CScript script = CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
return script;
}
std::string CChainParams::GetFoundersRewardAddressAtIndex(int i) const {
assert(i >= 0 && i < vFoundersRewardAddress.size());
return vFoundersRewardAddress[i];
}