Bitcoin ABC  0.24.10
P2P Digital Currency
chainparams.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2016 The Bitcoin Core developers
3 // Copyright (c) 2017-2020 The Bitcoin developers
4 // Distributed under the MIT software license, see the accompanying
5 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 
7 #include <chainparams.h>
8 
9 #include <chainparamsconstants.h>
10 #include <chainparamsseeds.h>
11 #include <consensus/merkle.h>
12 #include <currencyunit.h>
13 #include <network.h>
14 #include <tinyformat.h>
15 #include <util/strencodings.h>
16 #include <util/system.h>
17 
18 #include <cassert>
19 
20 static CBlock CreateGenesisBlock(const char *pszTimestamp,
21  const CScript &genesisOutputScript,
22  uint32_t nTime, uint32_t nNonce,
23  uint32_t nBits, int32_t nVersion,
24  const Amount genesisReward) {
25  CMutableTransaction txNew;
26  txNew.nVersion = 1;
27  txNew.vin.resize(1);
28  txNew.vout.resize(1);
29  txNew.vin[0].scriptSig =
30  CScript() << 486604799 << CScriptNum(4)
31  << std::vector<uint8_t>((const uint8_t *)pszTimestamp,
32  (const uint8_t *)pszTimestamp +
33  strlen(pszTimestamp));
34  txNew.vout[0].nValue = genesisReward;
35  txNew.vout[0].scriptPubKey = genesisOutputScript;
36 
37  CBlock genesis;
38  genesis.nTime = nTime;
39  genesis.nBits = nBits;
40  genesis.nNonce = nNonce;
41  genesis.nVersion = nVersion;
42  genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
43  genesis.hashPrevBlock.SetNull();
44  genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
45  return genesis;
46 }
47 
61 CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits,
62  int32_t nVersion, const Amount genesisReward) {
63  const char *pszTimestamp =
64  "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
65  const CScript genesisOutputScript =
66  CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909"
67  "a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112"
68  "de5c384df7ba0b8d578a4c702b6bf11d5f")
69  << OP_CHECKSIG;
70  return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce,
71  nBits, nVersion, genesisReward);
72 }
73 
77 class CMainParams : public CChainParams {
78 public:
82  // 00000000000000ce80a7e057163a4db1d5ad7b20fb6f598c9597b9665c8fb0d4 -
83  // April 1, 2012
84  consensus.BIP16Height = 173805;
85  consensus.BIP34Height = 227931;
87  "000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8");
88  // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0
89  consensus.BIP65Height = 388381;
90  // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931
91  consensus.BIP66Height = 363725;
92  // 000000000000000004a1b34462cb8aeebd5799177f7a29cf28f2d1961716b5b5
93  consensus.CSVHeight = 419328;
95  "00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
96  // two weeks
97  consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
98  consensus.nPowTargetSpacing = 10 * 60;
101 
102  // two days
103  consensus.nDAAHalfLife = 2 * 24 * 60 * 60;
104 
105  // nPowTargetTimespan / nPowTargetSpacing
108  .bit = 28,
109  // 95% of 2016
110  .nActivationThreshold = 1916,
111  // January 1, 2008
112  .nStartTime = 1199145601,
113  // December 31, 2008
114  .nTimeout = 1230767999,
115  };
116 
117  // The miner fund is enabled by default on mainnet.
119 
120  // The best chain should have at least this much work.
123 
124  // By default assume that the signatures in ancestors of this block are
125  // valid.
128 
129  // August 1, 2017 hard fork
130  consensus.uahfHeight = 478558;
131 
132  // November 13, 2017 hard fork
133  consensus.daaHeight = 504031;
134 
135  // November 15, 2018 hard fork
137 
138  // November 15, 2019 protocol upgrade
139  consensus.gravitonHeight = 609135;
140 
141  // May 15, 2020 12:00:00 UTC protocol upgrade
142  consensus.phononHeight = 635258;
143 
144  // Nov 15, 2020 12:00:00 UTC protocol upgrade
145  consensus.axionActivationTime = 1605441600;
146 
147  // May 15, 2021 12:00:00 UTC protocol upgrade
148  consensus.tachyonActivationTime = 1621080000;
149 
150  // Nov 15, 2021 12:00:00 UTC protocol upgrade
151  consensus.selectronActivationTime = 1636977600;
152 
153  // May 15, 2022 12:00:00 UTC protocol upgrade
154  consensus.gluonActivationTime = 1652616000;
155 
161  diskMagic[0] = 0xf9;
162  diskMagic[1] = 0xbe;
163  diskMagic[2] = 0xb4;
164  diskMagic[3] = 0xd9;
165  netMagic[0] = 0xe3;
166  netMagic[1] = 0xe1;
167  netMagic[2] = 0xf3;
168  netMagic[3] = 0xe8;
169  nDefaultPort = 8333;
170  nPruneAfterHeight = 100000;
175 
176  genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1,
177  50 * COIN);
179  assert(consensus.hashGenesisBlock ==
180  uint256S("000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1"
181  "b60a8ce26f"));
182  assert(genesis.hashMerkleRoot ==
183  uint256S("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b"
184  "7afdeda33b"));
185 
186  // Note that of those which support the service bits prefix, most only
187  // support a subset of possible options. This is fine at runtime as
188  // we'll fall back to using them as an addrfetch if they don't support
189  // the service bits we want, but we should get them updated to support
190  // all service bits wanted by any release ASAP to avoid it where
191  // possible.
192  // Bitcoin ABC seeder
193  vSeeds.emplace_back("seed.bitcoinabc.org");
194  // BU backed seeder
195  vSeeds.emplace_back("btccash-seeder.bitcoinunlimited.info");
196  // Jason B. Cox
197  vSeeds.emplace_back("seeder.jasonbcox.com");
198  // Amaury SÉCHET
199  vSeeds.emplace_back("seed.deadalnix.me");
200  // BCHD
201  vSeeds.emplace_back("seed.bchd.cash");
202  // Fabien
203  vSeeds.emplace_back("seeder.fabien.cash");
204  // status.cash
205  vSeeds.emplace_back("seeder.status.cash");
206 
207  base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 0);
208  base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 5);
209  base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 128);
210  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};
211  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};
213  gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ecash" : "bitcoincash";
214 
215  vFixedSeeds = std::vector<SeedSpec6>(
217 
219  fRequireStandard = true;
220  m_is_test_chain = false;
221  m_is_mockable_chain = false;
222 
224 
225  // Data as of block
226  // 000000000000000001d2ce557406b017a928be25ee98906397d339c3f68eec5d
227  // (height 523992).
229  // UNIX timestamp of last known number of transactions.
230  1522608016,
231  // Total number of transactions between genesis and that timestamp
232  // (the tx=... number in the ChainStateFlushed debug.log lines)
233  248589038,
234  // Estimated number of transactions per second after that timestamp.
235  3.2,
236  };
237  }
238 };
239 
243 class CTestNetParams : public CChainParams {
244 public:
248  // 00000000040b4e986385315e14bee30ad876d8b47f748025b26683116d21aa65
249  consensus.BIP16Height = 514;
250  consensus.BIP34Height = 21111;
252  "0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8");
253  // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6
254  consensus.BIP65Height = 581885;
255  // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182
256  consensus.BIP66Height = 330776;
257  // 00000000025e930139bac5c6c31a403776da130831ab85be56578f3fa75369bb
258  consensus.CSVHeight = 770112;
260  "00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
261  // two weeks
262  consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
263  consensus.nPowTargetSpacing = 10 * 60;
266 
267  // two days
268  consensus.nDAAHalfLife = 2 * 24 * 60 * 60;
269 
270  // nPowTargetTimespan / nPowTargetSpacing
273  .bit = 28,
274  // 75% of 2016
275  .nActivationThreshold = 1512,
276  // January 1, 2008
277  .nStartTime = 1199145601,
278  // December 31, 2008
279  .nTimeout = 1230767999,
280  };
281 
282  // The miner fund is disabled by default on testnet.
283  consensus.enableMinerFund = false;
284 
285  // The best chain should have at least this much work.
288 
289  // By default assume that the signatures in ancestors of this block are
290  // valid.
293 
294  // August 1, 2017 hard fork
295  consensus.uahfHeight = 1155875;
296 
297  // November 13, 2017 hard fork
298  consensus.daaHeight = 1188697;
299 
300  // November 15, 2018 hard fork
302 
303  // November 15, 2019 protocol upgrade
304  consensus.gravitonHeight = 1341711;
305 
306  // May 15, 2020 12:00:00 UTC protocol upgrade
307  consensus.phononHeight = 1378460;
308 
309  // Nov 15, 2020 12:00:00 UTC protocol upgrade
310  consensus.axionActivationTime = 1605441600;
311 
312  // May 15, 2021 12:00:00 UTC protocol upgrade
313  consensus.tachyonActivationTime = 1621080000;
314 
315  // Nov 15, 2021 12:00:00 UTC protocol upgrade
316  consensus.selectronActivationTime = 1636977600;
317 
318  // May 15, 2022 12:00:00 UTC protocol upgrade
319  consensus.gluonActivationTime = 1652616000;
320 
321  diskMagic[0] = 0x0b;
322  diskMagic[1] = 0x11;
323  diskMagic[2] = 0x09;
324  diskMagic[3] = 0x07;
325  netMagic[0] = 0xf4;
326  netMagic[1] = 0xe5;
327  netMagic[2] = 0xf3;
328  netMagic[3] = 0xf4;
329  nDefaultPort = 18333;
330  nPruneAfterHeight = 1000;
335 
336  genesis =
337  CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
339  assert(consensus.hashGenesisBlock ==
340  uint256S("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526"
341  "f8d77f4943"));
342  assert(genesis.hashMerkleRoot ==
343  uint256S("4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b"
344  "7afdeda33b"));
345 
346  vFixedSeeds.clear();
347  vSeeds.clear();
348  // nodes with support for servicebits filtering should be at the top
349  // Bitcoin ABC seeder
350  vSeeds.emplace_back("testnet-seed.bitcoinabc.org");
351  // Amaury SÉCHET
352  vSeeds.emplace_back("testnet-seed.deadalnix.me");
353  // BCHD
354  vSeeds.emplace_back("testnet-seed.bchd.cash");
355  // Fabien
356  vSeeds.emplace_back("testnet-seeder.fabien.cash");
357  // status.cash
358  vSeeds.emplace_back("testnet-seeder.status.cash");
359 
360  base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111);
361  base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196);
362  base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239);
363  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
364  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
366  gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ectest" : "bchtest";
367 
368  vFixedSeeds = std::vector<SeedSpec6>(
370 
372  fRequireStandard = false;
373  m_is_test_chain = true;
374  m_is_mockable_chain = false;
375 
377 
378  // Data as of block
379  // 000000000005b07ecf85563034d13efd81c1a29e47e22b20f4fc6919d5b09cd6
380  // (height 1223263)
381  chainTxData = ChainTxData{1522608381, 15052068, 0.15};
382  }
383 };
384 
388 class CRegTestParams : public CChainParams {
389 public:
393  // always enforce P2SH BIP16 on regtest
395  // BIP34 activated on regtest (Used in functional tests)
396  consensus.BIP34Height = 500;
398  // BIP65 activated on regtest (Used in functional tests)
399  consensus.BIP65Height = 1351;
400  // BIP66 activated on regtest (Used in functional tests)
401  consensus.BIP66Height = 1251;
402  // CSV activated on regtest (Used in functional tests)
403  consensus.CSVHeight = 576;
405  "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
406  // two weeks
407  consensus.nPowTargetTimespan = 14 * 24 * 60 * 60;
408  consensus.nPowTargetSpacing = 10 * 60;
411 
412  // two days
413  consensus.nDAAHalfLife = 2 * 24 * 60 * 60;
414 
415  // Faster than normal for regtest (144 instead of 2016)
418  .bit = 28,
419  // 75% of 144
420  .nActivationThreshold = 108,
421  };
422 
423  // The miner fund is disabled by default on regnet.
424  consensus.enableMinerFund = false;
425 
426  // The best chain should have at least this much work.
428 
429  // By default assume that the signatures in ancestors of this block are
430  // valid.
432 
433  // UAHF is always enabled on regtest.
434  consensus.uahfHeight = 0;
435 
436  // November 13, 2017 hard fork is always on on regtest.
437  consensus.daaHeight = 0;
438 
439  // November 15, 2018 hard fork is always on on regtest.
441 
442  // November 15, 2019 protocol upgrade
444 
445  // May 15, 2020 12:00:00 UTC protocol upgrade
447 
448  // Nov 15, 2020 12:00:00 UTC protocol upgrade
449  consensus.axionActivationTime = 1605441600;
450 
451  // May 15, 2021 12:00:00 UTC protocol upgrade
452  consensus.tachyonActivationTime = 1621080000;
453 
454  // Nov 15, 2021 12:00:00 UTC protocol upgrade
455  consensus.selectronActivationTime = 1636977600;
456 
457  // May 15, 2022 12:00:00 UTC protocol upgrade
458  consensus.gluonActivationTime = 1652616000;
459 
460  diskMagic[0] = 0xfa;
461  diskMagic[1] = 0xbf;
462  diskMagic[2] = 0xb5;
463  diskMagic[3] = 0xda;
464  netMagic[0] = 0xda;
465  netMagic[1] = 0xb5;
466  netMagic[2] = 0xbf;
467  netMagic[3] = 0xfa;
468  nDefaultPort = 18444;
469  nPruneAfterHeight = 1000;
472 
473  genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN);
475  assert(consensus.hashGenesisBlock ==
476  uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b"
477  "1a11466e2206"));
478  assert(genesis.hashMerkleRoot ==
479  uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab212"
480  "7b7afdeda33b"));
481 
483  vFixedSeeds.clear();
485  vSeeds.clear();
486 
488  fRequireStandard = true;
489  m_is_test_chain = true;
490  m_is_mockable_chain = true;
491 
493 
494  chainTxData = ChainTxData{0, 0, 0};
495 
496  base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111);
497  base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196);
498  base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239);
499  base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
500  base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
502  gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ecregtest" : "bchreg";
503  }
504 };
505 
506 static std::unique_ptr<CChainParams> globalChainParams;
507 
509  assert(globalChainParams);
510  return *globalChainParams;
511 }
512 
513 std::unique_ptr<CChainParams> CreateChainParams(const std::string &chain) {
514  if (chain == CBaseChainParams::MAIN) {
515  return std::make_unique<CMainParams>();
516  }
517 
518  if (chain == CBaseChainParams::TESTNET) {
519  return std::make_unique<CTestNetParams>();
520  }
521 
522  if (chain == CBaseChainParams::REGTEST) {
523  return std::make_unique<CRegTestParams>();
524  }
525 
526  throw std::runtime_error(
527  strprintf("%s: Unknown chain %s.", __func__, chain));
528 }
529 
530 void SelectParams(const std::string &network) {
531  SelectBaseParams(network);
533 }
Consensus::Params::gluonActivationTime
int gluonActivationTime
Unix time used for MTP activation of 15 May 2022 12:00:00 UTC upgrade.
Definition: params.h:90
CChainParams::m_assumed_blockchain_size
uint64_t m_assumed_blockchain_size
Definition: chainparams.h:104
CreateGenesisBlock
static CBlock CreateGenesisBlock(const char *pszTimestamp, const CScript &genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const Amount genesisReward)
Definition: chainparams.cpp:20
CChainParams::cashaddrPrefix
std::string cashaddrPrefix
Definition: chainparams.h:108
ArgsManager::GetBoolArg
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
Definition: system.cpp:601
CChainParams::EXT_PUBLIC_KEY
@ EXT_PUBLIC_KEY
Definition: chainparams.h:53
ChainParamsConstants::MAINNET_DEFAULT_ASSUME_VALID
const BlockHash MAINNET_DEFAULT_ASSUME_VALID
Definition: chainparamsconstants.cpp:8
ParseHex
std::vector< uint8_t > ParseHex(const char *psz)
Definition: strencodings.cpp:87
MakeTransactionRef
static CTransactionRef MakeTransactionRef()
Definition: transaction.h:320
Consensus::BIP9Deployment::bit
int bit
Bit position to select the particular bit in nVersion.
Definition: params.h:28
CBlockHeader::hashMerkleRoot
uint256 hashMerkleRoot
Definition: block.h:27
CChainParams::strNetworkID
std::string strNetworkID
Definition: chainparams.h:109
Consensus::Params::nSubsidyHalvingInterval
int nSubsidyHalvingInterval
Definition: params.h:61
ChainParamsConstants::MAINNET_MINIMUM_CHAIN_WORK
const uint256 MAINNET_MINIMUM_CHAIN_WORK
Definition: chainparamsconstants.cpp:9
CBlockHeader::nBits
uint32_t nBits
Definition: block.h:29
CChainParams::chainTxData
ChainTxData chainTxData
Definition: chainparams.h:117
CChainParams::m_assumed_chain_state_size
uint64_t m_assumed_chain_state_size
Definition: chainparams.h:105
CBlockHeader::nVersion
int32_t nVersion
Definition: block.h:25
Consensus::Params::BIP16Height
int BIP16Height
Block height at which BIP16 becomes active.
Definition: params.h:63
CChainParams::fRequireStandard
bool fRequireStandard
Definition: chainparams.h:113
Consensus::Params::nDAAHalfLife
int64_t nDAAHalfLife
Definition: params.h:107
CTestNetParams::CTestNetParams
CTestNetParams()
Definition: chainparams.cpp:245
CBaseChainParams::TESTNET
static const std::string TESTNET
Definition: chainparamsbase.h:22
CChainParams
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:47
SelectBaseParams
void SelectBaseParams(const std::string &chain)
Sets the params returned by Params() to those for the given network.
Definition: chainparamsbase.cpp:63
base_blob::SetNull
void SetNull()
Definition: uint256.h:39
Consensus::Params::magneticAnomalyHeight
int magneticAnomalyHeight
Block height at which the magnetic anomaly activation becomes active.
Definition: params.h:78
Consensus::DEPLOYMENT_TESTDUMMY
@ DEPLOYMENT_TESTDUMMY
Definition: params.h:17
CChainParams::vSeeds
std::vector< std::string > vSeeds
Definition: chainparams.h:106
CRegTestParams::CRegTestParams
CRegTestParams()
Definition: chainparams.cpp:390
CChainParams::m_is_test_chain
bool m_is_test_chain
Definition: chainparams.h:114
CChainParams::netMagic
CMessageHeader::MessageMagic netMagic
Definition: chainparams.h:101
Consensus::Params::nMinerConfirmationWindow
uint32_t nMinerConfirmationWindow
Definition: params.h:97
CChainParams::vFixedSeeds
std::vector< SeedSpec6 > vFixedSeeds
Definition: chainparams.h:111
chainparams.h
CMainParams::CMainParams
CMainParams()
Definition: chainparams.cpp:79
ChainParamsConstants::TESTNET_ASSUMED_CHAINSTATE_SIZE
const uint64_t TESTNET_ASSUMED_CHAINSTATE_SIZE
Definition: chainparamsconstants.cpp:16
COIN
static constexpr Amount COIN
Definition: amount.h:154
CChainParams::fDefaultConsistencyChecks
bool fDefaultConsistencyChecks
Definition: chainparams.h:112
CChainParams::m_is_mockable_chain
bool m_is_mockable_chain
Definition: chainparams.h:115
tinyformat.h
Consensus::Params::nPowTargetSpacing
int64_t nPowTargetSpacing
Definition: params.h:108
CChainParams::base58Prefixes
std::vector< uint8_t > base58Prefixes[MAX_BASE58_TYPES]
Definition: chainparams.h:107
CChainParams::genesis
CBlock genesis
Definition: chainparams.h:110
CScriptNum
Definition: script.h:215
chainparamsseeds.h
CBlockHeader::nNonce
uint32_t nNonce
Definition: block.h:30
strencodings.h
pnSeed6_main
static SeedSpec6 pnSeed6_main[]
List of fixed seed nodes for the bitcoin network @generated by contrib/seeds/generate-seeds....
Definition: chainparamsseeds.h:10
Consensus::Params::tachyonActivationTime
int tachyonActivationTime
Unix time used for MTP activation of 15 May 2021 12:00:00 UTC upgrade.
Definition: params.h:86
Consensus::Params::BIP34Hash
BlockHash BIP34Hash
Definition: params.h:66
ChainParamsConstants::MAINNET_ASSUMED_BLOCKCHAIN_SIZE
const uint64_t MAINNET_ASSUMED_BLOCKCHAIN_SIZE
Definition: chainparamsconstants.cpp:10
CreateChainParams
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
Definition: chainparams.cpp:513
CChainParams::SECRET_KEY
@ SECRET_KEY
Definition: chainparams.h:52
CMutableTransaction::nVersion
int32_t nVersion
Definition: transaction.h:282
ChainTxData
Holds various statistics on transactions within a chain.
Definition: chainparams.h:34
Consensus::Params::fPowAllowMinDifficultyBlocks
bool fPowAllowMinDifficultyBlocks
Definition: params.h:105
CBaseChainParams::REGTEST
static const std::string REGTEST
Definition: chainparamsbase.h:23
BlockHash::fromHex
static BlockHash fromHex(const std::string &str)
Definition: blockhash.h:17
ENABLE_MINER_FUND
const bool ENABLE_MINER_FUND
Definition: network.cpp:7
Consensus::Params::hashGenesisBlock
BlockHash hashGenesisBlock
Definition: params.h:60
SelectParams
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
Definition: chainparams.cpp:530
CBlockHeader::nTime
uint32_t nTime
Definition: block.h:28
ChainParamsConstants::MAINNET_ASSUMED_CHAINSTATE_SIZE
const uint64_t MAINNET_ASSUMED_CHAINSTATE_SIZE
Definition: chainparamsconstants.cpp:11
CBlockHeader::hashPrevBlock
BlockHash hashPrevBlock
Definition: block.h:26
chainparamsconstants.h
uint256S
uint256 uint256S(const char *str)
uint256 from const char *.
Definition: uint256.h:141
Consensus::Params::powLimit
uint256 powLimit
Proof of work parameters.
Definition: params.h:104
CheckpointData
const CCheckpointData & CheckpointData(const std::string &chain)
Definition: checkpoints.cpp:113
CChainParams::nDefaultPort
int nDefaultPort
Definition: chainparams.h:102
Amount
Definition: amount.h:19
OP_CHECKSIG
@ OP_CHECKSIG
Definition: script.h:162
CChainParams::checkpointData
CCheckpointData checkpointData
Definition: chainparams.h:116
CScript
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:430
merkle.h
BlockHash
A BlockHash is a unqiue identifier for a block.
Definition: blockhash.h:13
CBaseChainParams::MAIN
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:21
CRegTestParams
Regression test.
Definition: chainparams.cpp:388
CMainParams
Main network.
Definition: chainparams.cpp:77
Consensus::Params::fPowNoRetargeting
bool fPowNoRetargeting
Definition: params.h:106
Consensus::Params::nPowTargetTimespan
int64_t nPowTargetTimespan
Definition: params.h:109
Consensus::Params::uahfHeight
int uahfHeight
Block height at which UAHF kicks in.
Definition: params.h:74
system.h
CBlock
Definition: block.h:55
Consensus::Params::BIP34Height
int BIP34Height
Block height and hash at which BIP34 becomes active.
Definition: params.h:65
strprintf
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition: tinyformat.h:1201
Consensus::Params::daaHeight
int daaHeight
Block height at which the new DAA becomes active.
Definition: params.h:76
Consensus::Params::BIP66Height
int BIP66Height
Block height at which BIP66 becomes active.
Definition: params.h:70
CChainParams::EXT_SECRET_KEY
@ EXT_SECRET_KEY
Definition: chainparams.h:54
CBlock::vtx
std::vector< CTransactionRef > vtx
Definition: block.h:58
Consensus::Params::vDeployments
BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS]
Definition: params.h:98
ChainParamsConstants::TESTNET_DEFAULT_ASSUME_VALID
const BlockHash TESTNET_DEFAULT_ASSUME_VALID
Definition: chainparamsconstants.cpp:13
CMutableTransaction::vout
std::vector< CTxOut > vout
Definition: transaction.h:281
currencyunit.h
ARRAYLEN
#define ARRAYLEN(array)
Utilities for converting data from/to strings.
Definition: strencodings.h:20
gArgs
ArgsManager gArgs
Definition: system.cpp:76
Consensus::Params::selectronActivationTime
int selectronActivationTime
Unix time used for MTP activation of 15 Nov 2021 12:00:00 UTC upgrade.
Definition: params.h:88
Consensus::Params::gravitonHeight
int gravitonHeight
Block height at which the graviton activation becomes active.
Definition: params.h:80
network.h
Params
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:508
DEFAULT_ECASH
constexpr bool DEFAULT_ECASH
Definition: currencyunit.h:10
pnSeed6_test
static SeedSpec6 pnSeed6_test[]
Definition: chainparamsseeds.h:48
CChainParams::PUBKEY_ADDRESS
@ PUBKEY_ADDRESS
Definition: chainparams.h:50
Consensus::Params::BIP65Height
int BIP65Height
Block height at which BIP65 becomes active.
Definition: params.h:68
CChainParams::consensus
Consensus::Params consensus
Definition: chainparams.h:99
ChainParamsConstants::TESTNET_ASSUMED_BLOCKCHAIN_SIZE
const uint64_t TESTNET_ASSUMED_BLOCKCHAIN_SIZE
Definition: chainparamsconstants.cpp:15
ChainParamsConstants::TESTNET_MINIMUM_CHAIN_WORK
const uint256 TESTNET_MINIMUM_CHAIN_WORK
Definition: chainparamsconstants.cpp:14
Consensus::Params::nMinimumChainWork
uint256 nMinimumChainWork
Definition: params.h:113
Consensus::Params::CSVHeight
int CSVHeight
Block height at which CSV (BIP68, BIP112 and BIP113) becomes active.
Definition: params.h:72
CChainParams::diskMagic
CMessageHeader::MessageMagic diskMagic
Definition: chainparams.h:100
CBlockHeader::GetHash
BlockHash GetHash() const
Definition: block.cpp:11
CChainParams::nPruneAfterHeight
uint64_t nPruneAfterHeight
Definition: chainparams.h:103
CMutableTransaction::vin
std::vector< CTxIn > vin
Definition: transaction.h:280
CTestNetParams
Testnet (v3)
Definition: chainparams.cpp:243
Consensus::Params::enableMinerFund
bool enableMinerFund
Enable or disable the miner fund by default.
Definition: params.h:101
Consensus::Params::defaultAssumeValid
BlockHash defaultAssumeValid
Definition: params.h:114
CChainParams::SCRIPT_ADDRESS
@ SCRIPT_ADDRESS
Definition: chainparams.h:51
Consensus::Params::axionActivationTime
int axionActivationTime
Unix time used for MTP activation of 15 Nov 2020 12:00:00 UTC upgrade.
Definition: params.h:84
CMutableTransaction
A mutable version of CTransaction.
Definition: transaction.h:278
BlockMerkleRoot
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
Compute the Merkle root of the transactions in a block.
Definition: merkle.cpp:69
Consensus::Params::phononHeight
int phononHeight
Block height at which the phonon activation becomes active.
Definition: params.h:82
globalChainParams
static std::unique_ptr< CChainParams > globalChainParams
Definition: chainparams.cpp:506