/** * CChainParams defines various tweak-able parameters of a given instance of the * Bitcoin system. There are three: the main network on which people trade goods * and services, the public test network which gets reset from time to time and * a regression test mode which is intended for private networks only. It has * minimal difficulty to ensure that blocks can be found instantly. */ classCMainParams :public CChainParams { public: CMainParams() { //工作网络,还可能是测试或者回归测试网络等,不需要修改 strNetworkID = "main";
consensus.BIP16Height = 173805; // 00000000000000ce80a7e057163a4db1d5ad7b20fb6f598c9597b9665c8fb0d4 - April 1, 2012 // BIP34Height and BIP34Hash are just the historical height and block hash at which BIP34 activated. // They are an optimization. Earlier versions of the code implemented the exact rules from the BIP34, checking // whether the transition criteria were satisfied for every block. This was relatively expensive, and as BIP34's // activation is a long time ago now, that check has been replaced with a simpler one that just looks at height and // hash of the chain at a certain height. // If you create a new chain from scratch, you can just set this to 0/genesis to have BIP34 be active from the start. consensus.BIP34Height = 227931; consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
// 算力极限值,最低难度值(difficult = 1)时所对应的256位的二进制数值 //consensus.powLimit is the absolute highest target (lowest difficulty) allowed. But in practice, it is identical to genesis.nBits because the difficulty target is canonically stored in compact form. If you take consensus.powLimit, convert to compact form and then convert back, you get genesis.nBits consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // 算力修改间隔,每两周调整一次难度 consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks // 平均每600秒出一个块(10分钟) consensus.nPowTargetSpacing = 10 * 60; // 不允许在当前难度周期挖低难度的块,仅在网上测试时才允许 consensus.fPowAllowMinDifficultyBlocks = false; // 每个难度周期内(2016个块)不允许调整难度值 consensus.fPowNoRetargeting = false;
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008
// Deployment of BIP68, BIP112, and BIP113. consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0; consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1462060800; // May 1st, 2016 consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1493596800; // May 1st, 2017
// Deployment of SegWit (BIP141, BIP143, and BIP147) consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1; consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1479168000; // November 15th, 2016. consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1510704000; // November 15th, 2017.
// The best chain should have at least this much work. // The minimum amount of chain work that a client must have before it will consider itself synchronized. // 改成全0 consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000f91c579d57cad4bc5278cc");
// By default assume that the signatures in ancestors of this block are valid. // 改成全0 consensus.defaultAssumeValid = uint256S("0x0000000000000000005214481d2d96f898e3d5416e43359c145944a909d242e0"); //506067
/*These are the network ‘magic bytes'; They’re a series of four bytes that identify messages as belonging to a particular protocol. 0xf9, 0xbe, 0xb4, and 0xd9 are the ones Bitcoin uses. You want to use something else, so that nobody can ever trick your newcoin client into connecting to the Bitcoin network, or vice versa. It doesn’t matter what these are except that they shouldn’t match the ones used in other protocols (particularly other cryptocurrency block chains). They have to be values between 0 and 255.,需要修改掉 */ pchMessageStart[0] = 0xf9; pchMessageStart[1] = 0xbe; pchMessageStart[2] = 0xb4; pchMessageStart[3] = 0xd9;
// Note that of those which support the service bits prefix, most only support a subset of // possible options. // This is fine at runtime as we'll fall back to using them as a oneshot if they dont support the // service bits we want, but we should get them updated to support all service bits wanted by any // release ASAP to avoid it where possible. vSeeds.emplace_back("seed.bitcoin.sipa.be"); // Pieter Wuille, only supports x1, x5, x9, and xd vSeeds.emplace_back("dnsseed.bluematt.me"); // Matt Corallo, only supports x9 vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org"); // Luke Dashjr vSeeds.emplace_back("seed.bitcoinstats.com"); // Christian Decker, supports x1 - xf vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch"); // Jonas Schnelli, only supports x1, x5, x9, and xd vSeeds.emplace_back("seed.btc.petertodd.org"); // Peter Todd, only supports x1, x5, x9, and xd
//[https://en.bitcoin.it/wiki/List_of_address_prefixes](http://) //Blockchain-based currencies use encoded strings, which are a Base58Check encoding of some hash, //typically that of a public key. The encoding includes a prefix (traditionally a single version byte), //which affects the leading symbol(s) in the encoded result. //Pubkey hash (P2PKH address) base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsignedchar>(1,0); //Script hash (P2SH address) base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsignedchar>(1,5); //Private key (WIF, uncompressed pubkey) base58Prefixes[SECRET_KEY] = std::vector<unsignedchar>(1,128); //BIP32 pubkey base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; //BIP32 private key base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
chainTxData = ChainTxData{ // Data as of block 0000000000000000002d6cca6761c99b3c2e936f9a0e304b7c7651a993f461de (height 506081). 1516903077, // * UNIX timestamp of last known number of transactions 295363220, // * total number of transactions between genesis and that timestamp // (the tx=... number in the SetBestChain debug.log lines) 3.5// * estimated number of transactions per second after that timestamp }; } };