Skip to content

Commit

Permalink
v1.1.0.0 - new hashing algo - HEX
Browse files Browse the repository at this point in the history
  • Loading branch information
HellMar committed Aug 5, 2018
1 parent 955d257 commit c26ae67
Show file tree
Hide file tree
Showing 66 changed files with 63,221 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,4 @@ contrib/devtools/split-debug.sh

# Qt creator
*.pro.user
Makefile.am.user
76 changes: 58 additions & 18 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -244,36 +244,76 @@ libbitcoin_wallet_a_SOURCES = \
crypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS)
crypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crypto_libbitcoin_crypto_a_SOURCES = \
crypto/sha1.cpp \
crypto/sha256.cpp \
crypto/sha512.cpp \
crypto/hmac_sha256.cpp \
crypto/rfc6979_hmac_sha256.cpp \
crypto/hmac_sha512.cpp \
crypto/scrypt.cpp \
crypto/ripemd160.cpp \
crypto/aes_helper.c \
crypto/blake.c \
crypto/bmw.c \
crypto/common.h \
crypto/cubehash.c \
crypto/echo.c \
crypto/fugue.c \
crypto/gost.c \
crypto/groestl.c \
crypto/hamsi.c \
crypto/haval.c \
crypto/hmac_sha256.cpp \
crypto/hmac_sha256.h \
crypto/hmac_sha512.cpp \
crypto/hmac_sha512.h \
crypto/jh.c \
crypto/keccak.c \
crypto/skein.c \
crypto/common.h \
crypto/sha256.h \
crypto/sha512.h \
crypto/hmac_sha256.h \
crypto/luffa.c \
crypto/panama.c \
crypto/rfc6979_hmac_sha256.cpp \
crypto/rfc6979_hmac_sha256.h \
crypto/hmac_sha512.h \
crypto/ripemd160.cpp \
crypto/ripemd160.h \
crypto/scrypt.cpp \
crypto/scrypt.h \
crypto/sha1.cpp \
crypto/sha1.h \
crypto/ripemd160.h \
crypto/sha256.cpp \
crypto/sha256.h \
crypto/sha2big.c \
crypto/sha512.cpp \
crypto/sha512.h \
crypto/shabal.c \
crypto/shavite.c \
crypto/simd.c \
crypto/skein.c \
crypto/sph_blake.h \
crypto/sph_bmw.h \
crypto/sph_cubehash.h \
crypto/sph_echo.h \
crypto/sph_fugue.h \
crypto/sph_gost.h \
crypto/sph_groestl.h \
crypto/sph_hamsi.h \
crypto/sph_haval.h \
crypto/sph_jh.h \
crypto/sph_keccak.h \
crypto/sph_luffa.h \
crypto/sph_panama.h \
crypto/sph_sha2.h \
crypto/sph_shabal.h \
crypto/sph_shavite.h \
crypto/sph_simd.h \
crypto/sph_skein.h \
crypto/sph_types.h

crypto/sph_types.h \
crypto/sph_whirlpool.h \
crypto/whirlpool.c

# lyra2z
crypto_libbitcoin_crypto_a_SOURCES += \
crypto/Lyra2Z/Lyra2.c \
crypto/Lyra2Z/Lyra2.h \
crypto/Lyra2Z/Lyra2Z.c \
crypto/Lyra2Z/Lyra2Z.h \
crypto/Lyra2Z/Sponge.c \
crypto/Lyra2Z/Sponge.h

# hex hash
crypto_libbitcoin_crypto_a_SOURCES += \
crypto/hex/hex.c \
crypto/hex/hex.h

