Branch data Line data Source code
# 1 : : // Copyright (c) 2010 Satoshi Nakamoto
# 2 : : // Copyright (c) 2009-2021 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 : :
# 8 : : #include <chainparamsseeds.h>
# 9 : : #include <consensus/merkle.h>
# 10 : : #include <deploymentinfo.h>
# 11 : : #include <hash.h> // for signet block challenge hash
# 12 : : #include <script/interpreter.h>
# 13 : : #include <util/system.h>
# 14 : :
# 15 : : #include <assert.h>
# 16 : :
# 17 : : #include <boost/algorithm/string/classification.hpp>
# 18 : : #include <boost/algorithm/string/split.hpp>
# 19 : :
# 20 : : static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
# 21 : 9234 : {
# 22 : 9234 : CMutableTransaction txNew;
# 23 : 9234 : txNew.nVersion = 1;
# 24 : 9234 : txNew.vin.resize(1);
# 25 : 9234 : txNew.vout.resize(1);
# 26 : 9234 : txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
# 27 : 9234 : txNew.vout[0].nValue = genesisReward;
# 28 : 9234 : txNew.vout[0].scriptPubKey = genesisOutputScript;
# 29 : :
# 30 : 9234 : CBlock genesis;
# 31 : 9234 : genesis.nTime = nTime;
# 32 : 9234 : genesis.nBits = nBits;
# 33 : 9234 : genesis.nNonce = nNonce;
# 34 : 9234 : genesis.nVersion = nVersion;
# 35 : 9234 : genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
# 36 : 9234 : genesis.hashPrevBlock.SetNull();
# 37 : 9234 : genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
# 38 : 9234 : return genesis;
# 39 : 9234 : }
# 40 : :
# 41 : : /**
# 42 : : * Build the genesis block. Note that the output of its generation
# 43 : : * transaction cannot be spent since it did not originally exist in the
# 44 : : * database.
# 45 : : *
# 46 : : * CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
# 47 : : * CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
# 48 : : * CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
# 49 : : * CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
# 50 : : * vMerkleTree: 4a5e1e
# 51 : : */
# 52 : : static CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)
# 53 : 9234 : {
# 54 : 9234 : const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
# 55 : 9234 : const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
# 56 : 9234 : return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
# 57 : 9234 : }
# 58 : :
# 59 : : /**
# 60 : : * Main network on which people trade goods and services.
# 61 : : */
# 62 : : class CMainParams : public CChainParams {
# 63 : : public:
# 64 : 2644 : CMainParams() {
# 65 : 2644 : strNetworkID = CBaseChainParams::MAIN;
# 66 : 2644 : consensus.signet_blocks = false;
# 67 : 2644 : consensus.signet_challenge.clear();
# 68 : 2644 : consensus.nSubsidyHalvingInterval = 210000;
# 69 : 2644 : consensus.script_flag_exceptions.emplace( // BIP16 exception
# 70 : 2644 : uint256S("0x00000000000002dc756eebf4f49723ed8d30cc28a5f108eb94b1ba88ac4f9c22"), SCRIPT_VERIFY_NONE);
# 71 : 2644 : consensus.script_flag_exceptions.emplace( // Taproot exception
# 72 : 2644 : uint256S("0x0000000000000000000f14c35b2d841e986ab5441de8c585d5ffe55ea1e395ad"), SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS);
# 73 : 2644 : consensus.BIP34Height = 227931;
# 74 : 2644 : consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
# 75 : 2644 : consensus.BIP65Height = 388381; // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
# 76 : 2644 : consensus.BIP66Height = 363725; // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931
# 77 : 2644 : consensus.CSVHeight = 419328; // 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5
# 78 : 2644 : consensus.SegwitHeight = 481824; // 0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893
# 79 : 2644 : consensus.MinBIP9WarningHeight = 483840; // segwit activation height + miner confirmation window
# 80 : 2644 : consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
# 81 : 2644 : consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
# 82 : 2644 : consensus.nPowTargetSpacing = 10 * 60;
# 83 : 2644 : consensus.fPowAllowMinDifficultyBlocks = false;
# 84 : 2644 : consensus.fPowNoRetargeting = false;
# 85 : 2644 : consensus.nRuleChangeActivationThreshold = 1815; // 90% of 2016
# 86 : 2644 : consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
# 87 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
# 88 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
# 89 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 90 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
# 91 : :
# 92 : : // Deployment of Taproot (BIPs 340-342)
# 93 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2;
# 94 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1619222400; // April 24th, 2021
# 95 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021
# 96 : 2644 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 709632; // Approximately November 12th, 2021
# 97 : :
# 98 : 2644 : consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000002927cdceccbd5209e81e80db");
# 99 : 2644 : consensus.defaultAssumeValid = uint256S("0x000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091"); // 724466
# 100 : :
# 101 : : /**
# 102 : : * The message start string is designed to be unlikely to occur in normal data.
# 103 : : * The characters are rarely used upper ASCII, not valid as UTF-8, and produce
# 104 : : * a large 32-bit integer with any alignment.
# 105 : : */
# 106 : 2644 : pchMessageStart[0] = 0xf9;
# 107 : 2644 : pchMessageStart[1] = 0xbe;
# 108 : 2644 : pchMessageStart[2] = 0xb4;
# 109 : 2644 : pchMessageStart[3] = 0xd9;
# 110 : 2644 : nDefaultPort = 8333;
# 111 : 2644 : nPruneAfterHeight = 100000;
# 112 : 2644 : m_assumed_blockchain_size = 460;
# 113 : 2644 : m_assumed_chain_state_size = 6;
# 114 : :
# 115 : 2644 : genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
# 116 : 2644 : consensus.hashGenesisBlock = genesis.GetHash();
# 117 : 2644 : assert(consensus.hashGenesisBlock == uint256S("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"));
# 118 : 0 : assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
# 119 : :
# 120 : : // Note that of those which support the service bits prefix, most only support a subset of
# 121 : : // possible options.
# 122 : : // This is fine at runtime as we'll fall back to using them as an addrfetch if they don't support the
# 123 : : // service bits we want, but we should get them updated to support all service bits wanted by any
# 124 : : // release ASAP to avoid it where possible.
# 125 : 0 : vSeeds.emplace_back("seed.bitcoin.sipa.be."); // Pieter Wuille, only supports x1, x5, x9, and xd
# 126 : 2644 : vSeeds.emplace_back("dnsseed.bluematt.me."); // Matt Corallo, only supports x9
# 127 : 2644 : vSeeds.emplace_back("dnsseed.bitcoin.dashjr.org."); // Luke Dashjr
# 128 : 2644 : vSeeds.emplace_back("seed.bitcoinstats.com."); // Christian Decker, supports x1 - xf
# 129 : 2644 : vSeeds.emplace_back("seed.bitcoin.jonasschnelli.ch."); // Jonas Schnelli, only supports x1, x5, x9, and xd
# 130 : 2644 : vSeeds.emplace_back("seed.btc.petertodd.org."); // Peter Todd, only supports x1, x5, x9, and xd
# 131 : 2644 : vSeeds.emplace_back("seed.bitcoin.sprovoost.nl."); // Sjors Provoost
# 132 : 2644 : vSeeds.emplace_back("dnsseed.emzy.de."); // Stephan Oeste
# 133 : 2644 : vSeeds.emplace_back("seed.bitcoin.wiz.biz."); // Jason Maurice
# 134 : :
# 135 : 2644 : base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,0);
# 136 : 2644 : base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,5);
# 137 : 2644 : base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,128);
# 138 : 2644 : base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
# 139 : 2644 : base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
# 140 : :
# 141 : 2644 : bech32_hrp = "bc";
# 142 : :
# 143 : 2644 : vFixedSeeds = std::vector<uint8_t>(std::begin(chainparams_seed_main), std::end(chainparams_seed_main));
# 144 : :
# 145 : 2644 : fDefaultConsistencyChecks = false;
# 146 : 2644 : fRequireStandard = true;
# 147 : 2644 : m_is_test_chain = false;
# 148 : 2644 : m_is_mockable_chain = false;
# 149 : :
# 150 : 2644 : checkpointData = {
# 151 : 2644 : {
# 152 : 2644 : { 11111, uint256S("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")},
# 153 : 2644 : { 33333, uint256S("0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")},
# 154 : 2644 : { 74000, uint256S("0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")},
# 155 : 2644 : {105000, uint256S("0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")},
# 156 : 2644 : {134444, uint256S("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")},
# 157 : 2644 : {168000, uint256S("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")},
# 158 : 2644 : {193000, uint256S("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")},
# 159 : 2644 : {210000, uint256S("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")},
# 160 : 2644 : {216116, uint256S("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")},
# 161 : 2644 : {225430, uint256S("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")},
# 162 : 2644 : {250000, uint256S("0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")},
# 163 : 2644 : {279000, uint256S("0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")},
# 164 : 2644 : {295000, uint256S("0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
# 165 : 2644 : }
# 166 : 2644 : };
# 167 : :
# 168 : 2644 : m_assumeutxo_data = MapAssumeutxo{
# 169 : : // TODO to be specified in a future patch.
# 170 : 2644 : };
# 171 : :
# 172 : 2644 : chainTxData = ChainTxData{
# 173 : : // Data from RPC: getchaintxstats 4096 000000000000000000052d314a259755ca65944e68df6b12a067ea8f1f5a7091
# 174 : 2644 : /* nTime */ 1645542140,
# 175 : 2644 : /* nTxCount */ 712531200,
# 176 : 2644 : /* dTxRate */ 2.891036496010309,
# 177 : 2644 : };
# 178 : 2644 : }
# 179 : : };
# 180 : :
# 181 : : /**
# 182 : : * Testnet (v3): public test network which is reset from time to time.
# 183 : : */
# 184 : : class CTestNetParams : public CChainParams {
# 185 : : public:
# 186 : 1880 : CTestNetParams() {
# 187 : 1880 : strNetworkID = CBaseChainParams::TESTNET;
# 188 : 1880 : consensus.signet_blocks = false;
# 189 : 1880 : consensus.signet_challenge.clear();
# 190 : 1880 : consensus.nSubsidyHalvingInterval = 210000;
# 191 : 1880 : consensus.script_flag_exceptions.emplace( // BIP16 exception
# 192 : 1880 : uint256S("0x00000000dd30457c001f4095d208cc1296b0eed002427aa599874af7a432b105"), SCRIPT_VERIFY_NONE);
# 193 : 1880 : consensus.BIP34Height = 21111;
# 194 : 1880 : consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
# 195 : 1880 : consensus.BIP65Height = 581885; // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
# 196 : 1880 : consensus.BIP66Height = 330776; // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
# 197 : 1880 : consensus.CSVHeight = 770112; // 00000000025e930139bac5c6c31a403776da130831ab85be56578f3fa75369bb
# 198 : 1880 : consensus.SegwitHeight = 834624; // 00000000002b980fcd729daaa248fd9316a5200e9b367f4ff2c42453e84201ca
# 199 : 1880 : consensus.MinBIP9WarningHeight = 836640; // segwit activation height + miner confirmation window
# 200 : 1880 : consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
# 201 : 1880 : consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
# 202 : 1880 : consensus.nPowTargetSpacing = 10 * 60;
# 203 : 1880 : consensus.fPowAllowMinDifficultyBlocks = true;
# 204 : 1880 : consensus.fPowNoRetargeting = false;
# 205 : 1880 : consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
# 206 : 1880 : consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
# 207 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
# 208 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
# 209 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 210 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
# 211 : :
# 212 : : // Deployment of Taproot (BIPs 340-342)
# 213 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2;
# 214 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1619222400; // April 24th, 2021
# 215 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021
# 216 : 1880 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay
# 217 : :
# 218 : 1880 : consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000064728c7be6fe4b2f961");
# 219 : 1880 : consensus.defaultAssumeValid = uint256S("0x00000000000163cfb1f97c4e4098a3692c8053ad9cab5ad9c86b338b5c00b8b7"); // 2143398
# 220 : :
# 221 : 1880 : pchMessageStart[0] = 0x0b;
# 222 : 1880 : pchMessageStart[1] = 0x11;
# 223 : 1880 : pchMessageStart[2] = 0x09;
# 224 : 1880 : pchMessageStart[3] = 0x07;
# 225 : 1880 : nDefaultPort = 18333;
# 226 : 1880 : nPruneAfterHeight = 1000;
# 227 : 1880 : m_assumed_blockchain_size = 40;
# 228 : 1880 : m_assumed_chain_state_size = 2;
# 229 : :
# 230 : 1880 : genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
# 231 : 1880 : consensus.hashGenesisBlock = genesis.GetHash();
# 232 : 1880 : assert(consensus.hashGenesisBlock == uint256S("0x000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"));
# 233 : 0 : assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
# 234 : :
# 235 : 0 : vFixedSeeds.clear();
# 236 : 1880 : vSeeds.clear();
# 237 : : // nodes with support for servicebits filtering should be at the top
# 238 : 1880 : vSeeds.emplace_back("testnet-seed.bitcoin.jonasschnelli.ch.");
# 239 : 1880 : vSeeds.emplace_back("seed.tbtc.petertodd.org.");
# 240 : 1880 : vSeeds.emplace_back("seed.testnet.bitcoin.sprovoost.nl.");
# 241 : 1880 : vSeeds.emplace_back("testnet-seed.bluematt.me."); // Just a static list of stable node(s), only supports x9
# 242 : :
# 243 : 1880 : base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
# 244 : 1880 : base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
# 245 : 1880 : base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
# 246 : 1880 : base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
# 247 : 1880 : base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
# 248 : :
# 249 : 1880 : bech32_hrp = "tb";
# 250 : :
# 251 : 1880 : vFixedSeeds = std::vector<uint8_t>(std::begin(chainparams_seed_test), std::end(chainparams_seed_test));
# 252 : :
# 253 : 1880 : fDefaultConsistencyChecks = false;
# 254 : 1880 : fRequireStandard = false;
# 255 : 1880 : m_is_test_chain = true;
# 256 : 1880 : m_is_mockable_chain = false;
# 257 : :
# 258 : 1880 : checkpointData = {
# 259 : 1880 : {
# 260 : 1880 : {546, uint256S("000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")},
# 261 : 1880 : }
# 262 : 1880 : };
# 263 : :
# 264 : 1880 : m_assumeutxo_data = MapAssumeutxo{
# 265 : : // TODO to be specified in a future patch.
# 266 : 1880 : };
# 267 : :
# 268 : 1880 : chainTxData = ChainTxData{
# 269 : : // Data from RPC: getchaintxstats 4096 00000000d18cfe81cbeea665076807789bd8f831d557632e635bc6e3c003069e
# 270 : 1880 : /* nTime */ 1645635119,
# 271 : 1880 : /* nTxCount */ 62226341,
# 272 : 1880 : /* dTxRate */ 0.07717997442177152,
# 273 : 1880 : };
# 274 : 1880 : }
# 275 : : };
# 276 : :
# 277 : : /**
# 278 : : * Signet: test network with an additional consensus parameter (see BIP325).
# 279 : : */
# 280 : : class SigNetParams : public CChainParams {
# 281 : : public:
# 282 : 1887 : explicit SigNetParams(const ArgsManager& args) {
# 283 : 1887 : std::vector<uint8_t> bin;
# 284 : 1887 : vSeeds.clear();
# 285 : :
# 286 [ + + ]: 1887 : if (!args.IsArgSet("-signetchallenge")) {
# 287 : 1879 : bin = ParseHex("512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae");
# 288 : 1879 : vSeeds.emplace_back("seed.signet.bitcoin.sprovoost.nl.");
# 289 : :
# 290 : : // Hardcoded nodes can be removed once there are more DNS seeds
# 291 : 1879 : vSeeds.emplace_back("178.128.221.177");
# 292 : 1879 : vSeeds.emplace_back("v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333");
# 293 : :
# 294 : 1879 : consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000de26b0e471");
# 295 : 1879 : consensus.defaultAssumeValid = uint256S("0x00000112852484b5fe3451572368f93cfd2723279af3464e478aee35115256ef"); // 78788
# 296 : 1879 : m_assumed_blockchain_size = 1;
# 297 : 1879 : m_assumed_chain_state_size = 0;
# 298 : 1879 : chainTxData = ChainTxData{
# 299 : : // Data from RPC: getchaintxstats 4096 0000003d9144c56ac110ae04a0c271a0acce2f14f426b39fdf0d938c96d2eb09
# 300 : 1879 : /* nTime */ 1645631279,
# 301 : 1879 : /* nTxCount */ 1257429,
# 302 : 1879 : /* dTxRate */ 0.1389638742514995,
# 303 : 1879 : };
# 304 : 1879 : } else {
# 305 : 8 : const auto signet_challenge = args.GetArgs("-signetchallenge");
# 306 [ - + ]: 8 : if (signet_challenge.size() != 1) {
# 307 : 0 : throw std::runtime_error(strprintf("%s: -signetchallenge cannot be multiple values.", __func__));
# 308 : 0 : }
# 309 : 8 : bin = ParseHex(signet_challenge[0]);
# 310 : :
# 311 : 8 : consensus.nMinimumChainWork = uint256{};
# 312 : 8 : consensus.defaultAssumeValid = uint256{};
# 313 : 8 : m_assumed_blockchain_size = 0;
# 314 : 8 : m_assumed_chain_state_size = 0;
# 315 : 8 : chainTxData = ChainTxData{
# 316 : 8 : 0,
# 317 : 8 : 0,
# 318 : 8 : 0,
# 319 : 8 : };
# 320 : 8 : LogPrintf("Signet with challenge %s\n", signet_challenge[0]);
# 321 : 8 : }
# 322 : :
# 323 [ - + ]: 1887 : if (args.IsArgSet("-signetseednode")) {
# 324 : 0 : vSeeds = args.GetArgs("-signetseednode");
# 325 : 0 : }
# 326 : :
# 327 : 1887 : strNetworkID = CBaseChainParams::SIGNET;
# 328 : 1887 : consensus.signet_blocks = true;
# 329 : 1887 : consensus.signet_challenge.assign(bin.begin(), bin.end());
# 330 : 1887 : consensus.nSubsidyHalvingInterval = 210000;
# 331 : 1887 : consensus.BIP34Height = 1;
# 332 : 1887 : consensus.BIP34Hash = uint256{};
# 333 : 1887 : consensus.BIP65Height = 1;
# 334 : 1887 : consensus.BIP66Height = 1;
# 335 : 1887 : consensus.CSVHeight = 1;
# 336 : 1887 : consensus.SegwitHeight = 1;
# 337 : 1887 : consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
# 338 : 1887 : consensus.nPowTargetSpacing = 10 * 60;
# 339 : 1887 : consensus.fPowAllowMinDifficultyBlocks = false;
# 340 : 1887 : consensus.fPowNoRetargeting = false;
# 341 : 1887 : consensus.nRuleChangeActivationThreshold = 1815; // 90% of 2016
# 342 : 1887 : consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
# 343 : 1887 : consensus.MinBIP9WarningHeight = 0;
# 344 : 1887 : consensus.powLimit = uint256S("00000377ae000000000000000000000000000000000000000000000000000000");
# 345 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
# 346 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = Consensus::BIP9Deployment::NEVER_ACTIVE;
# 347 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 348 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
# 349 : :
# 350 : : // Activation of Taproot (BIPs 340-342)
# 351 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2;
# 352 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
# 353 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 354 : 1887 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay
# 355 : :
# 356 : : // message start is defined as the first 4 bytes of the sha256d of the block script
# 357 : 1887 : CHashWriter h(SER_DISK, 0);
# 358 : 1887 : h << consensus.signet_challenge;
# 359 : 1887 : uint256 hash = h.GetHash();
# 360 : 1887 : memcpy(pchMessageStart, hash.begin(), 4);
# 361 : :
# 362 : 1887 : nDefaultPort = 38333;
# 363 : 1887 : nPruneAfterHeight = 1000;
# 364 : :
# 365 : 1887 : genesis = CreateGenesisBlock(1598918400, 52613770, 0x1e0377ae, 1, 50 * COIN);
# 366 : 1887 : consensus.hashGenesisBlock = genesis.GetHash();
# 367 : 1887 : assert(consensus.hashGenesisBlock == uint256S("0x00000008819873e925422c1ff0f99f7cc9bbb232af63a077a480a3633bee1ef6"));
# 368 : 0 : assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
# 369 : :
# 370 : 0 : vFixedSeeds.clear();
# 371 : :
# 372 : 1887 : base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
# 373 : 1887 : base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
# 374 : 1887 : base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
# 375 : 1887 : base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
# 376 : 1887 : base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
# 377 : :
# 378 : 1887 : bech32_hrp = "tb";
# 379 : :
# 380 : 1887 : fDefaultConsistencyChecks = false;
# 381 : 1887 : fRequireStandard = true;
# 382 : 1887 : m_is_test_chain = true;
# 383 : 1887 : m_is_mockable_chain = false;
# 384 : 1887 : }
# 385 : : };
# 386 : :
# 387 : : /**
# 388 : : * Regression test: intended for private networks only. Has minimal difficulty to ensure that
# 389 : : * blocks can be found instantly.
# 390 : : */
# 391 : : class CRegTestParams : public CChainParams {
# 392 : : public:
# 393 : 2826 : explicit CRegTestParams(const ArgsManager& args) {
# 394 : 2826 : strNetworkID = CBaseChainParams::REGTEST;
# 395 : 2826 : consensus.signet_blocks = false;
# 396 : 2826 : consensus.signet_challenge.clear();
# 397 : 2826 : consensus.nSubsidyHalvingInterval = 150;
# 398 : 2826 : consensus.BIP34Height = 1; // Always active unless overridden
# 399 : 2826 : consensus.BIP34Hash = uint256();
# 400 : 2826 : consensus.BIP65Height = 1; // Always active unless overridden
# 401 : 2826 : consensus.BIP66Height = 1; // Always active unless overridden
# 402 : 2826 : consensus.CSVHeight = 1; // Always active unless overridden
# 403 : 2826 : consensus.SegwitHeight = 0; // Always active unless overridden
# 404 : 2826 : consensus.MinBIP9WarningHeight = 0;
# 405 : 2826 : consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
# 406 : 2826 : consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks
# 407 : 2826 : consensus.nPowTargetSpacing = 10 * 60;
# 408 : 2826 : consensus.fPowAllowMinDifficultyBlocks = true;
# 409 : 2826 : consensus.fPowNoRetargeting = true;
# 410 : 2826 : consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
# 411 : 2826 : consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
# 412 : :
# 413 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
# 414 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
# 415 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 416 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay
# 417 : :
# 418 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2;
# 419 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;
# 420 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
# 421 : 2826 : consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay
# 422 : :
# 423 : 2826 : consensus.nMinimumChainWork = uint256{};
# 424 : 2826 : consensus.defaultAssumeValid = uint256{};
# 425 : :
# 426 : 2826 : pchMessageStart[0] = 0xfa;
# 427 : 2826 : pchMessageStart[1] = 0xbf;
# 428 : 2826 : pchMessageStart[2] = 0xb5;
# 429 : 2826 : pchMessageStart[3] = 0xda;
# 430 : 2826 : nDefaultPort = 18444;
# 431 [ + + ]: 2826 : nPruneAfterHeight = args.GetBoolArg("-fastprune", false) ? 100 : 1000;
# 432 : 2826 : m_assumed_blockchain_size = 0;
# 433 : 2826 : m_assumed_chain_state_size = 0;
# 434 : :
# 435 : 2826 : UpdateActivationParametersFromArgs(args);
# 436 : :
# 437 : 2826 : genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
# 438 : 2826 : consensus.hashGenesisBlock = genesis.GetHash();
# 439 : 2826 : assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"));
# 440 : 0 : assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));
# 441 : :
# 442 : 0 : vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
# 443 : 2826 : vSeeds.clear();
# 444 : 2826 : vSeeds.emplace_back("dummySeed.invalid.");
# 445 : :
# 446 : 2826 : fDefaultConsistencyChecks = true;
# 447 : 2826 : fRequireStandard = true;
# 448 : 2826 : m_is_test_chain = true;
# 449 : 2826 : m_is_mockable_chain = true;
# 450 : :
# 451 : 2826 : checkpointData = {
# 452 : 2826 : {
# 453 : 2826 : {0, uint256S("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")},
# 454 : 2826 : }
# 455 : 2826 : };
# 456 : :
# 457 : 2826 : m_assumeutxo_data = MapAssumeutxo{
# 458 : 2826 : {
# 459 : 2826 : 110,
# 460 : 2826 : {AssumeutxoHash{uint256S("0x1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618")}, 110},
# 461 : 2826 : },
# 462 : 2826 : {
# 463 : 2826 : 200,
# 464 : 2826 : {AssumeutxoHash{uint256S("0x51c8d11d8b5c1de51543c579736e786aa2736206d1e11e627568029ce092cf62")}, 200},
# 465 : 2826 : },
# 466 : 2826 : };
# 467 : :
# 468 : 2826 : chainTxData = ChainTxData{
# 469 : 2826 : 0,
# 470 : 2826 : 0,
# 471 : 2826 : 0
# 472 : 2826 : };
# 473 : :
# 474 : 2826 : base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111);
# 475 : 2826 : base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196);
# 476 : 2826 : base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239);
# 477 : 2826 : base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
# 478 : 2826 : base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
# 479 : :
# 480 : 2826 : bech32_hrp = "bcrt";
# 481 : 2826 : }
# 482 : :
# 483 : : /**
# 484 : : * Allows modifying the Version Bits regtest parameters.
# 485 : : */
# 486 : : void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int min_activation_height)
# 487 : 4 : {
# 488 : 4 : consensus.vDeployments[d].nStartTime = nStartTime;
# 489 : 4 : consensus.vDeployments[d].nTimeout = nTimeout;
# 490 : 4 : consensus.vDeployments[d].min_activation_height = min_activation_height;
# 491 : 4 : }
# 492 : : void UpdateActivationParametersFromArgs(const ArgsManager& args);
# 493 : : };
# 494 : :
# 495 : : static void MaybeUpdateHeights(const ArgsManager& args, Consensus::Params& consensus)
# 496 : 2826 : {
# 497 [ + + ]: 2826 : for (const std::string& arg : args.GetArgs("-testactivationheight")) {
# 498 : 37 : const auto found{arg.find('@')};
# 499 [ + + ]: 37 : if (found == std::string::npos) {
# 500 : 1 : throw std::runtime_error(strprintf("Invalid format (%s) for -testactivationheight=name@height.", arg));
# 501 : 1 : }
# 502 : 36 : const auto name{arg.substr(0, found)};
# 503 : 36 : const auto value{arg.substr(found + 1)};
# 504 : 36 : int32_t height;
# 505 [ - + ][ + + ]: 36 : if (!ParseInt32(value, &height) || height < 0 || height >= std::numeric_limits<int>::max()) {
# [ - + ]
# 506 : 1 : throw std::runtime_error(strprintf("Invalid height value (%s) for -testactivationheight=name@height.", arg));
# 507 : 1 : }
# 508 [ + + ]: 35 : if (name == "segwit") {
# 509 : 16 : consensus.SegwitHeight = int{height};
# 510 [ + + ]: 19 : } else if (name == "bip34") {
# 511 : 2 : consensus.BIP34Height = int{height};
# 512 [ + + ]: 17 : } else if (name == "dersig") {
# 513 : 10 : consensus.BIP66Height = int{height};
# 514 [ + + ]: 10 : } else if (name == "cltv") {
# 515 : 2 : consensus.BIP65Height = int{height};
# 516 [ + + ]: 5 : } else if (name == "csv") {
# 517 : 4 : consensus.CSVHeight = int{height};
# 518 : 4 : } else {
# 519 : 1 : throw std::runtime_error(strprintf("Invalid name (%s) for -testactivationheight=name@height.", arg));
# 520 : 1 : }
# 521 : 35 : }
# 522 : 2826 : }
# 523 : :
# 524 : : void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
# 525 : 2826 : {
# 526 : 2826 : MaybeUpdateHeights(args, consensus);
# 527 : :
# 528 [ + + ]: 2826 : if (!args.IsArgSet("-vbparams")) return;
# 529 : :
# 530 [ + + ]: 7 : for (const std::string& strDeployment : args.GetArgs("-vbparams")) {
# 531 : 4 : std::vector<std::string> vDeploymentParams;
# 532 : 4 : boost::split(vDeploymentParams, strDeployment, boost::is_any_of(":"));
# 533 [ - + ][ - + ]: 4 : if (vDeploymentParams.size() < 3 || 4 < vDeploymentParams.size()) {
# 534 : 0 : throw std::runtime_error("Version bits parameters malformed, expecting deployment:start:end[:min_activation_height]");
# 535 : 0 : }
# 536 : 4 : int64_t nStartTime, nTimeout;
# 537 : 4 : int min_activation_height = 0;
# 538 [ - + ]: 4 : if (!ParseInt64(vDeploymentParams[1], &nStartTime)) {
# 539 : 0 : throw std::runtime_error(strprintf("Invalid nStartTime (%s)", vDeploymentParams[1]));
# 540 : 0 : }
# 541 [ - + ]: 4 : if (!ParseInt64(vDeploymentParams[2], &nTimeout)) {
# 542 : 0 : throw std::runtime_error(strprintf("Invalid nTimeout (%s)", vDeploymentParams[2]));
# 543 : 0 : }
# 544 [ + + ][ - + ]: 4 : if (vDeploymentParams.size() >= 4 && !ParseInt32(vDeploymentParams[3], &min_activation_height)) {
# 545 : 0 : throw std::runtime_error(strprintf("Invalid min_activation_height (%s)", vDeploymentParams[3]));
# 546 : 0 : }
# 547 : 4 : bool found = false;
# 548 [ + - ]: 6 : for (int j=0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {
# 549 [ + + ]: 6 : if (vDeploymentParams[0] == VersionBitsDeploymentInfo[j].name) {
# 550 : 4 : UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout, min_activation_height);
# 551 : 4 : found = true;
# 552 : 4 : LogPrintf("Setting version bits activation parameters for %s to start=%ld, timeout=%ld, min_activation_height=%d\n", vDeploymentParams[0], nStartTime, nTimeout, min_activation_height);
# 553 : 4 : break;
# 554 : 4 : }
# 555 : 6 : }
# 556 [ - + ]: 4 : if (!found) {
# 557 : 0 : throw std::runtime_error(strprintf("Invalid deployment (%s)", vDeploymentParams[0]));
# 558 : 0 : }
# 559 : 4 : }
# 560 : 7 : }
# 561 : :
# 562 : : static std::unique_ptr<const CChainParams> globalChainParams;
# 563 : :
# 564 : 769085 : const CChainParams &Params() {
# 565 : 769085 : assert(globalChainParams);
# 566 : 0 : return *globalChainParams;
# 567 : 769085 : }
# 568 : :
# 569 : : std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const std::string& chain)
# 570 : 9237 : {
# 571 [ + + ]: 9237 : if (chain == CBaseChainParams::MAIN) {
# 572 : 2644 : return std::unique_ptr<CChainParams>(new CMainParams());
# 573 [ + + ]: 6593 : } else if (chain == CBaseChainParams::TESTNET) {
# 574 : 1880 : return std::unique_ptr<CChainParams>(new CTestNetParams());
# 575 [ + + ]: 4713 : } else if (chain == CBaseChainParams::SIGNET) {
# 576 : 1887 : return std::unique_ptr<CChainParams>(new SigNetParams(args));
# 577 [ + - ]: 2826 : } else if (chain == CBaseChainParams::REGTEST) {
# 578 : 2826 : return std::unique_ptr<CChainParams>(new CRegTestParams(args));
# 579 : 2826 : }
# 580 : 0 : throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
# 581 : 9237 : }
# 582 : :
# 583 : : void SelectParams(const std::string& network)
# 584 : 2549 : {
# 585 : 2549 : SelectBaseParams(network);
# 586 : 2549 : globalChainParams = CreateChainParams(gArgs, network);
# 587 : 2549 : }
|