Dogecoin Core  1.14.2
P2P Digital Currency
chainparams.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include "chainparams.h"
7 #include "consensus/merkle.h"
8 
9 #include "tinyformat.h"
10 #include "util.h"
11 #include "utilstrencodings.h"
12 
13 #include <assert.h>
14 
15 #include <boost/assign/list_of.hpp>
16 
17 #include "chainparamsseeds.h"
18 
19 static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
20 {
21  CMutableTransaction txNew;
22  txNew.nVersion = 1;
23  txNew.vin.resize(1);
24  txNew.vout.resize(1);
25  txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
26  txNew.vout[0].nValue = genesisReward;
27  txNew.vout[0].scriptPubKey = genesisOutputScript;
28 
29  CBlock genesis;
30  genesis.nTime = nTime;
31  genesis.nBits = nBits;
32  genesis.nNonce = nNonce;
33  genesis.nVersion = nVersion;
34  genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
35  genesis.hashPrevBlock.SetNull();
36  genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
37  return genesis;
38 }
39 
51 static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
52 {
53  const char* pszTimestamp = "Nintondo";
54  const CScript genesisOutputScript = CScript() << ParseHex("040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9") << OP_CHECKSIG;
55  return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
56 }
57 
69 class CMainParams : public CChainParams {
70 private:
73 public:
75  strNetworkID = "main";
76 
77  // Blocks 0 - 144999 are conventional difficulty calculation
82  // BIP34 is never enforced in Dogecoin v2 blocks, so we enforce from v3
83  consensus.BIP34Height = 1034383;
84  consensus.BIP34Hash = uint256S("0x80d1364201e5df97e696c03bdd24dc885e8617b9de51e453c10a4f629b1e797a");
85  consensus.BIP65Height = 3464751; // 34cd2cbba4ba366f47e5aa0db5f02c19eba2adf679ceb6653ac003bdc9a0ef1f - first v4 block after the last v3 block
86  consensus.BIP66Height = 1034383; // 80d1364201e5df97e696c03bdd24dc885e8617b9de51e453c10a4f629b1e797a - this is the last block that could be v2, 1900 blocks past the last v2 block
87  consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20;
88  consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
89  consensus.nPowTargetSpacing = 60; // 1 minute
95  consensus.nRuleChangeActivationThreshold = 9576; // 95% of 10,080
96  consensus.nMinerConfirmationWindow = 10080; // 60 * 24 * 7 = 10,080 blocks, or one week
98  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
99  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
100 
101  // Deployment of BIP68, BIP112, and BIP113.
102  // XXX: BIP heights and hashes all need to be updated to Dogecoin values
104  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800; // May 1st, 2016
105  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
106 
107  // Deployment of SegWit (BIP141, BIP143, and BIP147)
109  consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016.
111 
112  // The best chain should have at least this much work.
113  consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000141a39e783aad4f660f");
114 
115  // By default assume that the signatures in ancestors of this block are valid.
116  consensus.defaultAssumeValid = uint256S("0x77e3f4a4bcb4a2c15e8015525e3d15b466f6c022f6ca82698f329edef7d9777e"); // 2,510,150
117 
118  // AuxPoW parameters
119  consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
120  consensus.fStrictChainId = true;
123 
124  // Blocks 145000 - 371336 are Digishield without AuxPoW
129  digishieldConsensus.nPowTargetTimespan = 60; // post-digishield: 1 minute
131 
132  // Blocks 371337+ are AuxPoW
136 
137  // Assemble the binary search tree of consensus parameters
141 
147  pchMessageStart[0] = 0xc0;
148  pchMessageStart[1] = 0xc0;
149  pchMessageStart[2] = 0xc0;
150  pchMessageStart[3] = 0xc0;
151  vAlertPubKey = ParseHex("04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a");
152  nDefaultPort = 22556;
153  nPruneAfterHeight = 100000;
154 
155  genesis = CreateGenesisBlock(1386325540, 99943, 0x1e0ffff0, 1, 88 * COIN);
156 
160  assert(consensus.hashGenesisBlock == uint256S("0x1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"));
161  assert(genesis.hashMerkleRoot == uint256S("0x5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69"));
162 
163  // Note that of those with the service bits flag, most only support a subset of possible options
164  vSeeds.push_back(CDNSSeedData("multidoge.org", "seed.multidoge.org", true));
165  vSeeds.push_back(CDNSSeedData("multidoge.org", "seed2.multidoge.org"));
166 
167  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,30);
168  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,22);
169  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,158);
170  base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x02)(0xfa)(0xca)(0xfd).convert_to_container<std::vector<unsigned char> >();
171  base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x02)(0xfa)(0xc3)(0x98).convert_to_container<std::vector<unsigned char> >();
172 
173  //TODO: fix this for dogecoin -- plddr
174  //vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
175  vFixedSeeds.clear();
176 
177  fMiningRequiresPeers = true;
179  fRequireStandard = true;
180  fMineBlocksOnDemand = false;
181 
183  boost::assign::map_list_of
184  ( 0, uint256S("0x1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"))
185  ( 104679, uint256S("0x35eb87ae90d44b98898fec8c39577b76cb1eb08e1261cfc10706c8ce9a1d01cf"))
186  ( 145000, uint256S("0xcc47cae70d7c5c92828d3214a266331dde59087d4a39071fa76ddfff9b7bde72"))
187  ( 371337, uint256S("0x60323982f9c5ff1b5a954eac9dc1269352835f47c2c5222691d80f0d50dcf053"))
188  ( 450000, uint256S("0xd279277f8f846a224d776450aa04da3cf978991a182c6f3075db4c48b173bbd7"))
189  ( 771275, uint256S("0x1b7d789ed82cbdc640952e7e7a54966c6488a32eaad54fc39dff83f310dbaaed"))
190  ( 1000000, uint256S("0x6aae55bea74235f0c80bd066349d4440c31f2d0f27d54265ecd484d8c1d11b47"))
191  ( 1250000, uint256S("0x00c7a442055c1a990e11eea5371ca5c1c02a0677b33cc88ec728c45edc4ec060"))
192  ( 1500000, uint256S("0xf1d32d6920de7b617d51e74bdf4e58adccaa582ffdc8657464454f16a952fca6"))
193  ( 1750000, uint256S("0x5c8e7327984f0d6f59447d89d143e5f6eafc524c82ad95d176c5cec082ae2001"))
194  ( 2000000, uint256S("0x9914f0e82e39bbf21950792e8816620d71b9965bdbbc14e72a95e3ab9618fea8"))
195  ( 2031142, uint256S("0x893297d89afb7599a3c571ca31a3b80e8353f4cf39872400ad0f57d26c4c5d42"))
196  ( 2250000, uint256S("0x0a87a8d4e40dca52763f93812a288741806380cd569537039ee927045c6bc338"))
197  ( 2510150, uint256S("0x77e3f4a4bcb4a2c15e8015525e3d15b466f6c022f6ca82698f329edef7d9777e"))
198  ( 2750000, uint256S("0xd4f8abb835930d3c4f92ca718aaa09bef545076bd872354e0b2b85deefacf2e3"))
199  ( 3000000, uint256S("0x195a83b091fb3ee7ecb56f2e63d01709293f57f971ccf373d93890c8dc1033db"))
200  ( 3250000, uint256S("0x7f3e28bf9e309c4b57a4b70aa64d3b2ea5250ae797af84976ddc420d49684034"))
201  ( 3500000, uint256S("0xeaa303b93c1c64d2b3a2cdcf6ccf21b10cc36626965cc2619661e8e1879abdfb"))
202  ( 3606083, uint256S("0x954c7c66dee51f0a3fb1edb26200b735f5275fe54d9505c76ebd2bcabac36f1e"))
203  };
204 
206  // Data as of block 954c7c66dee51f0a3fb1edb26200b735f5275fe54d9505c76ebd2bcabac36f1e (height 3606083).
207  // Tx estimate based on average of year 2021 (~40k transactions per day)
208  1613217680, // * UNIX timestamp of last checkpoint block
209  71035468, // * total number of transactions between genesis and last checkpoint
210  // (the tx=... number in the SetBestChain debug.log lines)
211  0.46 // * estimated number of transactions per second after checkpoint
212  };
213  }
214 };
215 static CMainParams mainParams;
216 
220 class CTestNetParams : public CChainParams {
221 private:
225 public:
227  strNetworkID = "test";
228 
229  // Blocks 0 - 144999 are pre-Digishield
231  consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
239  consensus.nMajorityWindow = 1000;
240  // BIP34 is never enforced in Dogecoin v2 blocks, so we enforce from v3
241  consensus.BIP34Height = 708658;
242  consensus.BIP34Hash = uint256S("0x21b8b97dcdb94caa67c7f8f6dbf22e61e0cfe0e46e1fff3528b22864659e9b38");
243  consensus.BIP65Height = 1854705; // 955bd496d23790aba1ecfacb722b089a6ae7ddabaedf7d8fb0878f48308a71f9
244  consensus.BIP66Height = 708658; // 21b8b97dcdb94caa67c7f8f6dbf22e61e0cfe0e46e1fff3528b22864659e9b38 - this is the last block that could be v2, 1900 blocks past the last v2 block
245  consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20;
246  consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
247  consensus.nPowTargetSpacing = 60; // 1 minute
249  consensus.nRuleChangeActivationThreshold = 2880; // 2 days (note this is significantly lower than Bitcoin standard)
250  consensus.nMinerConfirmationWindow = 10080; // 60 * 24 * 7 = 10,080 blocks, or one week
252  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
253  consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
254 
255  // Deployment of BIP68, BIP112, and BIP113.
256  // XXX: BIP heights and hashes all need to be updated to Dogecoin values
258  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1456790400; // March 1st, 2016
259  consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
260 
261  // Deployment of SegWit (BIP141, BIP143, and BIP147)
263  consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1462060800; // May 1st 2016
265 
266  // The best chain should have at least this much work.
267  consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000001030d1382ade");
268 
269  // By default assume that the signatures in ancestors of this block are valid.
270  consensus.defaultAssumeValid = uint256S("0x6943eaeaba98dc7d09f7e73398daccb4abcabb18b66c8c875e52b07638d93951"); // 900,000
271 
272  // AuxPoW parameters
273  consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
274  consensus.fStrictChainId = false;
277 
278  // Blocks 145000 - 157499 are Digishield without minimum difficulty on all blocks
281  digishieldConsensus.nPowTargetTimespan = 60; // post-digishield: 1 minute
286 
287  // Blocks 157500 - 158099 are Digishield with minimum difficulty on all blocks
292 
293  // Enable AuxPoW at 158100
298 
299  // Assemble the binary search tree of parameters
304 
305  pchMessageStart[0] = 0xfc;
306  pchMessageStart[1] = 0xc1;
307  pchMessageStart[2] = 0xb7;
308  pchMessageStart[3] = 0xdc;
309  vAlertPubKey = ParseHex("042756726da3c7ef515d89212ee1705023d14be389e25fe15611585661b9a20021908b2b80a3c7200a0139dd2b26946606aab0eef9aa7689a6dc2c7eee237fa834");
310  nDefaultPort = 44556;
311  nPruneAfterHeight = 1000;
312 
313  genesis = CreateGenesisBlock(1391503289, 997879, 0x1e0ffff0, 1, 88 * COIN);
318  assert(consensus.hashGenesisBlock == uint256S("0xbb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e"));
319  assert(genesis.hashMerkleRoot == uint256S("0x5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69"));
320 
321  vFixedSeeds.clear();
322  vSeeds.clear();
323  // nodes with support for servicebits filtering should be at the top
324  vSeeds.push_back(CDNSSeedData("jrn.me.uk", "testseed.jrn.me.uk"));
325 
326  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,113); // 0x71
327  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196); // 0xc4
328  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,241); // 0xf1
329  base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xcf).convert_to_container<std::vector<unsigned char> >();
330  base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
331 
332  //TODO: fix this for dogecoin -- plddr
333  //vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
334 
335  fMiningRequiresPeers = true;
337  fRequireStandard = false;
338  fMineBlocksOnDemand = false;
339 
341  boost::assign::map_list_of
342  ( 0, uint256S("0xbb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e"))
343  ( 483173, uint256S("0xa804201ca0aceb7e937ef7a3c613a9b7589245b10cc095148c4ce4965b0b73b5"))
344  ( 591117, uint256S("0x5f6b93b2c28cedf32467d900369b8be6700f0649388a7dbfd3ebd4a01b1ffad8"))
345  ( 658924, uint256S("0xed6c8324d9a77195ee080f225a0fca6346495e08ded99bcda47a8eea5a8a620b"))
346  ( 703635, uint256S("0x839fa54617adcd582d53030a37455c14a87a806f6615aa8213f13e196230ff7f"))
347  ( 1000000, uint256S("0x1fe4d44ea4d1edb031f52f0d7c635db8190dc871a190654c41d2450086b8ef0e"))
348  ( 1202214, uint256S("0xa2179767a87ee4e95944703976fee63578ec04fa3ac2fc1c9c2c83587d096977"))
349  ( 1250000, uint256S("0xb46affb421872ca8efa30366b09694e2f9bf077f7258213be14adb05a9f41883"))
350  ( 1500000, uint256S("0x0caa041b47b4d18a4f44bdc05cef1a96d5196ce7b2e32ad3e4eb9ba505144917"))
351  ( 1750000, uint256S("0x8042462366d854ad39b8b95ed2ca12e89a526ceee5a90042d55ebb24d5aab7e9"))
352  ( 2000000, uint256S("0xd6acde73e1b42fc17f29dcc76f63946d378ae1bd4eafab44d801a25be784103c"))
353  ( 2250000, uint256S("0xc4342ae6d9a522a02e5607411df1b00e9329563ef844a758d762d601d42c86dc"))
354  ( 2500000, uint256S("0x3a66ec4933fbb348c9b1889aaf2f732fe429fd9a8f74fee6895eae061ac897e2"))
355  ( 2750000, uint256S("0x473ea9f625d59f534ffcc9738ffc58f7b7b1e0e993078614f5484a9505885563"))
356  ( 3062910, uint256S("0x113c41c00934f940a41f99d18b2ad9aefd183a4b7fe80527e1e6c12779bd0246"))
357 
358  };
359 
361  // Data as of block a113c41c00934f940a41f99d18b2ad9aefd183a4b7fe80527e1e6c12779bd024 (height 3062910)
362  1613217942, // * UNIX timestamp of last checkpoint block
363  4186373, // * total number of transactions between genesis and last checkpoint
364  0.05 // * estimated number of transactions per second after that timestamp
365  };
366 
367  }
368 };
369 static CTestNetParams testNetParams;
370 
374 class CRegTestParams : public CChainParams {
375 private:
378 public:
380  strNetworkID = "regtest";
384  consensus.nMajorityWindow = 1000;
385  consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
387  consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)
388  consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)
389  consensus.powLimit = uint256S("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1;
390  consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
391  consensus.nPowTargetSpacing = 1; // regtest: 1 second blocks
395  consensus.nRuleChangeActivationThreshold = 540; // 75% for testchains
396  consensus.nMinerConfirmationWindow = 720; // Faster than normal for regtest (2,520 instead of 10,080)
406 
407  // The best chain should have at least this much work.
409 
410  // By default assume that the signatures in ancestors of this block are valid.
412 
413  // AuxPow parameters
414  consensus.nAuxpowChainId = 0x0062; // 98 - Josh Wise!
415  consensus.fStrictChainId = true;
417 
418  // Dogecoin parameters
420  consensus.nCoinbaseMaturity = 60; // For easier testability in RPC tests
421 
424  digishieldConsensus.nPowTargetTimespan = 1; // regtest: also retarget every second in digishield mode, for conformity
426 
430 
431  // Assemble the binary search tree of parameters
435 
436  pchMessageStart[0] = 0xfa;
437  pchMessageStart[1] = 0xbf;
438  pchMessageStart[2] = 0xb5;
439  pchMessageStart[3] = 0xda;
440  nDefaultPort = 18444;
441  nPruneAfterHeight = 1000;
442 
443  genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 88 * COIN);
447  assert(consensus.hashGenesisBlock == uint256S("0x3d2160a3b5dc4a9d62e7e66a295f70313ac808440ef7400d6c0772171ce973a5"));
448  assert(genesis.hashMerkleRoot == uint256S("0x5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69"));
449 
450  vFixedSeeds.clear();
451  vSeeds.clear();
452 
453  fMiningRequiresPeers = false;
455  fRequireStandard = false;
456  fMineBlocksOnDemand = true;
457 
459  boost::assign::map_list_of
460  ( 0, uint256S("0x3d2160a3b5dc4a9d62e7e66a295f70313ac808440ef7400d6c0772171ce973a5"))
461  };
462 
464  0,
465  0,
466  0
467  };
468 
469  base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); // 0x6f
470  base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196); // 0xc4
471  base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239); // 0xef
472  base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
473  base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >();
474  }
475 
476  void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
477  {
478  consensus.vDeployments[d].nStartTime = nStartTime;
479  consensus.vDeployments[d].nTimeout = nTimeout;
480  }
481 };
482 static CRegTestParams regTestParams;
483 
484 static CChainParams *pCurrentParams = 0;
485 
487  assert(pCurrentParams);
488  return *pCurrentParams;
489 }
490 
491 const Consensus::Params *Consensus::Params::GetConsensus(uint32_t nTargetHeight) const {
492  if (nTargetHeight < this -> nHeightEffective && this -> pLeft != NULL) {
493  return this -> pLeft -> GetConsensus(nTargetHeight);
494  } else if (nTargetHeight > this -> nHeightEffective && this -> pRight != NULL) {
495  const Consensus::Params *pCandidate = this -> pRight -> GetConsensus(nTargetHeight);
496  if (pCandidate->nHeightEffective <= nTargetHeight) {
497  return pCandidate;
498  }
499  }
500 
501  // No better match below the target height
502  return this;
503 }
504 
505 CChainParams& Params(const std::string& chain)
506 {
507  if (chain == CBaseChainParams::MAIN)
508  return mainParams;
509  else if (chain == CBaseChainParams::TESTNET)
510  return testNetParams;
511  else if (chain == CBaseChainParams::REGTEST)
512  return regTestParams;
513  else
514  throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
515 }
516 
517 void SelectParams(const std::string& network)
518 {
519  SelectBaseParams(network);
520  pCurrentParams = &Params(network);
521 }
522 
523 void UpdateRegtestBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
524 {
525  regTestParams.UpdateBIP9Parameters(d, nStartTime, nTimeout);
526 }
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:15
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CChainParams & Params()
Return the currently selected parameters.
void UpdateRegtestBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
Allows modifying the BIP9 regtest parameters.
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
static const std::string REGTEST
static const std::string TESTNET
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: block.h:67
std::vector< CTransactionRef > vtx
Definition: block.h:70
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:47
Consensus::Params * pConsensusRoot
Definition: chainparams.h:89
CBlock genesis
Definition: chainparams.h:98
bool fDefaultConsistencyChecks
Definition: chainparams.h:101
std::vector< SeedSpec6 > vFixedSeeds
Definition: chainparams.h:99
int nDefaultPort
Definition: chainparams.h:93
std::string strNetworkID
Definition: chainparams.h:97
std::vector< unsigned char > base58Prefixes[MAX_BASE58_TYPES]
Definition: chainparams.h:96
std::vector< CDNSSeedData > vSeeds
Definition: chainparams.h:95
Consensus::Params consensus
Definition: chainparams.h:88
bool fRequireStandard
Definition: chainparams.h:102
bool fMiningRequiresPeers
Definition: chainparams.h:100
bool fMineBlocksOnDemand
Definition: chainparams.h:103
CCheckpointData checkpointData
Definition: chainparams.h:104
std::vector< unsigned char > vAlertPubKey
Raw pub key bytes for the broadcast alert signing key.
Definition: chainparams.h:92
CMessageHeader::MessageStartChars pchMessageStart
Definition: chainparams.h:90
uint64_t nPruneAfterHeight
Definition: chainparams.h:94
ChainTxData chainTxData
Definition: chainparams.h:105
Main network.
Definition: chainparams.cpp:69
Consensus::Params auxpowConsensus
Definition: chainparams.cpp:72
Consensus::Params digishieldConsensus
Definition: chainparams.cpp:71
int32_t nVersion
Definition: pureheader.h:29
uint32_t nNonce
Definition: pureheader.h:34
uint256 hashPrevBlock
Definition: pureheader.h:30
uint32_t nTime
Definition: pureheader.h:32
uint256 GetHash() const
Definition: pureheader.cpp:20
uint256 hashMerkleRoot
Definition: pureheader.h:31
uint32_t nBits
Definition: pureheader.h:33
Regression test.
Consensus::Params digishieldConsensus
Consensus::Params auxpowConsensus
void UpdateBIP9Parameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:377
Testnet (v3)
Consensus::Params auxpowConsensus
Consensus::Params minDifficultyConsensus
Consensus::Params digishieldConsensus
void SetNull()
Definition: uint256.h:40
256-bit opaque blob.
Definition: uint256.h:123
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
Definition: merkle.cpp:158
DeploymentPos
Definition: params.h:16
@ DEPLOYMENT_CSV
Definition: params.h:18
@ DEPLOYMENT_SEGWIT
Definition: params.h:19
@ DEPLOYMENT_TESTDUMMY
Definition: params.h:17
@ OP_CHECKSIG
Definition: script.h:161
A mutable version of CTransaction.
Definition: transaction.h:413
std::vector< CTxOut > vout
Definition: transaction.h:416
std::vector< CTxIn > vin
Definition: transaction.h:415
int bit
Bit position to select the particular bit in nVersion.
Definition: params.h:29
int64_t nTimeout
Timeout/expiry MedianTime for the deployment attempt.
Definition: params.h:33
int64_t nStartTime
Start MedianTime for version bits miner confirmation.
Definition: params.h:31
Parameters that influence chain consensus.
Definition: params.h:39
int nMajorityWindow
Definition: params.h:45
bool fDigishieldDifficultyCalculation
Dogecoin-specific parameters.
Definition: params.h:71
bool fStrictChainId
Definition: params.h:80
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:50
uint256 BIP34Hash
Definition: params.h:48
bool fSimplifiedRewards
Definition: params.h:73
const Consensus::Params * GetConsensus(uint32_t nTargetHeight) const
uint32_t nMinerConfirmationWindow
Definition: params.h:59
uint256 defaultAssumeValid
Definition: params.h:76
int32_t nAuxpowChainId
Auxpow parameters.
Definition: params.h:79
struct Params * pLeft
Definition: params.h:85
bool fPowAllowDigishieldMinDifficultyBlocks
Definition: params.h:72
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:47
int nSubsidyHalvingInterval
Definition: params.h:41
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:60
uint256 hashGenesisBlock
Definition: params.h:40
bool fPowNoRetargeting
Definition: params.h:65
uint256 nMinimumChainWork
Definition: params.h:75
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period,...
Definition: params.h:58
int64_t nPowTargetTimespan
Definition: params.h:67
struct Params * pRight
Definition: params.h:86
uint32_t nCoinbaseMaturity
Definition: params.h:61
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:52
uint256 powLimit
Proof of work parameters.
Definition: params.h:63
int nMajorityRejectBlockOutdated
Definition: params.h:44
uint32_t nHeightEffective
Height-aware consensus parameters.
Definition: params.h:84
int nMajorityEnforceBlockUpgrade
Used to check majorities for block version upgrade.
Definition: params.h:43
bool fAllowLegacyBlocks
Definition: params.h:81
int64_t nPowTargetSpacing
Definition: params.h:66
bool fPowAllowMinDifficultyBlocks
Definition: params.h:64
#define strprintf
Definition: tinyformat.h:1047
uint256 uint256S(const char *str)
Definition: uint256.h:144
vector< unsigned char > ParseHex(const char *psz)