Skip to content

Commit

Permalink
update chainparams
Browse files Browse the repository at this point in the history
  • Loading branch information
masicode committed Apr 7, 2021
1 parent a5fced8 commit 7f6fe8e
Showing 1 changed file with 81 additions and 67 deletions.
148 changes: 81 additions & 67 deletions src/chainparams.cpp
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2014-2018 The Dash Core developers
// Copyright (c) 2014-2018 The Dash Core developers
// Copyright (c) 2018-2021 The Veco Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
Expand Down Expand Up @@ -39,28 +39,51 @@ static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesi
return genesis;
}

/**
* Build the genesis block. Note that the output of its generation
* transaction cannot be spent since it did not originally exist in the
* database.
*
* CBlock(hash=00000ffd590b14, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=e0028e, nTime=1390095618, nBits=1e0ffff0, nNonce=28917698, vtx=1)
* CTransaction(hash=e0028e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
* CTxIn(COutPoint(000000, -1), coinbase 04ffff001d01044c5957697265642030392f4a616e2f3230313420546865204772616e64204578706572696d656e7420476f6573204c6976653a204f76657273746f636b2e636f6d204973204e6f7720416363657074696e6720426974636f696e73)
* CTxOut(nValue=50.00000000, scriptPubKey=0xA9037BAC7050C479B121CF)
* vMerkleTree: e0028e
*/
static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
{
const char* pszTimestamp = "Decentralised Economy += VECO; 9 October 2018";
const CScript genesisOutputScript = CScript() << ParseHex("0431d9e740dfaa5e7f4c230bcd6ced7e8cdc5bf9f54acbc0f53c10e27a4e661b787a28be070def9b68ef679206cbe4590305ddb8f1bfd1865e20db9cc03ae09819") << OP_CHECKSIG;
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
}

/**
* 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
*/


