2013-05-07 06:16:25 -07:00
|
|
|
// Copyright (c) 2010 Satoshi Nakamoto
|
2018-01-02 09:12:05 -08:00
|
|
|
// Copyright (c) 2009-2017 The Bitcoin Core developers
|
2014-10-25 02:24:16 -07:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-05-07 06:16:25 -07:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2017-11-09 16:57:53 -08:00
|
|
|
#include <chainparams.h>
|
|
|
|
#include <consensus/merkle.h>
|
2018-04-03 06:18:16 -07:00
|
|
|
#include <primitives/transaction.h>
|
2017-11-09 16:57:53 -08:00
|
|
|
#include <tinyformat.h>
|
2018-04-03 06:18:16 -07:00
|
|
|
#include <arith_uint256.h>
|
2017-11-09 16:57:53 -08:00
|
|
|
#include <util.h>
|
|
|
|
#include <utilstrencodings.h>
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2014-08-28 13:56:53 -07:00
|
|
|
#include <assert.h>
|
|
|
|
|
2017-11-09 16:57:53 -08:00
|
|
|
#include <chainparamsseeds.h>
|
2014-07-24 04:52:57 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
const arith_uint256 maxUint = UintToArith256(uint256S("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));
|
|
|
|
|
|
|
|
namespace GenesisSolutions {
|
|
|
|
const std::vector<unsigned char> MAINNET = ParseHex("009aaa951ca873376788d3002918d956e371bdf03c1afcfd8eea17867b5480d2e59a2a4dd52ed0d091af0c0909aa66ce2da97266926a9ea69b9ccca389bc120d9c4dbbae727ab9d6dfd1cd847df0ef0cc9bc989f11bdd6522429c15957daa3c5a2612522ded69857c148c0638611a19287599b47683c714b5774d0fcb1341cf4fc3a546a2441a19f02a55c6f9775749e57783b2abd5b25d41753d2f60892bbb4c3173d7787dbf5e50267324db218a14dd65f71bb02cf2566d3201800f866701db8c221424b75c639de58e7e40705157ae7d10da708ec2b9e71b9bc1ad34854a7bdf58d93766b6e291d3b545fa1f785a1a9829eccd525d16856f4317f0449d5c3516736f1e564f17690f13d3c939ad5516f1db70194902c20afd939168037fa404ec962dfbe752f79ac87a2cc3fd07bcd94d1975b1849cc739c0bc144ae4e75eda1bbed5b5ef8f65966257ec7b1fc6bb600e12e1c65c8c13a505f35dd363e07b6238211a0e502e36db5a620310b544360dd9b4a6cedabc34eeb530139daad50d4a5b6eaf4d50be4ba10e970ce984fb705376a3b0b4bf3f3778600f14e739e04406106f707085ab87ca70598c032b6717a54a9fd8ef72fdd78fb41fa9d45ad685caf77e0fc42e8e644634c24bc972f3ab0e3f0345854eda624045feb6bc9d20b5b1fc6903ebc64026e51da598c0d8711c452131a8fd2bbe01403af20e5db88afcd53b6107f001dae78b548d6a1581baca15359de83e54e75d8fc6374ca1edec17a9f4b06931162f9952575c5c3fb5dfc70a0f793049e781926daaafd4f4d330cf7d5635af1541f0d29e709a37c088d6d2e7aa09d15dfb9c2ae6c1ce661e85e9d89772eb47cfea00c621b66faf8a48cfa970b898dbd77b14e7bf44b742c00f76d2435f949f027132adb1e974551488f988e9fe379a0f86538ee59e26637a3d50bf400c7f52aa9457d77c3eb426628bb17909b26a6820d0772d4c6f74472f635e4c6e72272ce01fc475df69e10371457c55e0fbdf3a392850b9924da9c9a55792325c4318562593f0df8d39559065be03a22b1b6c21206aa1958a0d33257d89b74dea42a11aabf8eddbfe6136ab649744b704eb3e3d473654b588927dd9f486c1cd02639cf656ccbf2c4869c2ed1f2ba4ec55e69a42d5af6b3605a0cdf987734727c6fc1c1489870fb300139328c4d12eb6f5e8309cc09f5f3c29ab0957374113931ec9a56e7579446f12faacda9bd50899a17bd0f78e89ed70a723fdadfb1f4bc3317c8caa32757901604fb79ae48e22251c3b1691125ec5a99fabdf62b015bc817e1c30c06565a7071510b014058a77856a150bf86ab0c565b8bbbed159e2fb862c6215752bf3f0563e2bbbf23b0dbfb2de21b366b7e4cda212d69502643ca1f13ce362eef7435d60530b9999027dd39cd01fd8e064f1ccf6b748a2739707c9f76a041f82d3e046a9c184d83396f1f15b5a11eddb2baff40fc7b410f0c43e36ac7d8ff0204219abe4610825191fbb2be15a508c839259bfd6a4c5204c779fad6c23bbd37f90709654a5b93c6f93b4c844be12cd6cd2200afbf600b2ae9b6c133d8cdb3a85312a6d9948213c656db4d076d2bacd10577d7624be0c684bd1e5464bb39006a524d971cd2223ae9e23dea12366355b3cc4c9f6b8104df6abd23029ac4179f718e3a51eba69e4ebeec511312c423e0755b53f72ac18ef1fb445d7ab83b0894435a4b1a9cd1b473792e0628fd40bef624b4fb6ba457494cd1137a4da9e44956143068af9db98135e6890ef589726f4f5fbd45a713a24736acf150b5fb7a4c3448465322dccd7f3458c49cf2d0ef6dd7dd2ed1f1147f4a00af28ae39a73c827a38309f59faf8970448436fbb14766a3247aac4d5c610db9a662b8cb5b3e2");
|
|
|
|
|
|
|
|
const std::vector<unsigned char> TESTNET = ParseHex("002b24e10a5d2ab32b053a20ca6ebed779be1d935b1500eeea5c87aec684c6f934196fdfca6539de0cf1141544bffc5c0d1d4bab815fb5d8c2b195ccdf0755599ee492b9d98e3b79a178949f45485ad80dba38ec0461102adaa369b757ebb2bf8d75b5f67a341d666406d862a102c69800f20a7075be360a7eb2d315d78e4ce32c741f3baf7bf3e1e651976f734f367b1f126f62503b34d06d6e99b3659b2a47f5cfcf71c87e24e5023151d4af87454e7638a19b846350dd5fbc53e4ce1cce2597992b36cbcae0c24717e412c8df9ddca3e90c7629bd8c157c66d8906486943cf78e24d55dd4152f45eff49acf9fb9fddef81f2ee55892b38db940c404eaacf819588b83f0f761f1ba5b31a0ea1f8f4c5210638bbb59a2d8ddff9535f546b42a7eac5f3ee87616a075bddc3118b7f2c041f4b1e8dbcd11eea95835403066b5bb50cd23122dcb12166d75aafcfc1ca8f30580b4d48a5aa305657a06b4b650ed4633f2fa496235082feff65f70e19871f41b70632b53e57ddf38c207d631e5a56fa50bb71150f99427f73d82a439a5f70dfc7d8bbfc39d330ca7924527a5deb8950b9fa7020cfde5e07b84546e96764519ef6dd3fdc3a974abd342bdc7e4ee76bc11d5519541015afba1a0517fd347196aa326b0905a5916b83515c16f8f13105479c29f1eff3bc024ddbb07dcc672247cedc0d4ba32332ead0f13c58f50170642e16e076c34f5e75e3e8f5ac7f5238d67564fd385efecf972b0abf939a99bc7ef8f3a21cac21d2168706bbad3f4af66bb01cf61cfbc352a23797b62dcb5480bf2b7b277af233f5ce42a144d47119a89e1d114fa0bec2f13475b6b1df907bc3a429f1771afa3857bf16bfca3f76a5df14da62dc157fff4225bda73c3cfefa989edc24673bf932a024593da4c38b1a4628dd77ad919f4f7b7fb76976e696db69c89016ab30d9aa2d509f78d913d00ca9ac881aa759fc019b8c5e3eac6fddb4e0f044595e10d4997e29c79800f77cf1d97583d534db0f2726cba3739e7371eeffa2aca12b0d290ac45f44973f32f7675a5b49c94c4b608da2926555d16b7eb3670e12345a63f88797e5a5e21252c2c9463d7896001031a81bac0354336b35c5a10c93d9ae3054f6f6e4492f7c1f09a9d75034d5d0b220a9bb231e583659d5b6923a4e879326194de5c9805a02cb648508a8f9b6cd26dc17d322a478c1c599e1ec3adf2da6ce7a7e3a073b55cf30cf6b124f7700409abe14af8c60ab178579623916f165dbfd26f37056bf33c34f3af30939e1277376e4c5cba339f36381a05ef6481db033fb4c07a19e8655f8b12f9ab3c602e127b4ab1ee48e1c6a91382b54ed36ef9bb21b3bfa80a9107864dcb594dcad250e402b312607e648639631a3d1aeb17cfe3370202720ca8a46db15af92e8b46062b5bd035b24c35a592e5620d632faf1bf19a86df179fe52dd4cdbecd3cb7a336ca7489e4d1dc9433f1163c89d88c5eac36fc562496dc7583fe67c559c9a71cf89e9a0a59d5a14764926852d44a88d2ddb361d612ec06f9de874473eaf1d36b3a41911ac072b7826e6acea3d8425dc271833dba2ec17d1a270e49becbf21330ba2f0edc4b05f4df01623f3c82246ae23ea2c022434ef09611aa19ba35c3ecbad965af3ad9bc6c9b0d3b059c239ffbf9272d0150c151b4510d659cbd0e4a9c32945c612681b70ee4dcbeefeacde630b127115fd9af16cef4afefe611c9dfcc63e6833bf4dab79a7e1ae3f70321429557ab9da48bf93647830b5eb5780f23476d3d4d06a39ae532da5b2f30f151587eb5df19ec1acf099e1ac506e071eb52c3c3cc88ccf6622b2913acf07f1b772b5012e39173211e51773f3eb42d667fff1d902c5c87bd507837b3fd993e70ac9706a0");
|
|
|
|
|
|
|
|
const std::vector<unsigned char> REGTEST = ParseHex("05ffd6ad016271ade20cfce093959c3addb2079629f9f123c52ef920caa316531af5af3f");
|
|
|
|
}
|
|
|
|
|
|
|
|
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint256 nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward, std::vector<unsigned char> nSolution)
|
2015-07-03 05:29:57 -07:00
|
|
|
{
|
|
|
|
CMutableTransaction txNew;
|
|
|
|
txNew.nVersion = 1;
|
|
|
|
txNew.vin.resize(1);
|
|
|
|
txNew.vout.resize(1);
|
2015-06-05 13:01:44 -07:00
|
|
|
txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
|
2015-07-03 05:29:57 -07:00
|
|
|
txNew.vout[0].nValue = genesisReward;
|
|
|
|
txNew.vout[0].scriptPubKey = genesisOutputScript;
|
|
|
|
|
|
|
|
CBlock genesis;
|
|
|
|
genesis.nTime = nTime;
|
|
|
|
genesis.nBits = nBits;
|
|
|
|
genesis.nNonce = nNonce;
|
2018-04-03 06:18:16 -07:00
|
|
|
genesis.nSolution = nSolution;
|
2015-07-03 05:29:57 -07:00
|
|
|
genesis.nVersion = nVersion;
|
2016-11-10 17:34:17 -08:00
|
|
|
genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));
|
2015-07-03 05:29:57 -07:00
|
|
|
genesis.hashPrevBlock.SetNull();
|
2015-11-17 08:35:44 -08:00
|
|
|
genesis.hashMerkleRoot = BlockMerkleRoot(genesis);
|
2018-04-03 06:18:16 -07:00
|
|
|
genesis.nSolution = nSolution;
|
|
|
|
|
2015-07-03 05:29:57 -07:00
|
|
|
return genesis;
|
|
|
|
}
|
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
|
2015-07-03 05:29:57 -07:00
|
|
|
/**
|
|
|
|
* 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=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)
|
|
|
|
* CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)
|
|
|
|
* CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)
|
|
|
|
* CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)
|
|
|
|
* vMerkleTree: 4a5e1e
|
|
|
|
*/
|
2018-04-03 06:18:16 -07:00
|
|
|
static CBlock CreateGenesisBlock(uint32_t nTime, uint256 nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward, std::vector<unsigned char> nSolution)
|
2015-07-03 05:29:57 -07:00
|
|
|
{
|
2018-04-03 06:18:16 -07:00
|
|
|
const char* pszTimestamp = "Zclassic860413afe207aa173afee4fcfa9166dc745651c754a41ea8f155646f5aa828ac";
|
2015-07-29 12:13:36 -07:00
|
|
|
const CScript genesisOutputScript = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
|
2018-04-03 06:18:16 -07:00
|
|
|
return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward, nSolution);
|
2015-07-03 05:29:57 -07:00
|
|
|
}
|
|
|
|
|
2017-05-04 20:21:34 -07:00
|
|
|
void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
|
2015-05-21 18:50:01 -07:00
|
|
|
{
|
|
|
|
consensus.vDeployments[d].nStartTime = nStartTime;
|
|
|
|
consensus.vDeployments[d].nTimeout = nTimeout;
|
|
|
|
}
|
|
|
|
|
2014-10-25 02:24:16 -07:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2014-08-31 12:32:23 -07:00
|
|
|
|
2013-05-07 06:16:25 -07:00
|
|
|
class CMainParams : public CChainParams {
|
|
|
|
public:
|
|
|
|
CMainParams() {
|
2014-06-11 03:23:49 -07:00
|
|
|
strNetworkID = "main";
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
consensus.fCoinbaseMustBeProtected = true;
|
|
|
|
consensus.nSubsidyHalvingInterval = 840000;
|
|
|
|
|
|
|
|
// P2SH, height in coinbase, CLTV and DERSIG all enforced from genesis
|
|
|
|
consensus.BIP34Height = 0;
|
|
|
|
consensus.BIP65Height = 0;
|
|
|
|
consensus.BIP66Height = 0;
|
|
|
|
|
|
|
|
consensus.prePowLimit = uint256S("0007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
|
|
consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
|
|
consensus.nPowAveragingWindow = 17;
|
|
|
|
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
|
|
|
|
consensus.nPowMaxAdjustDown = 32; // 32% adjustment down
|
|
|
|
consensus.nPowMaxAdjustUp = 16; // 16% adjustment up
|
|
|
|
consensus.nPowTargetSpacing = 2.5 * 60;
|
2015-02-11 02:58:11 -08:00
|
|
|
consensus.fPowAllowMinDifficultyBlocks = false;
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.nPowDifficultyBombHeight = 600000;
|
2015-10-19 05:25:29 -07:00
|
|
|
consensus.fPowNoRetargeting = false;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
2016-02-14 20:13:27 -08:00
|
|
|
consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.nMinerConfirmationWindow = 2016;
|
|
|
|
|
2016-03-09 13:00:53 -08:00
|
|
|
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
|
2016-02-20 14:37:13 -08:00
|
|
|
|
|
|
|
// Deployment of BIP68, BIP112, and BIP113.
|
2016-10-17 04:24:37 -07:00
|
|
|
// Deployment of SegWit (BIP141, BIP143, and BIP147)
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1533081600; // 2018-08-01
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1535587200; // 2018-08-30
|
|
|
|
static_assert(Consensus::DEPLOYMENT_SEGWIT == Consensus::DEPLOYMENT_CSV, "segwit and csv deployed together");
|
2015-11-05 16:42:38 -08:00
|
|
|
|
2016-10-21 22:33:25 -07:00
|
|
|
// The best chain should have at least this much work.
|
2018-05-17 06:15:28 -07:00
|
|
|
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000ffffffffffff");
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
pchMessageStart[0] = 0xa8;
|
|
|
|
pchMessageStart[1] = 0xea;
|
|
|
|
pchMessageStart[2] = 0xa2;
|
|
|
|
pchMessageStart[3] = 0xcd;
|
|
|
|
|
|
|
|
nDefaultPort = 7933;
|
|
|
|
|
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 11:27:44 -08:00
|
|
|
nPruneAfterHeight = 100000;
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
nEquihashN = 200;
|
|
|
|
nEquihashK = 9;
|
|
|
|
|
|
|
|
uint256 nNonce = uint256S("000000000000000000000000000000000000000000000000000000000000021d");
|
|
|
|
genesis = CreateGenesisBlock(1478403829, nNonce, 0x1f07ffff, 4, 0, GenesisSolutions::MAINNET);
|
2015-02-11 02:58:11 -08:00
|
|
|
consensus.hashGenesisBlock = genesis.GetHash();
|
2018-04-03 06:18:16 -07:00
|
|
|
assert(genesis.hashMerkleRoot == uint256S("0x19612bcf00ea7611d315d7f43554fa983c6e8c30cba17e52c679e0e80abf7d42"));
|
|
|
|
assert(consensus.hashGenesisBlock == uint256S("0x0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602"));
|
|
|
|
|
|
|
|
vSeeds.emplace_back("dnsseed.btcprivate.org");
|
|
|
|
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "b1"
|
|
|
|
base58Prefixes[PUBKEY_ADDRESS] = {0x13,0x25};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "bx"
|
|
|
|
base58Prefixes[SCRIPT_ADDRESS] = {0x13,0xAF};
|
|
|
|
// the first character, when base58 encoded, is "5" or "K" or "L" (as in Bitcoin)
|
|
|
|
base58Prefixes[SECRET_KEY] = {0x80};
|
|
|
|
// do not rely on these BIP32 prefixes; they are not specified and may change
|
|
|
|
base58Prefixes[EXT_PUBLIC_KEY] = {0x04,0x88,0xB2,0x1E};
|
|
|
|
base58Prefixes[EXT_SECRET_KEY] = {0x04,0x88,0xAD,0xE4};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "zk"
|
|
|
|
base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0xA8};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "SK"
|
|
|
|
base58Prefixes[ZCSPENDING_KEY] = {0xAB,0x36};
|
|
|
|
|
2018-07-14 17:18:23 -07:00
|
|
|
bech32_hrp = "btcp"; // SLIP-0173
|
2017-08-25 19:55:52 -07:00
|
|
|
|
2015-01-23 20:40:50 -08:00
|
|
|
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2015-03-13 09:25:34 -07:00
|
|
|
fDefaultConsistencyChecks = false;
|
2014-06-04 03:51:29 -07:00
|
|
|
fRequireStandard = true;
|
|
|
|
fMineBlocksOnDemand = false;
|
2014-08-31 12:32:23 -07:00
|
|
|
|
2017-11-09 12:06:49 -08:00
|
|
|
checkpointData = {
|
2017-06-06 12:15:28 -07:00
|
|
|
{
|
2018-04-03 06:18:16 -07:00
|
|
|
{ 0, consensus.hashGenesisBlock },
|
|
|
|
{ 30000, uint256S("0x000000005c2ad200c3c7c8e627f67b306659efca1268c9bb014335fdadc0c392") },
|
|
|
|
{ 160000, uint256S("0x000000065093005a1a46ee95d6d66c2b07008220ca64dd3b3a93bbd1945480c0") },
|
|
|
|
{ 272992, uint256S("0x0102a4e1353149c9221ebd7c45b3170ea4b8a7d1cf4075b3bc50c440fb9ebdd6") },
|
|
|
|
{ 273992, uint256S("0x000822e42b2128a296b704c273a4c3f0e707b06305d2be521cf7577ef67e476a") },
|
|
|
|
{ 274992, uint256S("0x03e91186991b31044179b82e88ee06c2205e3304a525d130070153fde4aaf414") },
|
|
|
|
{ 275992, uint256S("0x02bc3f08cec58ac79b35a29161b43cd301696e6e6421d704314d08a35b2169db") },
|
|
|
|
{ 276992, uint256S("0x0046665bbb64b609935ed0fd184d6c42657dc5c36b16ed1e59ecc2fcb0508d32") },
|
|
|
|
{ 277992, uint256S("0x0111d3ffc37fb3474ed2a6e3e9bfc53ee0d7cc0413a732f19d59061700f6b842") },
|
|
|
|
{ 278458, uint256S("0x0747cecedfd30754323c5afdaef547d5e90fd50485370ebf12dd33bbac61faaa") },
|
|
|
|
{ 279500, uint256S("0x0000000082ece76130c82337903b14a2109fab2dcd2d153fcdbf48a0054a694b") },
|
|
|
|
{ 320000, uint256S("0x0000000311dc0b774a2f90476b5ee225999df6eb4f3ba1bc875e804bab17e313") }
|
2017-06-06 12:15:28 -07:00
|
|
|
}
|
2017-01-04 07:31:56 -08:00
|
|
|
};
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.defaultAssumeValid = checkpointData.mapCheckpoints.crbegin()->second;
|
2017-01-04 07:31:56 -08:00
|
|
|
|
|
|
|
chainTxData = ChainTxData{
|
2018-04-03 06:18:16 -07:00
|
|
|
1520105951, // * UNIX timestamp of last known number of transactions
|
|
|
|
55463694, // * total number of transactions between genesis and that timestamp
|
|
|
|
// (the tx=... number in the SetBestChain debug.log lines)
|
|
|
|
1 // * estimated number of transactions per second after that timestamp
|
2015-04-23 15:30:55 -07:00
|
|
|
};
|
2017-12-12 12:32:50 -08:00
|
|
|
|
|
|
|
/* disable fallback fee on mainnet */
|
|
|
|
m_fallback_fee_enabled = false;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
nForkStartHeight = 272991;
|
|
|
|
nForkHeightRange = 5467;
|
2014-08-31 12:32:23 -07:00
|
|
|
}
|
2013-05-07 06:16:25 -07:00
|
|
|
};
|
|
|
|
|
2014-10-25 02:24:16 -07:00
|
|
|
/**
|
2018-07-20 20:54:39 -07:00
|
|
|
* Testnet
|
2014-10-25 02:24:16 -07:00
|
|
|
*/
|
2015-07-03 05:30:18 -07:00
|
|
|
class CTestNetParams : public CChainParams {
|
2013-05-07 06:16:25 -07:00
|
|
|
public:
|
|
|
|
CTestNetParams() {
|
2014-06-11 03:23:49 -07:00
|
|
|
strNetworkID = "test";
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
consensus.fCoinbaseMustBeProtected = true;
|
|
|
|
consensus.nSubsidyHalvingInterval = 840000;
|
|
|
|
|
|
|
|
// P2SH, height in coinbase, CLTV and DERSIG all enforced from genesis
|
|
|
|
consensus.BIP34Height = 0;
|
|
|
|
consensus.BIP65Height = 0;
|
|
|
|
consensus.BIP66Height = 0;
|
|
|
|
|
|
|
|
consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
|
|
|
|
consensus.prePowLimit = consensus.powLimit;
|
|
|
|
consensus.nPowAveragingWindow = 17;
|
|
|
|
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
|
|
|
|
consensus.nPowMaxAdjustDown = 32; // 32% adjustment down
|
|
|
|
consensus.nPowMaxAdjustUp = 16; // 16% adjustment up
|
|
|
|
consensus.nPowTargetSpacing = 2.5 * 60;
|
2015-02-11 02:58:11 -08:00
|
|
|
consensus.fPowAllowMinDifficultyBlocks = true;
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.nPowDifficultyBombHeight = 100000;
|
2015-10-19 05:25:29 -07:00
|
|
|
consensus.fPowNoRetargeting = false;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
consensus.nRuleChangeActivationThreshold = 1512; // 75% of 2016
|
|
|
|
consensus.nMinerConfirmationWindow = 2016;
|
|
|
|
|
2016-03-09 13:00:53 -08:00
|
|
|
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
|
2016-02-20 14:37:13 -08:00
|
|
|
|
|
|
|
// Deployment of BIP68, BIP112, and BIP113.
|
2016-10-17 04:24:37 -07:00
|
|
|
// Deployment of SegWit (BIP141, BIP143, and BIP147)
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1533081600; // 2018-08-01
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1535587200; // 2018-08-30
|
|
|
|
static_assert(Consensus::DEPLOYMENT_SEGWIT == Consensus::DEPLOYMENT_CSV, "segwit and csv deployed together");
|
2015-11-05 16:42:38 -08:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
pchMessageStart[0] = 0xf6;
|
|
|
|
pchMessageStart[1] = 0x1b;
|
|
|
|
pchMessageStart[2] = 0xf6;
|
|
|
|
pchMessageStart[3] = 0xd6;
|
2016-10-21 22:33:25 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
nDefaultPort = 17933;
|
2017-01-06 03:49:59 -08:00
|
|
|
|
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 11:27:44 -08:00
|
|
|
nPruneAfterHeight = 1000;
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
nEquihashN = 200;
|
|
|
|
nEquihashK = 9;
|
|
|
|
|
|
|
|
uint256 nNonce = uint256S("0000000000000000000000000000000000000000000000000000000000000013");
|
|
|
|
genesis = CreateGenesisBlock(1479443947, nNonce, 0x2007ffff, 4, 0, GenesisSolutions::TESTNET);
|
2015-02-11 02:58:11 -08:00
|
|
|
consensus.hashGenesisBlock = genesis.GetHash();
|
2018-04-03 06:18:16 -07:00
|
|
|
assert(genesis.hashMerkleRoot == uint256S("0x19612bcf00ea7611d315d7f43554fa983c6e8c30cba17e52c679e0e80abf7d42"));
|
2018-06-26 20:50:26 -07:00
|
|
|
assert(consensus.hashGenesisBlock == uint256S("0x03e1c4bb705c871bf9bfda3e74b7f8f86bff267993c215a89d5795e3708e5e1f"));
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
vSeeds.emplace_back("dnsseed.testnet.btcprivate.org");
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "n1"
|
|
|
|
base58Prefixes[PUBKEY_ADDRESS] = {0x19,0x57};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "nx"
|
|
|
|
base58Prefixes[SCRIPT_ADDRESS] = {0x19,0xE0};
|
|
|
|
// the first character, when base58 encoded, is "9" or "c" (as in Bitcoin)
|
|
|
|
base58Prefixes[SECRET_KEY] = {0xEF};
|
|
|
|
// do not rely on these BIP32 prefixes; they are not specified and may change
|
|
|
|
base58Prefixes[EXT_PUBLIC_KEY] = {0x04,0x35,0x87,0xCF};
|
|
|
|
base58Prefixes[EXT_SECRET_KEY] = {0x04,0x35,0x83,0x94};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "zz"
|
|
|
|
base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0xC0};
|
|
|
|
// guarantees the first 2 characters, when base58 encoded, are "ST"
|
|
|
|
base58Prefixes[ZCSPENDING_KEY] = {0xAC,0x08};
|
2014-03-22 12:09:12 -07:00
|
|
|
|
2018-07-14 17:18:23 -07:00
|
|
|
bech32_hrp = "tbtcp"; // SLIP-0173
|
2017-08-25 19:55:52 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_test));
|
2014-07-24 04:52:57 -07:00
|
|
|
|
2015-03-13 09:25:34 -07:00
|
|
|
fDefaultConsistencyChecks = false;
|
2018-04-03 06:18:16 -07:00
|
|
|
fRequireStandard = true;
|
2014-06-04 03:51:29 -07:00
|
|
|
fMineBlocksOnDemand = false;
|
2015-04-23 15:30:55 -07:00
|
|
|
|
2017-11-09 12:06:49 -08:00
|
|
|
checkpointData = {
|
2017-06-06 12:15:28 -07:00
|
|
|
{
|
2018-04-03 06:18:16 -07:00
|
|
|
{ 0, consensus.hashGenesisBlock },
|
2017-06-06 12:15:28 -07:00
|
|
|
}
|
2017-01-04 07:31:56 -08:00
|
|
|
};
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.defaultAssumeValid = checkpointData.mapCheckpoints.crbegin()->second;
|
2017-01-04 07:31:56 -08:00
|
|
|
|
|
|
|
chainTxData = ChainTxData{
|
2018-04-03 06:18:16 -07:00
|
|
|
genesis.nTime, // * UNIX timestamp of last known number of transactions
|
|
|
|
0, // * total number of transactions between genesis and that timestamp
|
|
|
|
// (the tx=... number in the SetBestChain debug.log lines)
|
|
|
|
0 // * estimated number of transactions per second after that timestamp
|
2015-04-23 15:30:55 -07:00
|
|
|
};
|
|
|
|
|
2017-12-12 12:32:50 -08:00
|
|
|
m_fallback_fee_enabled = true;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
nForkStartHeight = 10;
|
|
|
|
nForkHeightRange = 300;
|
2014-08-31 12:32:23 -07:00
|
|
|
}
|
2013-05-07 06:16:25 -07:00
|
|
|
};
|
|
|
|
|
2014-10-25 02:24:16 -07:00
|
|
|
/**
|
|
|
|
* Regression test
|
|
|
|
*/
|
2015-07-03 05:30:18 -07:00
|
|
|
class CRegTestParams : public CChainParams {
|
2013-05-07 06:16:25 -07:00
|
|
|
public:
|
|
|
|
CRegTestParams() {
|
2014-06-11 03:23:49 -07:00
|
|
|
strNetworkID = "regtest";
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
consensus.fCoinbaseMustBeProtected = false;
|
|
|
|
consensus.nSubsidyHalvingInterval = 840000;
|
|
|
|
|
|
|
|
// P2SH, height in coinbase, CLTV and DERSIG all enforced from genesis
|
|
|
|
consensus.BIP34Height = 0;
|
|
|
|
consensus.BIP65Height = 0;
|
|
|
|
consensus.BIP66Height = 0;
|
|
|
|
|
|
|
|
consensus.powLimit = uint256S("0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f");
|
|
|
|
consensus.prePowLimit = consensus.powLimit;
|
|
|
|
consensus.nPowAveragingWindow = 17;
|
|
|
|
assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow);
|
|
|
|
consensus.nPowMaxAdjustDown = 0;
|
|
|
|
consensus.nPowMaxAdjustUp = 0;
|
|
|
|
consensus.nPowTargetSpacing = 2.5 * 60;
|
2015-07-03 05:30:18 -07:00
|
|
|
consensus.fPowAllowMinDifficultyBlocks = true;
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.nPowDifficultyBombHeight = 10000;
|
2015-10-19 05:25:29 -07:00
|
|
|
consensus.fPowNoRetargeting = true;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
consensus.nRuleChangeActivationThreshold = 108;
|
|
|
|
consensus.nMinerConfirmationWindow = 144;
|
|
|
|
|
2016-03-09 13:00:53 -08:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
|
|
|
|
|
|
|
|
// Deployment of BIP68, BIP112, and BIP113.
|
|
|
|
// Deployment of SegWit (BIP141, BIP143, and BIP147)
|
2016-02-20 14:37:13 -08:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1533081600; // 2018-08-01
|
|
|
|
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1535587200; // 2018-08-30
|
|
|
|
static_assert(Consensus::DEPLOYMENT_SEGWIT == Consensus::DEPLOYMENT_CSV, "segwit and csv deployed together");
|
2015-07-29 12:13:36 -07:00
|
|
|
|
2018-04-03 06:18:16 -07:00
|
|
|
pchMessageStart[0] = 0xaa;
|
|
|
|
pchMessageStart[1] = 0xe8;
|
|
|
|
pchMessageStart[2] = 0x3f;
|
|
|
|
pchMessageStart[3] = 0x5f;
|
2016-10-21 22:33:25 -07:00
|
|
|
|
2018-07-20 20:54:39 -07:00
|
|
|
nDefaultPort = 17444;
|
2017-01-06 03:49:59 -08:00
|
|
|
|
Add block pruning functionality
This adds a -prune=N option to bitcoind, which if set to N>0 will enable block
file pruning. When pruning is enabled, block and undo files will be deleted to
try to keep total space used by those files to below the prune target (N, in
MB) specified by the user, subject to some constraints:
- The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP),
- N must be at least 550MB (chosen as a value for the target that could
reasonably be met, with some assumptions about block sizes, orphan rates,
etc; see comment in main.h),
- No blocks are pruned until chainActive is at least 100,000 blocks long (on
mainnet; defined separately for mainnet, testnet, and regtest in chainparams
as nPruneAfterHeight).
This unsets NODE_NETWORK if pruning is enabled.
Also included is an RPC test for pruning (pruning.py).
Thanks to @rdponticelli for earlier work on this feature; this is based in
part off that work.
2015-02-23 11:27:44 -08:00
|
|
|
nPruneAfterHeight = 1000;
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2018-07-28 15:30:33 -07:00
|
|
|
nEquihashN = 48;
|
|
|
|
nEquihashK = 5;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
|
|
|
uint256 nNonce = uint256S("0000000000000000000000000000000000000000000000000000000000000009");
|
|
|
|
genesis = CreateGenesisBlock(1482971059, nNonce, 0x200f0f0f, 4, 0, GenesisSolutions::REGTEST);
|
2015-07-29 12:13:36 -07:00
|
|
|
consensus.hashGenesisBlock = genesis.GetHash();
|
2018-04-03 06:18:16 -07:00
|
|
|
assert(consensus.hashGenesisBlock == uint256S("0x0575f78ee8dc057deee78ef691876e3be29833aaee5e189bb0459c087451305a"));
|
2015-07-29 12:13:36 -07:00
|
|
|
|
2018-06-26 21:03:16 -07:00
|
|
|
base58Prefixes[PUBKEY_ADDRESS] = {0x19,0x57};
|
|
|
|
base58Prefixes[SCRIPT_ADDRESS] = {0x19,0xE0};
|
|
|
|
base58Prefixes[SECRET_KEY] = {0xEF};
|
|
|
|
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};
|
|
|
|
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};
|
2018-04-03 06:18:16 -07:00
|
|
|
base58Prefixes[ZCPAYMENT_ADDRRESS] = {0x16,0xC0};
|
|
|
|
base58Prefixes[ZCSPENDING_KEY] = {0xAC,0x08};
|
2018-07-14 17:18:23 -07:00
|
|
|
bech32_hrp = "regbtcp"; // SLIP-0173
|
2013-05-07 06:16:25 -07:00
|
|
|
|
2015-03-13 09:25:34 -07:00
|
|
|
fDefaultConsistencyChecks = true;
|
2014-06-04 03:51:29 -07:00
|
|
|
fRequireStandard = false;
|
|
|
|
fMineBlocksOnDemand = true;
|
2015-04-23 15:30:55 -07:00
|
|
|
|
2017-11-09 12:06:49 -08:00
|
|
|
checkpointData = {
|
2017-06-06 12:15:28 -07:00
|
|
|
{
|
2018-04-03 06:18:16 -07:00
|
|
|
{ 0, consensus.hashGenesisBlock },
|
2017-06-06 12:15:28 -07:00
|
|
|
}
|
2017-01-04 07:31:56 -08:00
|
|
|
};
|
2018-04-03 06:18:16 -07:00
|
|
|
consensus.defaultAssumeValid = checkpointData.mapCheckpoints.crbegin()->second;
|
2017-01-04 07:31:56 -08:00
|
|
|
|
|
|
|
chainTxData = ChainTxData{
|
2018-04-03 06:18:16 -07:00
|
|
|
genesis.nTime, // * UNIX timestamp of last known number of transactions
|
|
|
|
0, // * total number of transactions between genesis and that timestamp
|
|
|
|
// (the tx=... number in the SetBestChain debug.log lines)
|
|
|
|
0 // * estimated number of transactions per second after that timestamp
|
2015-04-23 15:30:55 -07:00
|
|
|
};
|
2017-01-04 07:31:56 -08:00
|
|
|
|
2017-12-12 12:32:50 -08:00
|
|
|
m_fallback_fee_enabled = true;
|
2018-04-03 06:18:16 -07:00
|
|
|
|
2018-07-28 15:30:33 -07:00
|
|
|
nForkStartHeight = 0;
|
|
|
|
nForkHeightRange = 0;
|
2014-08-31 12:32:23 -07:00
|
|
|
}
|
2013-05-07 06:16:25 -07:00
|
|
|
};
|
|
|
|
|
2015-05-21 18:50:01 -07:00
|
|
|
static std::unique_ptr<CChainParams> globalChainParams;
|
2013-05-07 06:16:25 -07:00
|
|
|
|
|
|
|
const CChainParams &Params() {
|
2015-05-21 18:50:01 -07:00
|
|
|
assert(globalChainParams);
|
|
|
|
return *globalChainParams;
|
2013-05-07 06:16:25 -07:00
|
|
|
}
|
|
|
|
|
2015-05-21 18:50:01 -07:00
|
|
|
std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain)
|
2015-06-30 12:39:49 -07:00
|
|
|
{
|
|
|
|
if (chain == CBaseChainParams::MAIN)
|
2015-05-21 18:50:01 -07:00
|
|
|
return std::unique_ptr<CChainParams>(new CMainParams());
|
2015-06-30 12:39:49 -07:00
|
|
|
else if (chain == CBaseChainParams::TESTNET)
|
2015-05-21 18:50:01 -07:00
|
|
|
return std::unique_ptr<CChainParams>(new CTestNetParams());
|
2015-06-30 12:39:49 -07:00
|
|
|
else if (chain == CBaseChainParams::REGTEST)
|
2015-05-21 18:50:01 -07:00
|
|
|
return std::unique_ptr<CChainParams>(new CRegTestParams());
|
|
|
|
throw std::runtime_error(strprintf("%s: Unknown chain %s.", __func__, chain));
|
|
|
|
}
|
|
|
|
|
2015-06-30 12:39:49 -07:00
|
|
|
void SelectParams(const std::string& network)
|
|
|
|
{
|
2014-08-02 11:54:57 -07:00
|
|
|
SelectBaseParams(network);
|
2015-05-21 18:50:01 -07:00
|
|
|
globalChainParams = CreateChainParams(network);
|
2014-08-02 11:54:57 -07:00
|
|
|
}
|
2016-07-25 14:22:37 -07:00
|
|
|
|
2017-05-04 20:21:34 -07:00
|
|
|
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)
|
2016-07-25 14:22:37 -07:00
|
|
|
{
|
2017-05-04 20:21:34 -07:00
|
|
|
globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout);
|
2016-07-25 14:22:37 -07:00
|
|
|
}
|