27 #include <type_traits> 35 txNew.
vin[0].scriptSig =
CScript() << 486604799 <<
CScriptNum(4) << std::vector<unsigned char>((
const unsigned char*)pszTimestamp, (
const unsigned char*)pszTimestamp + strlen(pszTimestamp));
36 txNew.
vout[0].nValue = genesisReward;
37 txNew.
vout[0].scriptPubKey = genesisOutputScript;
40 genesis.
nTime = nTime;
41 genesis.
nBits = nBits;
63 const char* pszTimestamp =
"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
64 const CScript genesisOutputScript =
CScript() <<
ParseHex(
"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") <<
OP_CHECKSIG;
65 return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);
134 vSeeds.emplace_back(
"seed.bitcoin.sipa.be.");
135 vSeeds.emplace_back(
"dnsseed.bluematt.me.");
136 vSeeds.emplace_back(
"dnsseed.bitcoin.dashjr.org.");
137 vSeeds.emplace_back(
"seed.bitcoinstats.com.");
138 vSeeds.emplace_back(
"seed.bitcoin.jonasschnelli.ch.");
139 vSeeds.emplace_back(
"seed.btc.petertodd.org.");
140 vSeeds.emplace_back(
"seed.bitcoin.sprovoost.nl.");
141 vSeeds.emplace_back(
"dnsseed.emzy.de.");
142 vSeeds.emplace_back(
"seed.bitcoin.wiz.biz.");
159 { 11111,
uint256S(
"0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d")},
160 { 33333,
uint256S(
"0x000000002dd5588a74784eaa7ab0507a18ad16a236e7b1ce69f00d7ddfb5d0a6")},
161 { 74000,
uint256S(
"0x0000000000573993a3c9e41ce34471c079dcf5f52a0e824a81e7f953b8661a20")},
162 {105000,
uint256S(
"0x00000000000291ce28027faea320c8d2b054b2e0fe44a773f3eefb151d6bdc97")},
163 {134444,
uint256S(
"0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe")},
164 {168000,
uint256S(
"0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763")},
165 {193000,
uint256S(
"0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")},
166 {210000,
uint256S(
"0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")},
167 {216116,
uint256S(
"0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")},
168 {225430,
uint256S(
"0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")},
169 {250000,
uint256S(
"0x000000000000003887df1f29024b06fc2200b55f8af8f35453d7be294df2d214")},
170 {279000,
uint256S(
"0x0000000000000001ae8c72a0b0c301f67e3afca10e819efa9041e458e9bd7e40")},
171 {295000,
uint256S(
"0x00000000000000004d9b4ef50f0f9d686fd69db2e03af35a100370c64632a983")},
182 .nTxCount = 881818374,
183 .dTxRate = 5.521964628130412,
245 vSeeds.emplace_back(
"testnet-seed.bitcoin.jonasschnelli.ch.");
246 vSeeds.emplace_back(
"seed.tbtc.petertodd.org.");
247 vSeeds.emplace_back(
"seed.testnet.bitcoin.sprovoost.nl.");
248 vSeeds.emplace_back(
"testnet-seed.bluematt.me.");
265 {546,
uint256S(
"000000002a936ca763904c3c35fce2f3556c559c0214345d31b1bcebf76acb70")},
272 .hash_serialized =
AssumeutxoHash{
uint256S(
"0xf841584909f68e47897952345234e37fcd9128cd818f41ee6c3ca68db8071be7")},
273 .nChainTx = 66484552,
274 .blockhash =
uint256S(
"0x0000000000000093bcb68c03a9a168ae252572d348a2eaeba2cdf9231d73206f")
281 .nTxCount = 66484552,
282 .dTxRate = 0.1804908356632494,
294 std::vector<uint8_t> bin;
298 bin =
ParseHex(
"512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae");
299 vSeeds.emplace_back(
"seed.signet.bitcoin.sprovoost.nl.");
302 vSeeds.emplace_back(
"178.128.221.177");
303 vSeeds.emplace_back(
"v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333");
313 .dTxRate = 0.003414084572046456,
381 .hash_serialized = AssumeutxoHash{uint256S("0xfe0a44309b74d6b5883d246cb419c6221bcccf0b308c9b59b7d70783dbdf928a")}, 383 .blockhash = uint256S("0x0000003ca3c99aff040f2563c2ad8f8ec88bd0fd6b8f0895cfaf1ef90353a62c") 387 base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,111); 388 base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,196); 389 base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1,239); 390 base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; 391 base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; 395 fDefaultConsistencyChecks = false; 396 m_is_mockable_chain = false; 404 class CRegTestParams : public CChainParams 407 explicit CRegTestParams(const RegTestOptions& opts) 409 m_chain_type = ChainType::REGTEST; 410 consensus.signet_blocks = false; 411 consensus.signet_challenge.clear(); 412 consensus.nSubsidyHalvingInterval = 150; 413 consensus.BIP34Height = 1; // Always active unless overridden 414 consensus.BIP34Hash = uint256(); 415 consensus.BIP65Height = 1; // Always active unless overridden 416 consensus.BIP66Height = 1; // Always active unless overridden 417 consensus.CSVHeight = 1; // Always active unless overridden 418 consensus.SegwitHeight = 0; // Always active unless overridden 419 consensus.MinBIP9WarningHeight = 0; 420 consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); 421 consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks 422 consensus.nPowTargetSpacing = 10 * 60; 423 consensus.fPowAllowMinDifficultyBlocks = true; 424 consensus.fPowNoRetargeting = true; 425 consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains 426 consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016) 428 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; 429 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0; 430 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; 431 consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].min_activation_height = 0; // No activation delay 433 consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].bit = 2; 434 consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE; 435 consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT; 436 consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay 438 consensus.nMinimumChainWork = uint256{}; 439 consensus.defaultAssumeValid = uint256{}; 441 pchMessageStart[0] = 0xfa; 442 pchMessageStart[1] = 0xbf; 443 pchMessageStart[2] = 0xb5; 444 pchMessageStart[3] = 0xda; 445 nDefaultPort = 18444; 446 nPruneAfterHeight = opts.fastprune ? 100 : 1000; 447 m_assumed_blockchain_size = 0; 448 m_assumed_chain_state_size = 0; 450 for (const auto& [dep, height] : opts.activation_heights) { 452 case Consensus::BuriedDeployment::DEPLOYMENT_SEGWIT: 453 consensus.SegwitHeight = int{height}; 455 case Consensus::BuriedDeployment::DEPLOYMENT_HEIGHTINCB: 456 consensus.BIP34Height = int{height}; 458 case Consensus::BuriedDeployment::DEPLOYMENT_DERSIG: 459 consensus.BIP66Height = int{height}; 461 case Consensus::BuriedDeployment::DEPLOYMENT_CLTV: 462 consensus.BIP65Height = int{height}; 464 case Consensus::BuriedDeployment::DEPLOYMENT_CSV: 465 consensus.CSVHeight = int{height}; 470 for (const auto& [deployment_pos, version_bits_params] : opts.version_bits_parameters) { 471 consensus.vDeployments[deployment_pos].nStartTime = version_bits_params.start_time; 472 consensus.vDeployments[deployment_pos].nTimeout = version_bits_params.timeout; 473 consensus.vDeployments[deployment_pos].min_activation_height = version_bits_params.min_activation_height; 476 genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN); 477 consensus.hashGenesisBlock = genesis.GetHash(); 478 assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")); 479 assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); 481 vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.
483 vSeeds.emplace_back(
"dummySeed.invalid.");
490 {0,
uint256S(
"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206")},
497 .hash_serialized =
AssumeutxoHash{
uint256S(
"0x6657b736d4fe4db0cbc796789e812d5dba7f5c143764b1b6905612f1830609d1")},
499 .blockhash =
uint256S(
"0x696e92821f65549c7ee134edceeeeaaa4105647a3c4fd9f298c0aec0ab50425c")
504 .hash_serialized =
AssumeutxoHash{
uint256S(
"0x61d9c2b29a2571a5fe285fe2d8554f91f93309666fc9b8223ee96338de25ff53")},
506 .blockhash =
uint256S(
"0x7e0517ef3ea6ecbed9117858e42eedc8eb39e8698a38dcbd1b3962a283233f4c")
528 return std::make_unique<const SigNetParams>(options);
533 return std::make_unique<const CRegTestParams>(options);
538 return std::make_unique<const CMainParams>();
543 return std::make_unique<const CTestNetParams>();
static constexpr int64_t NO_TIMEOUT
Constant for nTimeout very far in the future.
int min_activation_height
If lock in occurs, delay activation until at least this block height.
std::vector< Byte > ParseHex(std::string_view hex_str)
Like TryParseHex, but returns an empty vector on invalid input.
Main network on which people trade goods and services.
int64_t nPowTargetTimespan
std::vector< uint8_t > vFixedSeeds
std::vector< unsigned char > base58Prefixes[MAX_BASE58_TYPES]
bool fPowAllowMinDifficultyBlocks
static constexpr int64_t ALWAYS_ACTIVE
Special value for nStartTime indicating that the deployment is always active.
int BIP66Height
Block height at which BIP66 becomes active.
uint64_t m_assumed_chain_state_size
static const uint8_t chainparams_seed_test[]
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
int64_t nTime
UNIX timestamp of last known number of transactions.
int CSVHeight
Block height at which CSV (BIP68, BIP112 and BIP113) becomes active.
static std::unique_ptr< const CChainParams > Main()
static std::unique_ptr< const CChainParams > RegTest(const RegTestOptions &options)
std::map< uint256, uint32_t > script_flag_exceptions
Hashes of blocks that.
constexpr unsigned char * begin()
uint64_t m_assumed_blockchain_size
int nSubsidyHalvingInterval
int64_t CAmount
Amount in satoshis (Can be negative)
Signet: test network with an additional consensus parameter (see BIP325).
uint256 powLimit
Proof of work parameters.
static const uint8_t chainparams_seed_main[]
List of fixed seed nodes for the bitcoin network AUTOGENERATED by contrib/seeds/generate-seeds.py.
SigNetParams(const SigNetOptions &options)
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.
int BIP34Height
Block height and hash at which BIP34 becomes active.
A writer stream (for serialization) that computes a 256-bit hash.
uint256 uint256S(const char *str)
int64_t nStartTime
Start MedianTime for version bits miner confirmation.
int64_t nPowTargetSpacing
Holds various statistics on transactions within a chain.
std::vector< std::string > vSeeds
RegTestOptions holds configurations for creating a regtest CChainParams.
bool signet_blocks
If true, witness commitments contain a payload equal to a Bitcoin Script solution to the signet chall...
std::optional< std::vector< std::string > > seeds
static constexpr int64_t NEVER_ACTIVE
Special value for nStartTime indicating that the deployment is never active.
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
uint32_t nMinerConfirmationWindow
std::vector< CTxOut > vout
SigNetOptions holds configurations for creating a signet CChainParams.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
int BIP65Height
Block height at which BIP65 becomes active.
Testnet (v3): public test network which is reset from time to time.
int64_t nTimeout
Timeout/expiry MedianTime for the deployment attempt.
uint256 nMinimumChainWork
The best chain should have at least this much work.
std::vector< CTransactionRef > vtx
uint256 defaultAssumeValid
By default assume that the signatures in ancestors of this block are valid.
static std::unique_ptr< const CChainParams > SigNet(const SigNetOptions &options)
static std::unique_ptr< const CChainParams > TestNet()
Serialized script, used inside transaction inputs and outputs.
Consensus::Params consensus
std::vector< uint8_t > signet_challenge
int MinBIP9WarningHeight
Don't warn about unknown BIP 9 activations below this height.
static CBlock CreateGenesisBlock(const char *pszTimestamp, const CScript &genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount &genesisReward)
A mutable version of CTransaction.
uint32_t nRuleChangeActivationThreshold
Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period...
uint64_t nPruneAfterHeight
MessageStartChars pchMessageStart
int SegwitHeight
Block height at which Segwit (BIP141, BIP143 and BIP147) becomes active.
int bit
Bit position to select the particular bit in nVersion.
std::optional< std::vector< uint8_t > > challenge
CCheckpointData checkpointData
bool fDefaultConsistencyChecks
std::vector< AssumeutxoData > m_assumeutxo_data
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
static constexpr CAmount COIN
The amount of satoshis in one BTC.