class CMainParams : public CChainParams {
public:
CMainParams() {
strNetworkID = "main";
consensus.nSubsidyHalvingInterval = 262800;
consensus.nMasternodePaymentsStartBlock = 1080;
consensus.nMasternodePaymentsIncreaseBlock = 10081;
consensus.nMasternodePaymentsIncreasePeriod = 262800;
consensus.nSubsidyHalvingInterval = 262800; // Note: actual number of blocks per calendar year with DGW v3 is ~200700 (for example 449750 - 249050)
consensus.nMasternodePaymentsStartBlock = 1080; // true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 10081; // actual historical value
consensus.nMasternodePaymentsIncreasePeriod = 720*365; // 17280 - actual historical value
consensus.nInstantSendKeepLock = 24;
consensus.nBudgetPaymentsStartBlock = 99999999;
consensus.nBudgetPaymentsCycleBlocks = 21600;
consensus.nBudgetPaymentsStartBlock = 99999999; // actual historical value
consensus.nBudgetPaymentsCycleBlocks = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nBudgetPaymentsWindowBlocks = 100;
consensus.nBudgetProposalEstablishingTime = 60*60*24;
consensus.nSuperblockStartBlock = 99999999;
consensus.nSuperblockCycle = 21600;
consensus.nSuperblockStartBlock = 99999999; // The block at which 12.1 goes live (end of final 12.0 budget cycle)
consensus.nSuperblockCycle = 16616; // ~(60*24*30)/2.6, actual number of blocks per month is 200700 / 12 = 16725
consensus.nGovernanceMinQuorum = 10;
consensus.nGovernanceFilterElements = 20000;
consensus.nMasternodeMinimumConfirmations = 15;
Expand All @@ -70,8 +93,8 @@ class CMainParams : public CChainParams {
consensus.BIP34Height = 0;
consensus.BIP34Hash = uint256S("0x000003fd1dff397d1be86183efd9e13f0316b5f5a3082bac91975a421bc43021");
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowTargetTimespan = 86400; // Veco: 1 day
consensus.nPowTargetSpacing = 110; // Veco: 2.0 minutes
consensus.nPowTargetTimespan = 24 * 60 * 60; // Veco: 1 day
consensus.nPowTargetSpacing = 110; // Veco: ~ 2 minutes
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
consensus.nPowKGWHeight = 0;
Expand All @@ -84,55 +107,54 @@ class CMainParams : public CChainParams {

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1486252800; // Feb 5th, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1517788800; // Feb 5th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1618358400; // Feb 5th, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1649980799; // Feb 5th, 2018

// Deployment of DIP0001
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1508025600; // Oct 15th, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 1539561600; // Oct 15th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nStartTime = 1618531200; // Oct 15th, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nTimeout = 1650067200; // Oct 15th, 2018
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nWindowSize = 4032;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 3226; // 80% of 4032

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010");
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010"); // 782700

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x000003fd1dff397d1be86183efd9e13f0316b5f5a3082bac91975a421bc43021");
consensus.defaultAssumeValid = uint256S("0x000003fd1dff397d1be86183efd9e13f0316b5f5a3082bac91975a421bc43021"); // 782700

/**
* 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] = 0x76; //v
pchMessageStart[1] = 0x65; //e
pchMessageStart[2] = 0x63; //c
pchMessageStart[3] = 0x6F; //o
pchMessageStart[0] = 0x76;
pchMessageStart[1] = 0x65;
pchMessageStart[2] = 0x63;
pchMessageStart[3] = 0x6F;
vAlertPubKey = ParseHex("047738e763b45593b3bc080cfd2ec07ce725d2c39b18e4bccced4ed75856afa15e88399cc894bbe9f10d98dd715081a27d3c45e5e7382f07c4c6bd32a9acda5c7d");
nDefaultPort = 26919;

nMaxTipAge = 21600;
nDelayGetHeadersTime = 86400;
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
nDelayGetHeadersTime = 24 * 60 * 60;
nPruneAfterHeight = 100000;

genesis = CreateGenesisBlock(1539043200, 1599202, 0x1e0ffff0, 1, 20 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
assert(consensus.hashGenesisBlock == uint256S("0x000003fd1dff397d1be86183efd9e13f0316b5f5a3082bac91975a421bc43021"));
assert(genesis.hashMerkleRoot == uint256S("0xde4fe11d6d0c735a192d4e6eed593ad575ccd671ff4ff0d9188e347e067d028d"));

vSeeds.clear();
vSeeds.push_back(CDNSSeedData("veco.to", "block.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "dns.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "seed.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "masi.veco.to"));

vSeeds.push_back(CDNSSeedData("veco.to", "dnsseed1.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "dnsseed2.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "block.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "trade.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "edu.veco.to"));

// Veco addresses start with 'V'
// Veco addresses start with 'X'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,70);
// Veco script addresses start with '9'
// Veco script addresses start with '7'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,20);
// Veco private keys start with 'X'
// Veco private keys start with '7' or 'X'
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,75);
// Veco BIP32 pubkeys start with 'xpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >();
Expand All @@ -152,7 +174,7 @@ class CMainParams : public CChainParams {

nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
strSporkPubKey = "04825df8a146091cd7527a55a648cf1c23efb3cc25bed2029eaa17a606918be747b9afa29e08da4df312f8cfc9823fb3707635e8744000390574b40f28c0d509a9";
strSporkPubKey = "04549ac134f694c0243f503e8c8a9a986f5de6610049c40b07816809b0d1d06a21b07be27b9bb555931773f62ba6cf35a25fd52f694d4e1106ccd237a7bb899fdd";

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
Expand All @@ -175,16 +197,16 @@ class CTestNetParams : public CChainParams {
CTestNetParams() {
strNetworkID = "test";
consensus.nSubsidyHalvingInterval = 210240;
consensus.nMasternodePaymentsStartBlock = 4010;
consensus.nMasternodePaymentsStartBlock = 4010; // not true, but it's ok as long as it's less then nMasternodePaymentsIncreaseBlock
consensus.nMasternodePaymentsIncreaseBlock = 4030;
consensus.nMasternodePaymentsIncreasePeriod = 10;
consensus.nInstantSendKeepLock = 6;
consensus.nBudgetPaymentsStartBlock = 4100;
consensus.nBudgetPaymentsCycleBlocks = 50;
consensus.nBudgetPaymentsWindowBlocks = 10;
consensus.nBudgetProposalEstablishingTime = 60*20;
consensus.nSuperblockStartBlock = 4200;
consensus.nSuperblockCycle = 24;
consensus.nSuperblockStartBlock = 4200; // NOTE: Should satisfy nSuperblockStartBlock > nBudgetPeymentsStartBlock
consensus.nSuperblockCycle = 24; // Superblocks can be issued hourly on testnet
consensus.nGovernanceMinQuorum = 1;
consensus.nGovernanceFilterElements = 500;
consensus.nMasternodeMinimumConfirmations = 1;
Expand All @@ -195,10 +217,10 @@ class CTestNetParams : public CChainParams {
consensus.BIP34Hash = uint256S("0x00000997e30aad936446ab7226cecd21875e867a57aca1a46d17be4316bab391");
consensus.powLimit = uint256S("00000fffff000000000000000000000000000000000000000000000000000000");
consensus.nPowTargetTimespan = 24 * 60 * 60; // Veco: 1 day
consensus.nPowTargetSpacing = 2.0 * 60; // Veco: 2.0 minutes
consensus.nPowTargetSpacing = 2.5 * 60; // Veco: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nPowKGWHeight = 0;
consensus.nPowKGWHeight = 0; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
consensus.nPowDGWHeight = 0;
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
Expand All @@ -219,15 +241,15 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 50; // 50% of 100

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010");
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000100010"); // 37900

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00000997e30aad936446ab7226cecd21875e867a57aca1a46d17be4316bab391");
consensus.defaultAssumeValid = uint256S("0x00000997e30aad936446ab7226cecd21875e867a57aca1a46d17be4316bab391"); // 37900

pchMessageStart[0] = 0x76; //v
pchMessageStart[1] = 0x65; //e
pchMessageStart[2] = 0x63; //c
pchMessageStart[3] = 0x74; //testnet
pchMessageStart[0] = 0x76;
pchMessageStart[1] = 0x65;
pchMessageStart[2] = 0x63;
pchMessageStart[3] = 0x74;
vAlertPubKey = ParseHex("04a6df8bb80ab3113dcae21d2a9ced9b2f48811ce079e44a19a53d0aae223388b79f5dfec3abe9dccfe250edd0caf243168ce4f0965fd8f0857c390c76da1a1db1");
nDefaultPort = 16919;
nMaxTipAge = 0x7fffffff; // allow mining on top of old blocks for testnet
Expand All @@ -241,16 +263,8 @@ class CTestNetParams : public CChainParams {

vFixedSeeds.clear();
vSeeds.clear();
vSeeds.push_back(CDNSSeedData("veco.info", "test01.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test02.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test03.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test04.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test05.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test06.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test07.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test08.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test09.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.info", "test10.veco.info"));
vSeeds.push_back(CDNSSeedData("veco.to", "testnet-seed.veco.to"));
vSeeds.push_back(CDNSSeedData("veco.to", "test.dnsseed.veco.to"));

// Testnet Veco addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
Expand All @@ -266,12 +280,12 @@ class CTestNetParams : public CChainParams {
// Testnet Veco BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1;

//vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));

fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
fMineBlocksOnDemand = true;
fMineBlocksOnDemand = false;
fTestnetToBeDeprecatedFieldRPC = true;

nPoolMaxTransactions = 3;
Expand Down Expand Up @@ -319,11 +333,11 @@ class CRegTestParams : public CChainParams {
consensus.BIP34Hash = uint256();
consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
consensus.nPowTargetTimespan = 24 * 60 * 60; // Veco: 1 day
consensus.nPowTargetSpacing = 2.0 * 60; // Veco: 2.0 minutes
consensus.nPowTargetSpacing = 2.5 * 60; // Veco: 2.5 minutes
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = true;
consensus.nPowKGWHeight = 0;
consensus.nPowDGWHeight = 0;
consensus.nPowKGWHeight = 15200; // same as mainnet
consensus.nPowDGWHeight = 34140; // same as mainnet
consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
Expand All @@ -342,13 +356,13 @@ class CRegTestParams : public CChainParams {
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00");

pchMessageStart[0] = 0x76; //v
pchMessageStart[1] = 0x65; //e
pchMessageStart[2] = 0x63; //c
pchMessageStart[3] = 0x72; //reg
pchMessageStart[0] = 0x76;
pchMessageStart[1] = 0x65;
pchMessageStart[2] = 0x63;
pchMessageStart[3] = 0x72;
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
nDelayGetHeadersTime = 0; // never delay GETHEADERS in regtests
nDefaultPort = 8334;
nDefaultPort = 19994;
nPruneAfterHeight = 1000;

genesis = CreateGenesisBlock(1531958400, 1, 0x207fffff, 1, 20 * COIN);
Expand All @@ -375,11 +389,11 @@ class CRegTestParams : public CChainParams {
0
};
// Regtest Veco addresses start with 'y'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 140);
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,140);
// Regtest Veco script addresses start with '8' or '9'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 19);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,19);
// Regtest private keys start with '9' or 'c' (Bitcoin defaults)
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 239);
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
// Regtest Veco BIP32 pubkeys start with 'tpub' (Bitcoin defaults)
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >();
// Regtest Veco BIP32 prvkeys start with 'tprv' (Bitcoin defaults)
Expand Down

0 comments on commit 7f6fe8e

Please sign in to comment.