Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

chainparams.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2014 The Bitcoin Core developers
3 // Copyright (c) 2014-2020 The Dash Core developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #include <chainparams.h>
8 #include <consensus/merkle.h>
9 
10 #include <tinyformat.h>
11 #include <util.h>
12 #include <utilstrencodings.h>
13 
14 #include <arith_uint256.h>
15 
16 #include <assert.h>
17 #include <memory>
18 
19 #include <chainparamsseeds.h>
20 
21 static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
22 {
23  CMutableTransaction txNew;
24  txNew.nVersion = 1;
25  txNew.vin.resize(1);
26  txNew.vout.resize(1);
27  txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
28  txNew.vout[0].nValue = genesisReward;
29  txNew.vout[0].scriptPubKey = genesisOutputScript;
30 
31  CBlock genesis;
32  genesis.nTime = nTime;
33  genesis.nBits = nBits;
34  genesis.nNonce = nNonce;
35  genesis.nVersion = nVersion;
36  genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
37  genesis.hashPrevBlock.SetNull();
38  genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
39  return genesis;
40 }
41 
42 static CBlock CreateDevNetGenesisBlock(const uint256 &prevBlockHash, const std::string& devNetName, uint32_t nTime, uint32_t nNonce, uint32_t nBits, const CAmount& genesisReward)
43 {
44  assert(!devNetName.empty());
45 
46  CMutableTransaction txNew;
47  txNew.nVersion = 1;
48  txNew.vin.resize(1);
49  txNew.vout.resize(1);
50  // put height (BIP34) and devnet name into coinbase
51  txNew.vin[0].scriptSig = CScript() << 1 << std::vector<unsigned char>(devNetName.begin(), devNetName.end());
52  txNew.vout[0].nValue = genesisReward;
53  txNew.vout[0].scriptPubKey = CScript() << OP_RETURN;
54 
55  CBlock genesis;
56  genesis.nTime = nTime;
57  genesis.nBits = nBits;
58  genesis.nNonce = nNonce;
59  genesis.nVersion = 4;
60  genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
61  genesis.hashPrevBlock = prevBlockHash;
62  genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
63  return genesis;
64 }
65 
77 static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
78 {
79  const char* pszTimestamp = "Wired 09/Jan/2014 The Grand Experiment Goes Live: Overstock.com Is Now Accepting Bitcoins";
80  const CScript genesisOutputScript = CScript() << ParseHex("040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9") << OP_CHECKSIG;
81  return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
82 }
83 
84 
85 void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
86 {
87  consensus.vDeployments[d].nStartTime = nStartTime;
88  consensus.vDeployments[d].nTimeout = nTimeout;
89  if (nWindowSize != -1) {
90  consensus.vDeployments[d].nWindowSize = nWindowSize;
91  }
92  if (nThresholdStart != -1) {
93  consensus.vDeployments[d].nThresholdStart = nThresholdStart;
94  }
95  if (nThresholdMin != -1) {
96  consensus.vDeployments[d].nThresholdMin = nThresholdMin;
97  }
98  if (nFalloffCoeff != -1) {
99  consensus.vDeployments[d].nFalloffCoeff = nFalloffCoeff;
100  }
101 }
102 
103 void CChainParams::UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
104 {
105  consensus.DIP0003Height = nActivationHeight;
106  consensus.DIP0003EnforcementHeight = nEnforcementHeight;
107 }
108 
109 void CChainParams::UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
110 {
111  consensus.nMasternodePaymentsStartBlock = nMasternodePaymentsStartBlock;
112  consensus.nBudgetPaymentsStartBlock = nBudgetPaymentsStartBlock;
113  consensus.nSuperblockStartBlock = nSuperblockStartBlock;
114 }
115 
116 void CChainParams::UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
117 {
118  consensus.nMinimumDifficultyBlocks = nMinimumDifficultyBlocks;
119  consensus.nHighSubsidyBlocks = nHighSubsidyBlocks;
120  consensus.nHighSubsidyFactor = nHighSubsidyFactor;
121 }
122 
124  consensus.llmqTypeChainLocks = llmqType;
125 }
126 
127 void CChainParams::UpdateLLMQTestParams(int size, int threshold) {
128  auto& params = consensus.llmqs.at(Consensus::LLMQ_TEST);
129  params.size = size;
130  params.minSize = threshold;
131  params.threshold = threshold;
132  params.dkgBadVotesThreshold = threshold;
133 }
134 
135 void CChainParams::UpdateLLMQDevnetParams(int size, int threshold)
136 {
137  auto& params = consensus.llmqs.at(Consensus::LLMQ_DEVNET);
138  params.size = size;
139  params.minSize = threshold;
140  params.threshold = threshold;
141  params.dkgBadVotesThreshold = threshold;
142 }
143 
144 static CBlock FindDevNetGenesisBlock(const CBlock &prevBlock, const CAmount& reward)
145 {
146  std::string devNetName = gArgs.GetDevNetName();
147  assert(!devNetName.empty());
148 
149  CBlock block = CreateDevNetGenesisBlock(prevBlock.GetHash(), devNetName.c_str(), prevBlock.nTime + 1, 0, prevBlock.nBits, reward);
150 
151  arith_uint256 bnTarget;
152  bnTarget.SetCompact(block.nBits);
153 
154  for (uint32_t nNonce = 0; nNonce < UINT32_MAX; nNonce++) {
155  block.nNonce = nNonce;
156 
157  uint256 hash = block.GetHash();
158  if (UintToArith256(hash) <= bnTarget)
159  return block;
160  }
161 
162  // This is very unlikely to happen as we start the devnet with a very low difficulty. In many cases even the first
163  // iteration of the above loop will give a result already
164  error("FindDevNetGenesisBlock: could not find devnet genesis block for %s", devNetName);
165  assert(false);
166 }
167 
168 // this one is for testing only
171  .name = "llmq_test",
172  .size = 3,
173  .minSize = 2,
174  .threshold = 2,
175 
176  .dkgInterval = 24, // one DKG per hour
177  .dkgPhaseBlocks = 2,
178  .dkgMiningWindowStart = 10, // dkgPhaseBlocks * 5 = after finalization
179  .dkgMiningWindowEnd = 18,
180  .dkgBadVotesThreshold = 2,
181 
182  .signingActiveQuorumCount = 2, // just a few ones to allow easier testing
183 
184  .keepOldConnections = 3,
185  .recoveryMembers = 3,
186 };
187 
188 // this one is for devnets only
191  .name = "llmq_devnet",
192  .size = 10,
193  .minSize = 7,
194  .threshold = 6,
195 
196  .dkgInterval = 24, // one DKG per hour
197  .dkgPhaseBlocks = 2,
198  .dkgMiningWindowStart = 10, // dkgPhaseBlocks * 5 = after finalization
199  .dkgMiningWindowEnd = 18,
200  .dkgBadVotesThreshold = 7,
201 
202  .signingActiveQuorumCount = 3, // just a few ones to allow easier testing
203 
204  .keepOldConnections = 4,
205  .recoveryMembers = 6,
206 };
207 
210  .name = "llmq_50_60",
211  .size = 50,
212  .minSize = 40,
213  .threshold = 30,
214 
215  .dkgInterval = 24, // one DKG per hour
216  .dkgPhaseBlocks = 2,
217  .dkgMiningWindowStart = 10, // dkgPhaseBlocks * 5 = after finalization
218  .dkgMiningWindowEnd = 18,
219  .dkgBadVotesThreshold = 40,
220 
221  .signingActiveQuorumCount = 24, // a full day worth of LLMQs
222 
223  .keepOldConnections = 25,
224  .recoveryMembers = 25,
225 };
226 
229  .name = "llmq_400_60",
230  .size = 400,
231  .minSize = 300,
232  .threshold = 240,
233 
234  .dkgInterval = 24 * 12, // one DKG every 12 hours
235  .dkgPhaseBlocks = 4,
236  .dkgMiningWindowStart = 20, // dkgPhaseBlocks * 5 = after finalization
237  .dkgMiningWindowEnd = 28,
238  .dkgBadVotesThreshold = 300,
239 
240  .signingActiveQuorumCount = 4, // two days worth of LLMQs
241 
242  .keepOldConnections = 5,
243  .recoveryMembers = 100,
244 };
245 
246 // Used for deployment and min-proto-version signalling, so it needs a higher threshold
249  .name = "llmq_400_85",
250  .size = 400,
251  .minSize = 350,
252  .threshold = 340,
253 
254  .dkgInterval = 24 * 24, // one DKG every 24 hours
255  .dkgPhaseBlocks = 4,
256  .dkgMiningWindowStart = 20, // dkgPhaseBlocks * 5 = after finalization
257  .dkgMiningWindowEnd = 48, // give it a larger mining window to make sure it is mined
258  .dkgBadVotesThreshold = 300,
259 
260  .signingActiveQuorumCount = 4, // four days worth of LLMQs
261 
262  .keepOldConnections = 5,
263  .recoveryMembers = 100,
264 };
265 
266 
279 class CMainParams : public CChainParams {
280 public:
282  strNetworkID = "main";
283  consensus.nSubsidyHalvingInterval = 210240; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
284  consensus.nMasternodePaymentsStartBlock = 100000; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
285  consensus.nMasternodePaymentsIncreaseBlock = 158000; // actual historical value
286  consensus.nMasternodePaymentsIncreasePeriod = 576*30; // 17280 - actual historical value
289  consensus.nBudgetPaymentsStartBlock = 328008; // actual historical value
290  consensus.nBudgetPaymentsCycleBlocks = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
292  consensus.nSuperblockStartBlock = 614820; // The block at which 12.1 goes live (end of final 12.0 budget cycle)
293  consensus.nSuperblockStartHash = uint256S("0000000000020cb27c7ef164d21003d5d20cdca2f54dd9a9ca6d45f4d47f8aa3");
294  consensus.nSuperblockCycle = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
298  consensus.BIP34Height = 951;
299  consensus.BIP34Hash = uint256S("0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012");
300  consensus.BIP65Height = 619382; // 00000000000076d8fcea02ec0963de4abfd01e771fec0863f960c2c64fe6f357
301  consensus.BIP66Height = 245817; // 00000000000b1fa2dfa312863570e13fae9ca7b5566cb27e55422620b469aefa
302  consensus.DIP0001Height = 782208;
303  consensus.DIP0003Height = 1028160;
305  consensus.DIP0003EnforcementHash = uint256S("000000000000002d1734087b4c5afc3133e4e1c3e1a89218f62bcd9bb3d17f81");
306  consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
307  consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
308  consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
311  consensus.nPowKGWHeight = 15200;
312  consensus.nPowDGWHeight = 34140;
313  consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
314  consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
316  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
317  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
318 
319  // Deployment of BIP68, BIP112, and BIP113.
321  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1486252800; // Feb 5th, 2017
322  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1517788800; // Feb 5th, 2018
323 
324  // Deployment of DIP0001
326  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1508025600; // Oct 15th, 2017
327  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 1539561600; // Oct 15th, 2018
330 
331  // Deployment of BIP147
333  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1524477600; // Apr 23th, 2018
334  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1556013600; // Apr 23th, 2019
337 
338  // Deployment of DIP0003
340  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1546300800; // Jan 1st, 2019
341  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 1577836800; // Jan 1st, 2020
344 
345  // Deployment of DIP0008
347  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1557878400; // May 15th, 2019
348  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = 1589500800; // May 15th, 2020
351 
352  // Deployment of Block Reward Reallocation
354  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1601510400; // Oct 1st, 2020
355  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 1633046400; // Oct 1st, 2021
359  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
360 
361  // The best chain should have at least this much work.
362  consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000406cf3437a522656342a"); // 1344000
363 
364  // By default assume that the signatures in ancestors of this block are valid.
365  consensus.defaultAssumeValid = uint256S("0x000000000000000c01e55cb55bcb15f700d79563efcbdecf8ab5aaee33dcfa49"); // 1344000
366 
372  pchMessageStart[0] = 0xbf;
373  pchMessageStart[1] = 0x0c;
374  pchMessageStart[2] = 0x6b;
375  pchMessageStart[3] = 0xbd;
376  nDefaultPort = 9999;
377  nPruneAfterHeight = 100000;
378 
379  genesis = CreateGenesisBlock(1390095618, 28917698, 0x1e0ffff0, 1, 50 * COIN);
381  assert(consensus.hashGenesisBlock == uint256S("0x00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6"));
382  assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
383 
384  // Note that of those which support the service bits prefix, most only support a subset of
385  // possible options.
386  // This is fine at runtime as we'll fall back to using them as a oneshot if they dont support the
387  // service bits we want, but we should get them updated to support all service bits wanted by any
388  // release ASAP to avoid it where possible.
389  vSeeds.emplace_back("dnsseed.dash.org");
390  vSeeds.emplace_back("dnsseed.dashdot.io");
391 
392  // Dash addresses start with 'X'
393  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,76);
394  // Dash script addresses start with '7'
395  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,16);
396  // Dash private keys start with '7' or 'X'
397  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,204);
398  // Dash BIP32 pubkeys start with 'xpub' (Bitcoin defaults)
399  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
400  // Dash BIP32 prvkeys start with 'xprv' (Bitcoin defaults)
401  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
402 
403  // Dash BIP44 coin type is '5'
404  nExtCoinType = 5;
405 
406  vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
407 
408  // long living quorum params
414 
416  fRequireStandard = true;
418  fMineBlocksOnDemand = false;
420  fAllowMultiplePorts = false;
422 
427  nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
428 
429  vSporkAddresses = {"Xgtyuk76vhuFW2iT7UAiHgNdWXCf3J34wh"};
430  nMinSporkKeys = 1;
432 
433  checkpointData = {
434  {
435  {1500, uint256S("0x000000aaf0300f59f49bc3e970bad15c11f961fe2347accffff19d96ec9778e3")},
436  {4991, uint256S("0x000000003b01809551952460744d5dbb8fcbd6cbae3c220267bf7fa43f837367")},
437  {9918, uint256S("0x00000000213e229f332c0ffbe34defdaa9e74de87f2d8d1f01af8d121c3c170b")},
438  {16912, uint256S("0x00000000075c0d10371d55a60634da70f197548dbbfa4123e12abfcbc5738af9")},
439  {23912, uint256S("0x0000000000335eac6703f3b1732ec8b2f89c3ba3a7889e5767b090556bb9a276")},
440  {35457, uint256S("0x0000000000b0ae211be59b048df14820475ad0dd53b9ff83b010f71a77342d9f")},
441  {45479, uint256S("0x000000000063d411655d590590e16960f15ceea4257122ac430c6fbe39fbf02d")},
442  {55895, uint256S("0x0000000000ae4c53a43639a4ca027282f69da9c67ba951768a20415b6439a2d7")},
443  {68899, uint256S("0x0000000000194ab4d3d9eeb1f2f792f21bb39ff767cb547fe977640f969d77b7")},
444  {74619, uint256S("0x000000000011d28f38f05d01650a502cc3f4d0e793fbc26e2a2ca71f07dc3842")},
445  {75095, uint256S("0x0000000000193d12f6ad352a9996ee58ef8bdc4946818a5fec5ce99c11b87f0d")},
446  {88805, uint256S("0x00000000001392f1652e9bf45cd8bc79dc60fe935277cd11538565b4a94fa85f")},
447  {107996, uint256S("0x00000000000a23840ac16115407488267aa3da2b9bc843e301185b7d17e4dc40")},
448  {137993, uint256S("0x00000000000cf69ce152b1bffdeddc59188d7a80879210d6e5c9503011929c3c")},
449  {167996, uint256S("0x000000000009486020a80f7f2cc065342b0c2fb59af5e090cd813dba68ab0fed")},
450  {207992, uint256S("0x00000000000d85c22be098f74576ef00b7aa00c05777e966aff68a270f1e01a5")},
451  {312645, uint256S("0x0000000000059dcb71ad35a9e40526c44e7aae6c99169a9e7017b7d84b1c2daf")},
452  {407452, uint256S("0x000000000003c6a87e73623b9d70af7cd908ae22fee466063e4ffc20be1d2dbc")},
453  {523412, uint256S("0x000000000000e54f036576a10597e0e42cc22a5159ce572f999c33975e121d4d")},
454  {523930, uint256S("0x0000000000000bccdb11c2b1cfb0ecab452abf267d89b7f46eaf2d54ce6e652c")},
455  {750000, uint256S("0x00000000000000b4181bbbdddbae464ce11fede5d0292fb63fdede1e7c8ab21c")},
456  {888900, uint256S("0x0000000000000026c29d576073ab51ebd1d3c938de02e9a44c7ee9e16f82db28")},
457  {967800, uint256S("0x0000000000000024e26c7df7e46d673724d223cf4ca2b2adc21297cc095600f4")},
458  {1067570, uint256S("0x000000000000001e09926bcf5fa4513d23e870a34f74e38200db99eb3f5b7a70")},
459  {1167570, uint256S("0x000000000000000fb7b1e9b81700283dff0f7d87cf458e5edfdae00c669de661")},
460  }
461  };
462 
464  1601017518, // * UNIX timestamp of last known number of transactions (Block 1344000)
465  28914483, // * total number of transactions between genesis and that timestamp
466  // (the tx=... number in the SetBestChain debug.log lines)
467  0.3 // * estimated number of transactions per second after that timestamp
468  };
469  }
470 };
471 
475 class CTestNetParams : public CChainParams {
476 public:
478  strNetworkID = "test";
480  consensus.nMasternodePaymentsStartBlock = 4010; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
488  consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
489  consensus.nSuperblockStartHash = uint256(); // do not check this on testnet
490  consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
494  consensus.BIP34Height = 76;
495  consensus.BIP34Hash = uint256S("0x000008ebb1db2598e897d17275285767717c6acfeac4c73def49fbea1ddcbcb6");
496  consensus.BIP65Height = 2431; // 0000039cf01242c7f921dcb4806a5994bc003b48c1973ae0c89b67809c2bb2ab
497  consensus.BIP66Height = 2075; // 0000002acdd29a14583540cb72e1c5cc83783560e38fa7081495d474fe1671f7
498  consensus.DIP0001Height = 5500;
499  consensus.DIP0003Height = 7000;
501  consensus.DIP0003EnforcementHash = uint256S("00000055ebc0e974ba3a3fb785c5ad4365a39637d4df168169ee80d313612f8f");
502  consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
503  consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
504  consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
507  consensus.nPowKGWHeight = 4002; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
508  consensus.nPowDGWHeight = 4002; // TODO: make sure to drop all spork6 related code on next testnet reset
509  consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
510  consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
512  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
513  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
514 
515  // Deployment of BIP68, BIP112, and BIP113.
517  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1544655600; // Dec 13th, 2018
518  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1576191600; // Dec 13th, 2019
519 
520  // Deployment of DIP0001
522  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1544655600; // Dec 13th, 2018
523  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 1576191600; // Dec 13th, 2019
526 
527  // Deployment of BIP147
529  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1544655600; // Dec 13th, 2018
530  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1576191600; // Dec 13th, 2019
533 
534  // Deployment of DIP0003
536  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1544655600; // Dec 13th, 2018
537  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 1576191600; // Dec 13th, 2019
540 
541  // Deployment of DIP0008
543  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
544  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = 1584748800; // Mar 21st, 2020
547 
548  // Deployment of Block Reward Reallocation
550  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1598918400; // Sep 1st, 2020
551  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 1630454400; // Sep 1st, 2021
555  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
556 
557  // The best chain should have at least this much work.
558  consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000022b7d3bf9070c88"); // 387900
559 
560  // By default assume that the signatures in ancestors of this block are valid.
561  consensus.defaultAssumeValid = uint256S("0x0000019906db5219bdc6c9a0a94facf80356bcf1afebc0d356485711a294385f"); // 387900
562 
563  pchMessageStart[0] = 0xce;
564  pchMessageStart[1] = 0xe2;
565  pchMessageStart[2] = 0xca;
566  pchMessageStart[3] = 0xff;
567  nDefaultPort = 19999;
568  nPruneAfterHeight = 1000;
569 
570  genesis = CreateGenesisBlock(1390666206UL, 3861367235UL, 0x1e0ffff0, 1, 50 * COIN);
572  assert(consensus.hashGenesisBlock == uint256S("0x00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c"));
573  assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
574 
575  vFixedSeeds.clear();
576  vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
577 
578  vSeeds.clear();
579  // nodes with support for servicebits filtering should be at the top
580  vSeeds.emplace_back("testnet-seed.dashdot.io"); // Just a static list of stable node(s), only supports x9
581 
582  // Testnet Dash addresses start with 'y'
583  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
584  // Testnet Dash script addresses start with '8' or '9'
585  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
586  // Testnet private keys start with '9' or 'c' (Bitcoin defaults)
587  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
588  // Testnet Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
589  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
590  // Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
591  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
592 
593  // Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
594  nExtCoinType = 1;
595 
596  // long living quorum params
602 
604  fRequireStandard = false;
606  fMineBlocksOnDemand = false;
608  fAllowMultiplePorts = true;
610 
615  nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
616 
617  vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
618  nMinSporkKeys = 1;
620 
621  checkpointData = {
622  {
623  {261, uint256S("0x00000c26026d0815a7e2ce4fa270775f61403c040647ff2c3091f99e894a4618")},
624  {1999, uint256S("0x00000052e538d27fa53693efe6fb6892a0c1d26c0235f599171c48a3cce553b1")},
625  {2999, uint256S("0x0000024bc3f4f4cb30d29827c13d921ad77d2c6072e586c7f60d83c2722cdcc5")},
626  {96090, uint256S("0x00000000033df4b94d17ab43e999caaf6c4735095cc77703685da81254d09bba")},
627  {200000, uint256S("0x000000001015eb5ef86a8fe2b3074d947bc972c5befe32b28dd5ce915dc0d029")},
628  }
629  };
630 
632  1601053246, // * UNIX timestamp of last known number of transactions (Block 387900)
633  3326586, // * total number of transactions between genesis and that timestamp
634  // (the tx=... number in the SetBestChain debug.log lines)
635  0.02 // * estimated number of transactions per second after that timestamp
636  };
637 
638  }
639 };
640 
644 class CDevNetParams : public CChainParams {
645 public:
647  strNetworkID = "devnet";
649  consensus.nMasternodePaymentsStartBlock = 4010; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
657  consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
658  consensus.nSuperblockStartHash = uint256(); // do not check this on devnet
659  consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on devnet
663  consensus.BIP34Height = 1; // BIP34 activated immediately on devnet
664  consensus.BIP65Height = 1; // BIP65 activated immediately on devnet
665  consensus.BIP66Height = 1; // BIP66 activated immediately on devnet
666  consensus.DIP0001Height = 2; // DIP0001 activated immediately on devnet
667  consensus.DIP0003Height = 2; // DIP0003 activated immediately on devnet
668  consensus.DIP0003EnforcementHeight = 2; // DIP0003 activated immediately on devnet
670  consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
671  consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
672  consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
675  consensus.nPowKGWHeight = 4001; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
676  consensus.nPowDGWHeight = 4001;
677  consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
678  consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
680  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
681  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
682 
683  // Deployment of BIP68, BIP112, and BIP113.
685  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1506556800; // September 28th, 2017
686  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1538092800; // September 28th, 2018
687 
688  // Deployment of DIP0001
690  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1505692800; // Sep 18th, 2017
691  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 1537228800; // Sep 18th, 2018
694 
695  // Deployment of BIP147
697  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nStartTime = 1517792400; // Feb 5th, 2018
698  consensus.vDeployments[Consensus::DEPLOYMENT_BIP147].nTimeout = 1549328400; // Feb 5th, 2019
701 
702  // Deployment of DIP0003
704  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1535752800; // Sep 1st, 2018
705  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nTimeout = 1567288800; // Sep 1st, 2019
708 
709  // Deployment of DIP0008
711  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
712  consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = 1900281600; // Mar 21st, 2030
715 
716  // Deployment of Block Reward Reallocation
718  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nStartTime = 1598918400; // Sep 1st, 2020
719  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nTimeout = 1900281600; // Mar 21st, 2030
723  consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
724 
725  // The best chain should have at least this much work.
726  consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");
727 
728  // By default assume that the signatures in ancestors of this block are valid.
729  consensus.defaultAssumeValid = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");
730 
731  pchMessageStart[0] = 0xe2;
732  pchMessageStart[1] = 0xca;
733  pchMessageStart[2] = 0xff;
734  pchMessageStart[3] = 0xce;
735  nDefaultPort = 19799;
736  nPruneAfterHeight = 1000;
737 
738  genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
740  assert(consensus.hashGenesisBlock == uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e"));
741  assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
742 
745 
746  vFixedSeeds.clear();
747  vSeeds.clear();
748  //vSeeds.push_back(CDNSSeedData("dashevo.org", "devnet-seed.dashevo.org"));
749 
750  // Testnet Dash addresses start with 'y'
751  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
752  // Testnet Dash script addresses start with '8' or '9'
753  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
754  // Testnet private keys start with '9' or 'c' (Bitcoin defaults)
755  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
756  // Testnet Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
757  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
758  // Testnet Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
759  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
760 
761  // Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
762  nExtCoinType = 1;
763 
764  // long living quorum params
771 
773  fRequireStandard = false;
775  fMineBlocksOnDemand = false;
777  fAllowMultiplePorts = true;
779 
784  nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
785 
786  vSporkAddresses = {"yjPtiKh2uwk3bDutTEA2q9mCtXyiZRWn55"};
787  nMinSporkKeys = 1;
788  // devnets are started with no blocks and no MN, so we can't check for upgraded MN (as there are none)
790 
792  {
793  { 0, uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")},
794  { 1, devnetGenesis.GetHash() },
795  }
796  };
797 
799  devnetGenesis.GetBlockTime(), // * UNIX timestamp of devnet genesis block
800  2, // * we only have 2 coinbase transactions when a devnet is started up
801  0.01 // * estimated number of transactions per second
802  };
803  }
804 };
805 
809 class CRegTestParams : public CChainParams {
810 public:
812  strNetworkID = "regtest";
823  consensus.nSuperblockStartHash = uint256(); // do not check this on regtest
828  consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
830  consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
831  consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
832  consensus.DIP0001Height = 2000;
833  consensus.DIP0003Height = 432;
836  consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
837  consensus.nPowTargetTimespan = 24 * 60 * 60; // Dash: 1 day
838  consensus.nPowTargetSpacing = 2.5 * 60; // Dash: 2.5 minutes
841  consensus.nPowKGWHeight = 15200; // same as mainnet
842  consensus.nPowDGWHeight = 34140; // same as mainnet
843  consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
844  consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
870 
871  // The best chain should have at least this much work.
873 
874  // By default assume that the signatures in ancestors of this block are valid.
876 
877  pchMessageStart[0] = 0xfc;
878  pchMessageStart[1] = 0xc1;
879  pchMessageStart[2] = 0xb7;
880  pchMessageStart[3] = 0xdc;
881  nDefaultPort = 19899;
882  nPruneAfterHeight = 1000;
883 
884  genesis = CreateGenesisBlock(1417713337, 1096447, 0x207fffff, 1, 50 * COIN);
886  assert(consensus.hashGenesisBlock == uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e"));
887  assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
888 
889  vFixedSeeds.clear();
890  vSeeds.clear();
891 
893  fRequireStandard = false;
895  fMineBlocksOnDemand = true;
897  fAllowMultiplePorts = true;
898  nLLMQConnectionRetryTimeout = 1; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior
899 
900  nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
905 
906  // privKey: cP4EKFyJsHT39LDqgdcB43Y3YXjNyjb5Fuas1GQSeAtjnZWmZEQK
907  vSporkAddresses = {"yj949n1UH6fDhw6HtVE5VMj2iSTaSWBMcW"};
908  nMinSporkKeys = 1;
909  // regtest usually has no masternodes in most tests, so don't check for upgraged MNs
911 
912  checkpointData = {
913  {
914  {0, uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e")},
915  }
916  };
917 
919  0,
920  0,
921  0
922  };
923 
924  // Regtest Dash addresses start with 'y'
925  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
926  // Regtest Dash script addresses start with '8' or '9'
927  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
928  // Regtest private keys start with '9' or 'c' (Bitcoin defaults)
929  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
930  // Regtest Dash BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
931  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
932  // Regtest Dash BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
933  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
934 
935  // Regtest Dash BIP44 coin type is '1' (All coin's testnet default)
936  nExtCoinType = 1;
937 
938  // long living quorum params
942  }
943 };
944 
945 static std::unique_ptr<CChainParams> globalChainParams;
946 
948  assert(globalChainParams);
949  return *globalChainParams;
950 }
951 
952 std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain)
953 {
954  if (chain == CBaseChainParams::MAIN)
955  return std::unique_ptr<CChainParams>(new CMainParams());
956  else if (chain == CBaseChainParams::TESTNET)
957  return std::unique_ptr<CChainParams>(new CTestNetParams());
958  else if (chain == CBaseChainParams::DEVNET) {
959  return std::unique_ptr<CChainParams>(new CDevNetParams());
960  } else if (chain == CBaseChainParams::REGTEST)
961  return std::unique_ptr<CChainParams>(new CRegTestParams());
962  throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
963 }
964 
965 void SelectParams(const std::string& network)
966 {
967  SelectBaseParams(network);
969 }
970 
971 void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
972 {
973  globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff);
974 }
975 
976 void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
977 {
978  globalChainParams->UpdateDIP3Parameters(nActivationHeight, nEnforcementHeight);
979 }
980 
981 void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
982 {
983  globalChainParams->UpdateBudgetParameters(nMasternodePaymentsStartBlock, nBudgetPaymentsStartBlock, nSuperblockStartBlock);
984 }
985 
986 void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
987 {
988  globalChainParams->UpdateSubsidyAndDiffParams(nMinimumDifficultyBlocks, nHighSubsidyBlocks, nHighSubsidyFactor);
989 }
990 
992 {
993  globalChainParams->UpdateLLMQChainLocks(llmqType);
994 }
995 
996 void UpdateLLMQTestParams(int size, int threshold)
997 {
998  globalChainParams->UpdateLLMQTestParams(size, threshold);
999 }
1000 
1001 void UpdateLLMQDevnetParams(int size, int threshold)
1002 {
1003  globalChainParams->UpdateLLMQDevnetParams(size, threshold);
1004 }
uint32_t nNonce
Definition: block.h:29
static Consensus::LLMQParams llmq_devnet
static CBlock CreateDevNetGenesisBlock(const uint256 &prevBlockHash, const std::string &devNetName, uint32_t nTime, uint32_t nNonce, uint32_t nBits, const CAmount &genesisReward)
Definition: chainparams.cpp:42
bool fMineBlocksOnDemand
Definition: chainparams.h:116
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
int nMasternodePaymentsIncreaseBlock
Definition: params.h:135
uint256 DIP0003EnforcementHash
Definition: params.h:161
uint256 BIP34Hash
Definition: params.h:150
void SetNull()
Definition: uint256.h:41
void UpdateLLMQTestParams(int size, int threshold)
Allows modifying parameters of the test LLMQ.
Main network.
int64_t nPowTargetTimespan
Definition: params.h:177
bool fPowNoRetargeting
Definition: params.h:175
static const std::string REGTEST
Definition: block.h:72
int nBudgetPaymentsCycleBlocks
Definition: params.h:140
#define strprintf
Definition: tinyformat.h:1066
std::vector< CTxIn > vin
Definition: transaction.h:293
std::vector< unsigned char > base58Prefixes[MAX_BASE58_TYPES]
Definition: chainparams.h:107
static const CAmount COIN
Definition: amount.h:14
int nBudgetPaymentsWindowBlocks
Definition: params.h:141
void UpdateLLMQDevnetParams(int size, int threshold)
Allows modifying parameters of the devnet LLMQ.
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
bool fPowAllowMinDifficultyBlocks
Definition: params.h:174
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:154
int nFulfilledRequestExpireTime
Definition: chainparams.h:126
static SeedSpec6 pnSeed6_test[]
int nSuperblockCycle
Definition: params.h:144
CChainParams defines various tweakable parameters of a given instance of the Dash system...
Definition: chainparams.h:41
int nMasternodePaymentsStartBlock
Definition: params.h:134
CBlock genesis
Definition: chainparams.h:110
int nHighSubsidyFactor
Definition: params.h:187
static Consensus::LLMQParams llmq400_60
uint256 nSuperblockStartHash
Definition: params.h:143
uint32_t nTime
Definition: block.h:27
int nGovernanceFilterElements
Definition: params.h:146
int nBudgetPaymentsStartBlock
Definition: params.h:139
CMessageHeader::MessageStartChars pchMessageStart
Definition: chainparams.h:103
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType)
arith_uint256 UintToArith256(const uint256 &a)
ChainTxData chainTxData
Definition: chainparams.h:121
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
int nSubsidyHalvingInterval
Definition: params.h:133
int64_t nFalloffCoeff
A coefficient which adjusts the speed a required number of signaling blocks is decreasing from nThres...
Definition: params.h:45
int nInstantSendKeepLock
Definition: params.h:138
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
int nPoolNewMinParticipants
Definition: chainparams.h:123
static CTransactionRef MakeTransactionRef()
Definition: transaction.h:346
LLMQType
Definition: params.h:48
int nMinimumDifficultyBlocks
these parameters are only used on devnet and can be configured from the outside
Definition: params.h:185
uint256 powLimit
Proof of work parameters.
Definition: params.h:173
bool fBIP9CheckMasternodesUpgraded
Definition: chainparams.h:129
int nPoolMaxParticipants
Definition: chainparams.h:124
int nInstantSendConfirmationsRequired
Definition: params.h:137
uint256 hashMerkleRoot
Definition: block.h:26
int nSuperblockStartBlock
Definition: params.h:142
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
DeploymentPos
Definition: params.h:15
bool fRequireStandard
Definition: chainparams.h:114
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:149
uint256 uint256S(const char *str)
Definition: uint256.h:143
int64_t nStartTime
Start MedianTime for version bits miner confirmation.
Definition: params.h:35
Regression test.
int64_t nPowTargetSpacing
Definition: params.h:176
int DIP0003Height
Block height at which DIP0003 becomes active.
Definition: params.h:158
uint256 hashPrevBlock
Definition: block.h:25
std::vector< std::string > vSeeds
Definition: chainparams.h:106
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
Definition: merkle.cpp:66
int64_t nWindowSize
The number of past blocks (including the block under consideration) to be taken into account for lock...
Definition: params.h:39
uint32_t nMinerConfirmationWindow
Definition: params.h:170
static const std::string DEVNET
int64_t GetBlockTime() const
Definition: block.h:65
bool fRequireRoutableExternalIP
Definition: chainparams.h:115
std::vector< CTxOut > vout
Definition: transaction.h:294
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
Allows modifying the Version Bits regtest parameters.
int nLLMQConnectionRetryTimeout
Definition: chainparams.h:119
int nGovernanceMinQuorum
Definition: params.h:145
std::map< LLMQType, LLMQParams > llmqs
Definition: params.h:189
void UpdateLLMQTestParams(int size, int threshold)
256-bit unsigned big integer.
int64_t nThresholdMin
A minimum number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to ...
Definition: params.h:43
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:152
Testnet (v3)
int DIP0003EnforcementHeight
Block height at which DIP0003 becomes enforced.
Definition: params.h:160
uint256 GetHash() const
Definition: block.cpp:14
int64_t nTimeout
Timeout/expiry MedianTime for the deployment attempt.
Definition: params.h:37
256-bit opaque blob.
Definition: uint256.h:123
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
Definition: chainparams.cpp:85
std::string GetDevNetName() const
Looks for -devnet and returns either "devnet-<name>" or simply "devnet" if no name was specified...
Definition: util.cpp:1045
ArgsManager gArgs
Definition: util.cpp:108
LLMQType llmqTypeChainLocks
Definition: params.h:190
uint256 nMinimumChainWork
Definition: params.h:181
std::vector< CTransactionRef > vtx
Definition: block.h:76
std::vector< SeedSpec6 > vFixedSeeds
Definition: chainparams.h:112
static CBlock FindDevNetGenesisBlock(const CBlock &prevBlock, const CAmount &reward)
#define ARRAYLEN(array)
uint256 defaultAssumeValid
Definition: params.h:182
int nPoolNewMaxParticipants
Definition: chainparams.h:125
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType)
Allows modifying the LLMQ type for ChainLocks.
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
Allows modifying the budget regtest parameters.
bool fAllowMultipleAddressesFromGroup
Definition: chainparams.h:117
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:389
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
Allows modifying the DIP3 activation and enforcement height.
Consensus::Params consensus
Definition: chainparams.h:102
std::vector< std::string > vSporkAddresses
Definition: chainparams.h:127
std::string strNetworkID
Definition: chainparams.h:109
int64_t nThresholdStart
A starting number of blocks, in the range of 1..nWindowSize, which must signal for a fork in order to...
Definition: params.h:41
bool error(const char *fmt, const Args &... args)
Definition: util.h:222
arith_uint256 & SetCompact(uint32_t nCompact, bool *pfNegative=nullptr, bool *pfOverflow=nullptr)
The "compact" format is a representation of a whole number N using an unsigned 32bit number similar t...
static const std::string TESTNET
A mutable version of CTransaction.
Definition: transaction.h:291
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of nMinerConfirmationWindow blocks in a reta...
Definition: params.h:168
uint64_t nPruneAfterHeight
Definition: chainparams.h:105
void UpdateLLMQDevnetParams(int size, int threshold)
CBlock devnetGenesis
Definition: chainparams.h:111
uint256 hashDevnetGenesisBlock
Definition: params.h:132
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
int nMasternodePaymentsIncreasePeriod
Definition: params.h:136
int bit
Bit position to select the particular bit in nVersion.
Definition: params.h:33
CCheckpointData checkpointData
Definition: chainparams.h:120
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
static SeedSpec6 pnSeed6_main[]
List of fixed seed nodes for the dash network AUTOGENERATED by contrib/seeds/generate-seeds.py.
int nPoolMinParticipants
Definition: chainparams.h:122
void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
Allows modifying the subsidy and difficulty devnet parameters.
LLMQType llmqTypeInstantSend
Definition: params.h:191
int32_t nVersion
Definition: block.h:24
static Consensus::LLMQParams llmq400_85
static std::unique_ptr< CChainParams > globalChainParams
bool fAllowMultiplePorts
Definition: chainparams.h:118
uint256 hashGenesisBlock
Definition: params.h:131
int nHighSubsidyBlocks
Definition: params.h:186
bool fDefaultConsistencyChecks
Definition: chainparams.h:113
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:171
int DIP0001Height
Block height at which DIP0001 becomes active.
Definition: params.h:156
int nMasternodeMinimumConfirmations
Definition: params.h:147
uint32_t nBits
Definition: block.h:28
static Consensus::LLMQParams llmq50_60
static Consensus::LLMQParams llmq_test
std::vector< unsigned char > ParseHex(const char *psz)
static CBlock CreateGenesisBlock(const char *pszTimestamp, const CScript &genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount &genesisReward)
Definition: chainparams.cpp:21
Released under the MIT license