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.
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)
27 txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
42 static CBlock CreateDevNetGenesisBlock(const uint256 &prevBlockHash, const std::string& devNetName, uint32_t nTime, uint32_t nNonce, uint32_t nBits, const CAmount& genesisReward)
51 txNew.vin[0].scriptSig = CScript() << 1 << std::vector<unsigned char>(devNetName.begin(), devNetName.end());
77 static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
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);
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)
109 void CChainParams::UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
116 void CChainParams::UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
149 CBlock block = CreateDevNetGenesisBlock(prevBlock.GetHash(), devNetName.c_str(), prevBlock.nTime + 1, 0, prevBlock.nBits, reward);
162 // This is very unlikely to happen as we start the devnet with a very low difficulty. In many cases even the first
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
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
299 consensus.BIP34Hash = uint256S("0x000001f35e70f7c5705f64c6c5cc3dea9449e74d5b5c7cf74dad1bcca14a8012");
300 consensus.BIP65Height = 619382; // 00000000000076d8fcea02ec0963de4abfd01e771fec0863f960c2c64fe6f357
301 consensus.BIP66Height = 245817; // 00000000000b1fa2dfa312863570e13fae9ca7b5566cb27e55422620b469aefa
305 consensus.DIP0003EnforcementHash = uint256S("000000000000002d1734087b4c5afc3133e4e1c3e1a89218f62bcd9bb3d17f81");
306 consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
316 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
317 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
326 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1508025600; // Oct 15th, 2017
347 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1557878400; // May 15th, 2019
359 consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
362 consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000406cf3437a522656342a"); // 1344000
365 consensus.defaultAssumeValid = uint256S("0x000000000000000c01e55cb55bcb15f700d79563efcbdecf8ab5aaee33dcfa49"); // 1344000
381 assert(consensus.hashGenesisBlock == uint256S("0x00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6"));
382 assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
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
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
495 consensus.BIP34Hash = uint256S("0x000008ebb1db2598e897d17275285767717c6acfeac4c73def49fbea1ddcbcb6");
496 consensus.BIP65Height = 2431; // 0000039cf01242c7f921dcb4806a5994bc003b48c1973ae0c89b67809c2bb2ab
497 consensus.BIP66Height = 2075; // 0000002acdd29a14583540cb72e1c5cc83783560e38fa7081495d474fe1671f7
501 consensus.DIP0003EnforcementHash = uint256S("00000055ebc0e974ba3a3fb785c5ad4365a39637d4df168169ee80d313612f8f");
502 consensus.powLimit = uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20
508 consensus.nPowDGWHeight = 4002; // TODO: make sure to drop all spork6 related code on next testnet reset
512 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
513 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
522 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1544655600; // Dec 13th, 2018
536 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0003].nStartTime = 1544655600; // Dec 13th, 2018
543 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
555 consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
558 consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000022b7d3bf9070c88"); // 387900
561 consensus.defaultAssumeValid = uint256S("0x0000019906db5219bdc6c9a0a94facf80356bcf1afebc0d356485711a294385f"); // 387900
572 assert(consensus.hashGenesisBlock == uint256S("0x00000bafbc94add76cb75e2ec92894837288a481e5c005f6563d91623bf8bc2c"));
573 assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
580 vSeeds.emplace_back("testnet-seed.dashdot.io"); // Just a static list of stable node(s), only supports x9
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
670 consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
680 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
681 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
685 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1506556800; // September 28th, 2017
686 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1538092800; // September 28th, 2018
690 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1505692800; // Sep 18th, 2017
711 consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
723 consensus.vDeployments[Consensus::DEPLOYMENT_REALLOC].nFalloffCoeff = 5; // this corresponds to 10 periods
726 consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");
729 consensus.defaultAssumeValid = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");
740 assert(consensus.hashGenesisBlock == uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e"));
741 assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
788 // devnets are started with no blocks and no MN, so we can't check for upgraded MN (as there are none)
828 consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
836 consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 1
844 consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
886 assert(consensus.hashGenesisBlock == uint256S("0x000008ca1832a4baf228eb1553c03d3a2c8e02399550dd6ea8d65cec3ef23d2e"));
887 assert(genesis.hashMerkleRoot == uint256S("0xe0028eb9648db56b1ac77cf090b99048a8007e2bb64b68f092c03c7f56a662c7"));
898 nLLMQConnectionRetryTimeout = 1; // must be lower then the LLMQ signing session timeout so that tests have control over failing behavior
971 void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
973 globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout, nWindowSize, nThresholdStart, nThresholdMin, nFalloffCoeff);
981 void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
983 globalChainParams->UpdateBudgetParameters(nMasternodePaymentsStartBlock, nBudgetPaymentsStartBlock, nSuperblockStartBlock);
986 void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
988 globalChainParams->UpdateSubsidyAndDiffParams(nMinimumDifficultyBlocks, nHighSubsidyBlocks, nHighSubsidyFactor);
Definition: params.h:20
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
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
Definition: chainparams.cpp:116
int nMasternodePaymentsIncreaseBlock
Definition: params.h:135
Definition: chainparams.h:47
void UpdateLLMQTestParams(int size, int threshold)
Allows modifying parameters of the test LLMQ.
Definition: chainparams.cpp:996
Definition: block.h:72
Definition: script.h:165
Definition: chainparams.h:46
std::vector< unsigned char > base58Prefixes[MAX_BASE58_TYPES]
Definition: chainparams.h:107
int nBudgetPaymentsWindowBlocks
Definition: params.h:141
Definition: chainparams.h:49
void UpdateLLMQDevnetParams(int size, int threshold)
Allows modifying parameters of the devnet LLMQ.
Definition: chainparams.cpp:1001
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
Definition: chainparams.cpp:103
Definition: chainparams.h:48
bool fPowAllowMinDifficultyBlocks
Definition: params.h:174
int nFulfilledRequestExpireTime
Definition: chainparams.h:126
CChainParams defines various tweakable parameters of a given instance of the Dash system...
Definition: chainparams.h:41
int nMasternodePaymentsStartBlock
Definition: params.h:134
Definition: chainparams.h:24
Definition: params.h:23
CMessageHeader::MessageStartChars pchMessageStart
Definition: chainparams.h:103
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType)
Definition: chainparams.cpp:123
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:20
Definition: params.h:22
Definition: params.h:17
int64_t nFalloffCoeff
A coefficient which adjusts the speed a required number of signaling blocks is decreasing from nThres...
Definition: params.h:45
Definition: params.h:60
int nMinimumDifficultyBlocks
these parameters are only used on devnet and can be configured from the outside
Definition: params.h:185
Definition: script.h:86
Definition: script.h:205
bool fBIP9CheckMasternodesUpgraded
Definition: chainparams.h:129
int nInstantSendConfirmationsRequired
Definition: params.h:137
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
Definition: chainparams.cpp:952
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
Definition: chainparams.cpp:965
Definition: params.h:21
Definition: chainparams.h:28
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
bool fRequireRoutableExternalIP
Definition: chainparams.h:115
Definition: params.h:65
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.
Definition: chainparams.cpp:971
int nLLMQConnectionRetryTimeout
Definition: chainparams.h:119
void UpdateLLMQTestParams(int size, int threshold)
Definition: chainparams.cpp:127
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
Definition: params.h:52
int DIP0003EnforcementHeight
Block height at which DIP0003 becomes enforced.
Definition: params.h:160
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
Definition: chainparams.h:45
static CBlock FindDevNetGenesisBlock(const CBlock &prevBlock, const CAmount &reward)
Definition: chainparams.cpp:144
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType)
Allows modifying the LLMQ type for ChainLocks.
Definition: chainparams.cpp:991
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
Allows modifying the budget regtest parameters.
Definition: chainparams.cpp:981
bool fAllowMultipleAddressesFromGroup
Definition: chainparams.h:117
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
Definition: params.h:54
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
Allows modifying the DIP3 activation and enforcement height.
Definition: chainparams.cpp:976
std::vector< std::string > vSporkAddresses
Definition: chainparams.h:127
Definition: params.h:18
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
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...
Definition: arith_uint256.cpp:206
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of nMinerConfirmationWindow blocks in a reta...
Definition: params.h:168
void UpdateLLMQDevnetParams(int size, int threshold)
Definition: chainparams.cpp:135
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
Definition: chainparams.cpp:109
int nMasternodePaymentsIncreasePeriod
Definition: params.h:136
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
Definition: chainparamsbase.cpp:103
static SeedSpec6 pnSeed6_main[]
List of fixed seed nodes for the dash network AUTOGENERATED by contrib/seeds/generate-seeds.py.
Definition: chainparamsseeds.h:10
Definition: params.h:19
void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
Allows modifying the subsidy and difficulty devnet parameters.
Definition: chainparams.cpp:986
static std::unique_ptr< CChainParams > globalChainParams
Definition: chainparams.cpp:945
Definition: params.h:53
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:171
int nMasternodeMinimumConfirmations
Definition: params.h:147
Definition: params.h:57
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