# common: shared between xdnad, and xdna-qt and non-server tools
libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
Expand Down
40 changes: 31 additions & 9 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ static void convertSeed6(std::vector<CAddress>& vSeedsOut, const SeedSpec6* data
// + Contains no strange transactions
static Checkpoints::MapCheckpoints mapCheckpoints =
boost::assign::map_list_of(0, uint256("000003b39d72ad4da1eb2ef2d044032dd95750cc25c435ecad2a236dd22b99fe"))
(50, uint256("000000224104db4572f767923cafd543f36b9a4d1eee117c4dc3e1961ca6371b"));
(50, uint256("000000224104db4572f767923cafd543f36b9a4d1eee117c4dc3e1961ca6371b"))
(60200, uint256("00000000000031ba24b923e1966fbe17ae0cdff1efa9d1efc556e2a3cafb5c55"));

static const Checkpoints::CCheckpointData data = {
&mapCheckpoints,
1529677414, // * UNIX timestamp of last checkpoint block
50, // * total number of transactions between genesis and last checkpoint
1533471657, // * UNIX timestamp of last checkpoint block
75079, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
2000 // * estimated number of transactions per day after checkpoint
};
Expand All @@ -80,9 +81,11 @@ static const Checkpoints::CCheckpointData dataRegtest = {
0,
100};

CAmount CChainParams::SubsidyValue(SubsidySwitchPoints::key_type level) const
CAmount CChainParams::SubsidyValue(SubsidySwitchPoints::key_type level, uint32_t nTime) const
{
SubsidySwitchPoints::const_iterator point = subsidySwitchPoints.upper_bound(level);
const auto& points = (nTime <= nHEXHashTimestamp) ? subsidySwitchPoints : subsidySwitchPoints_HEXHash;

SubsidySwitchPoints::const_iterator point = points.upper_bound(level);

if(point != subsidySwitchPoints.begin())
point = std::prev(point);
Expand Down Expand Up @@ -134,6 +137,25 @@ class CMainParams : public CChainParams
};
assert(subsidySwitchPoints.size());

subsidySwitchPoints_HEXHash = {
{0 , 4 * COIN},
{20 * 1e9, 5 * COIN},
{30 * 1e9, 7 * COIN},
{50 * 1e9, 10 * COIN},
{80 * 1e9, 14 * COIN},
{130 * 1e9, 19 * COIN},
{210 * 1e9, 25 * COIN},
{340 * 1e9, 32 * COIN},
{550 * 1e9, 40 * COIN},
{890 * 1e9, 49 * COIN},
{1440 * 1e9, 59 * COIN},
{2330 * 1e9, 70 * COIN},
{3770 * 1e9, 82 * COIN},
{6100 * 1e9, 95 * COIN},
{9870 * 1e9, 109 * COIN},
};
assert(subsidySwitchPoints_HEXHash.size());

nMaxReorganizationDepth = 100;
nEnforceBlockUpgradeMajority = 750;
nRejectBlockOutdatedMajority = 950;
Expand Down Expand Up @@ -176,7 +198,7 @@ class CMainParams : public CChainParams
genesis.nBits = 0x1e0ffff0;
genesis.nNonce = 24657;

hashGenesisBlock = genesis.GetHash();
hashGenesisBlock = genesis.GetKeccakHash();

assert(hashGenesisBlock == uint256("000003b39d72ad4da1eb2ef2d044032dd95750cc25c435ecad2a236dd22b99fe"));
assert(genesis.hashMerkleRoot == uint256("89370975b13f97d8f9cfc373b0e9d5cc0e2e06b8dc283c76824e4df03ca2d60a"));
Expand Down Expand Up @@ -207,6 +229,7 @@ class CMainParams : public CChainParams
strObfuscationPoolDummyAddress = "X87q2gC9j6nNrnzCsg4aY6bHMLsT9nUhEw";
nStartMasternodePayments = 1403728576; //Wed, 25 Jun 2014 20:36:16 GMT

nHEXHashTimestamp = 1533567600; // 6 August 2018 г., 15:00:00 GMT+00:00
}

const Checkpoints::CCheckpointData& Checkpoints() const
Expand Down Expand Up @@ -271,7 +294,7 @@ class CTestNetParams : public CMainParams
genesis.nTime = 1529667000;
genesis.nNonce = 290796;

hashGenesisBlock = genesis.GetHash();
hashGenesisBlock = genesis.GetKeccakHash();

assert(hashGenesisBlock == uint256("000006b020d0db323b363c4d762b6931cff1855fd8a85a4455f416a91e9424f1"));

Expand Down Expand Up @@ -320,7 +343,6 @@ class CRegTestParams : public CTestNetParams
{
networkID = CBaseChainParams::REGTEST;
strNetworkID = "regtest";
strNetworkID = "regtest";
pchMessageStart[0] = 0xa1;
pchMessageStart[1] = 0xcf;
pchMessageStart[2] = 0x7e;
Expand Down Expand Up @@ -357,7 +379,7 @@ class CRegTestParams : public CTestNetParams
genesis.nBits = 0x207fffff;
genesis.nNonce = 1;

hashGenesisBlock = genesis.GetHash();
hashGenesisBlock = genesis.GetKeccakHash();
nDefaultPort = 51476;

assert(hashGenesisBlock == uint256("300552a9db8b2921c3c07e5bbf8694df5099db579742e243daeaf5008b1e74de"));
Expand Down
14 changes: 11 additions & 3 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class CChainParams
int GetDefaultPort() const { return nDefaultPort; }
const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; }
const uint256& StartWork() const { return bnStartWork; }
CAmount SubsidyValue(SubsidySwitchPoints::key_type level) const;
CAmount SubsidyValue(SubsidySwitchPoints::key_type level, uint32_t nTime) const;
/** Used to check majorities for block version upgrade */
int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; }
int RejectBlockOutdatedMajority() const { return nRejectBlockOutdatedMajority; }
Expand Down Expand Up @@ -110,8 +110,13 @@ class CChainParams
int ModifierUpgradeBlock() const { return nModifierUpdateBlock; }
int LAST_POW_BLOCK() const { return nLastPOWBlock; }
int StartMNPaymentsBlock() const {return nStartMasternodePaymentsBlock; }

const SubsidySwitchPoints& GetSubsidySwitchPoints() const { return subsidySwitchPoints; }

uint32_t HEXHashActivationTime() const {return nHEXHashTimestamp;}

const SubsidySwitchPoints& GetSubsidySwitchPoints(uint32_t nTime) const
{
return (nTime <= nHEXHashTimestamp) ? subsidySwitchPoints : subsidySwitchPoints_HEXHash;
}

protected:
CChainParams() {}
Expand Down Expand Up @@ -159,6 +164,9 @@ class CChainParams
std::string strSporkKey;
std::string strObfuscationPoolDummyAddress;
int64_t nStartMasternodePayments;

uint32_t nHEXHashTimestamp;
SubsidySwitchPoints subsidySwitchPoints_HEXHash;
};

/**
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

//! These need to be macros, as clientversion.cpp's and xdna*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
Expand Down
Loading

0 comments on commit c26ae67

Please sign in to comment.