It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
chainparams.cpp:210:60: error: ‘Logprintf’ was not declared in this scope
Logprintf("recalculating params for mainnet.\n");
^
chainparams.cpp:211:73: error: request for member ‘ToString’ in ‘((CMainParams*)this)->CMainParams::.CChainParams::genesis.CBlock:: .CBlockHeader::nNonce’, which is of non-class type ‘uint32_t {aka unsigned int}’
Logprintf("old mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
^~~~~~~~
chainparams.cpp:214:32: warning: statement has no effect [-Wunused-value]
for(genesis.nNonce == 0; genesis.GetHash() > bnProofOfWorkLimit; genesis.nNonce++){ }
~~~~~~~~~~~~~~~^~~~
chainparams.cpp:214:58: error: ‘bnProofOfWorkLimit’ was not declared in this scope
for(genesis.nNonce == 0; genesis.GetHash() > bnProofOfWorkLimit; genesis.nNonce++){ }
^~~~~~~~~~~~~~~~~~
chainparams.cpp:216:73: error: request for member ‘ToString’ in ‘((CMainParams*)this)->CMainParams::.CChainParams::genesis.CBlock:: .CBlockHeader::nNonce’, which is of non-class type ‘uint32_t {aka unsigned int}’
Logprintf("new mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
for(genesis.nNonce == 0; genesis.GetHash() > bnProofOfWorkLimit; genesis.nNonce++){ }
0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
AA0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF
echo AA0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF | xxd -r -p > temp
openssl dgst -sha256 temp
SHA256(temp)= 855d46b953763179ae26937d7d5d9a7fbdf063f6e23fa5abc08e02b1ee202b0e
echo 855d46b953763179ae26937d7d5d9a7fbdf063f6e23fa5abc08e02b1ee202b0e | xxd -r -p > temp2
openssl dgst -sha256 temp2
SHA256(temp2)=02709d7a22eebf159eb9e67669afb4c565a6fa90d9ac2f6069beccce226b04ab
AA0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF02709D7A.
sudo apt-get install mit-scheme
mit-scheme
(define (base58check input)
(define (base58digit k) (string-ref "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" k))
(define (extractdigits n digits)
(if (> 58 n)
(list->string (cons (base58digit n) digits))
(extractdigits (quotient n 58) (cons (base58digit (modulo n 58)) digits))))
(extractdigits input '()))
(base58check #xAA0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF02709D7A)
"6hU445Fi7j2WSwc2uLsbcQMJ1r2xbENWxGdfxTApKaRRaQ2Ppk1"
(exit)
txNew.vout[0].nValue = 50 * COIN;
txNew.vout[0].nValue = 5000 * COIN;
CAmount GetBlockValue(int nHeight, const CAmount& nFees)
{
CAmount nSubsidy = 50 * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return nFees;
// Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy + nFees;
}
CAmount GetBlockValue(int nHeight, const CAmount& nFees)
{
CAmount nSubsidy = (nHeight == 0 ? 5000 : 50) * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Force block reward to zero when right shift is undefined.
if (halvings >= 64)
return nFees;
// Subsidy is cut in half every 350,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
return nSubsidy + nFees;
}
/** No amount larger than this (in satoshi) is valid */
static const CAmount MAX_MONEY = 21000000 * COIN;
CAmount AmountFromValue(const Value& value)
{
double dAmount = value.get_real();
if (dAmount <= 0.0 || dAmount > 21000000.0)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
CAmount nAmount = roundint64(dAmount * COIN);
if (!MoneyRange(nAmount))
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
return nAmount;
}
// This is MIDAS (Multi Interval Difficulty Adjustment System), a novel getnextwork algorithm. It responds quickly to
// huge changes in hashing power, is resistant to time warp attacks, and regulates the block rate to keep the block height
// close to the block height expected given the nominal block interval and the elapsed time. How close the
// correspondence between block height and wall clock time is, depends on how stable the hashing power has been. Maybe
// Bitcoin can wait 2 weeks between updates but no altcoin can.
// It is important that none of these intervals (5, 7, 9, 17) have any common divisor; eliminating the existence of
// harmonics is an important part of eliminating the effectiveness of timewarp attacks.
void avgRecentTimestamps(const CBlockIndex* pindexLast, int64_t *avgOf5, int64_t *avgOf7, int64_t *avgOf9, int64_t *avgOf17)
{
int blockoffset = 0;
int64_t oldblocktime;
int64_t blocktime;
*avgOf5 = *avgOf7 = *avgOf9 = *avgOf17 = 0;
if (pindexLast)
blocktime = pindexLast->GetBlockTime();
else blocktime = 0;
for (blockoffset = 0; blockoffset < 18; blockoffset++)
{
oldblocktime = blocktime;
if (pindexLast)
{
pindexLast = pindexLast->pprev;
blocktime = pindexLast->GetBlockTime();
}
else
{ // genesis block or previous
blocktime -= Params().TargetSpacing();
}
// for each block, add interval.
if (blockoffset < 5) *avgOf5 += (oldblocktime - blocktime);
if (blockoffset < 7) *avgOf7 += (oldblocktime - blocktime);
if (blockoffset < 9) *avgOf9 += (oldblocktime - blocktime);
*avgOf17 += (oldblocktime - blocktime);
}
// now we have the sums of the block intervals. Division gets us the averages.
*avgOf5 /= 5;
*avgOf7 /= 7;
*avgOf9 /= 9;
*avgOf17 /= 17;
}
unsigned int GetNextWorkRequired(const CBlockIndex *pindexLast, const CBlockHeader *pblock)
{
int64_t avgOf5;
int64_t avgOf9;
int64_t avgOf7;
int64_t avgOf17;
int64_t toofast;
int64_t tooslow;
int64_t difficultyfactor = 10000;
int64_t now;
int64_t BlockHeightTime;
int64_t nFastInterval = (Params().TargetSpacing() * 9 ) / 10; // seconds per block desired when far behind schedule
int64_t nSlowInterval = (Params().TargetSpacing() * 11) / 10; // seconds per block desired when far ahead of schedule
int64_t nIntervalDesired;
unsigned int nProofOfWorkLimit = Params().ProofOfWorkLimit().GetCompact();
if (pindexLast == NULL)
// Genesis Block
return nProofOfWorkLimit;
if (Params().AllowMinDifficultyBlocks())
{
// Special difficulty rule for testnet: If the new block's timestamp is more than 2* TargetSpacing then allow
// mining of a min-difficulty block.
if (pblock->nTime > pindexLast->nTime + Params().TargetSpacing() * 2)
return nProofOfWorkLimit;
else
{
// Return the last non-special-min-difficulty-rules-block
const CBlockIndex* pindex = pindexLast;
while (pindex->pprev && pindex->nHeight % nIntervalDesired != 0 && pindex->nBits == nProofOfWorkLimit)
pindex = pindex->pprev;
return pindex->nBits;
}
}
// Regulate block times so as to remain synchronized in the long run with the actual time. The first step is to
// calculate what interval we want to use as our regulatory goal. It depends on how far ahead of (or behind)
// schedule we are. If we're more than an adjustment period ahead or behind, we use the maximum (nSlowInterval) or minimum
// (nFastInterval) values; otherwise we calculate a weighted average somewhere in between them. The closer we are
// to being exactly on schedule the closer our selected interval will be to our nominal interval (TargetSpacing).
now = pindexLast->GetBlockTime();
BlockHeightTime = Params().GenesisBlock().nTime + pindexLast->nHeight * Params().TargetSpacing();
if (now < BlockHeightTime + Params().AdjustmentInterval() && now > BlockHeightTime )
// ahead of schedule by less than one interval.
nIntervalDesired = ((Params().AdjustmentInterval() - (now - BlockHeightTime)) * Params().TargetSpacing() +
(now - BlockHeightTime) * nFastInterval) / Params().AdjustmentInterval();
else if (now + Params().AdjustmentInterval() > BlockHeightTime && now < BlockHeightTime)
// behind schedule by less than one interval.
nIntervalDesired = ((Params().AdjustmentInterval() - (BlockHeightTime - now)) * Params().TargetSpacing() +
(BlockHeightTime - now) * nSlowInterval) / Params().AdjustmentInterval();
// ahead by more than one interval;
else if (now < BlockHeightTime) nIntervalDesired = nSlowInterval;
// behind by more than an interval.
else nIntervalDesired = nFastInterval;
// find out what average intervals over last 5, 7, 9, and 17 blocks have been.
avgRecentTimestamps(pindexLast, &avgOf5, &avgOf7, &avgOf9, &avgOf17);
// check for emergency adjustments. These are to bring the diff up or down FAST when a burst miner or multipool
// jumps on or off. Once they kick in they can adjust difficulty very rapidly, and they can kick in very rapidly
// after massive hash power jumps on or off.
// Important note: This is a self-damping adjustment because 8/5 and 5/8 are closer to 1 than 3/2 and 2/3. Do not
// screw with the constants in a way that breaks this relationship. Even though self-damping, it will usually
// overshoot slightly. But normal adjustment will handle damping without getting back to emergency.
toofast = (nIntervalDesired * 2) / 3;
tooslow = (nIntervalDesired * 3) / 2;
// both of these check the shortest interval to quickly stop when overshot. Otherwise first is longer and second shorter.
if (avgOf5 < toofast && avgOf9 < toofast && avgOf17 < toofast)
{ //emergency adjustment, slow down (longer intervals because shorter blocks)
LogPrintf("GetNextWorkRequired EMERGENCY RETARGET\n");
difficultyfactor *= 8;
difficultyfactor /= 5;
}
else if (avgOf5 > tooslow && avgOf7 > tooslow && avgOf9 > tooslow)
{ //emergency adjustment, speed up (shorter intervals because longer blocks)
LogPrintf("GetNextWorkRequired EMERGENCY RETARGET\n");
difficultyfactor *= 5;
difficultyfactor /= 8;
}
// If no emergency adjustment, check for normal adjustment.
else if (((avgOf5 > nIntervalDesired || avgOf7 > nIntervalDesired) && avgOf9 > nIntervalDesired && avgOf17 > nIntervalDesired) ||
((avgOf5 < nIntervalDesired || avgOf7 < nIntervalDesired) && avgOf9 < nIntervalDesired && avgOf17 < nIntervalDesired))
{ // At least 3 averages too high or at least 3 too low, including the two longest. This will be executed 3/16 of
// the time on the basis of random variation, even if the settings are perfect. It regulates one-sixth of the way
// to the calculated point.
LogPrintf("GetNextWorkRequired RETARGET\n");
difficultyfactor *= (6 * nIntervalDesired);
difficultyfactor /= (avgOf17 + 5 * nIntervalDesired));
}
// limit to doubling or halving. There are no conditions where this will make a difference unless there is an
// unsuspected bug in the above code.
if (difficultyfactor > 20000) difficultyfactor = 20000;
if (difficultyfactor < 5000) difficultyfactor = 5000;
uint256 bnNew;
uint256 bnOld;
bnOld.SetCompact(pindexLast->nBits);
if (difficultyfactor == 10000) // no adjustment.
return(bnOld.GetCompact());
bnNew = bnOld / difficultyfactor;
bnNew *= 10000;
if (bnNew > Params().ProofOfWorkLimit())
bnNew = Params().ProofOfWorkLimit();
LogPrintf("Actual time %d, Scheduled time for this block height = %d\n", now, BlockHeightTime );
LogPrintf("Nominal block interval = %d, regulating on interval %d to get back to schedule.\n",
Params().TargetSpacing(), nIntervalDesired );
LogPrintf("Intervals of last 5/7/9/17 blocks = %d / %d / %d.\n",
Params().TargetSpacing(), avgOf5, avgOf7, avgOf9, avgOf17);
LogPrintf("Difficulty Before Adjustment: %08x %s\n", pindexLast->nBits, bnOld.ToString());
LogPrintf("Difficulty After Adjustment: %08x %s\n", bnNew.GetCompact(), bnNew.ToString());
return bnNew.GetCompact();
}
cd
mkdir src
cd src
cp ~/Downloads/bitcoin-0.10.0\(1\).tar.gz .
tar xvf bitcoin-0.10.0\(1\).tar.gz
cp -r bitcoin-0.10.0 newcoin
su
echo 'deb-src ftp://ftp.us.debian.org/debian/ sid main contrib non-free' >> /etc/apt/sources.list
apt-get update
apt-get build-dep bitcoin
apt-get –install-recommends install libbitcoin-dev
exit
cd bitcoin-0.10.0
aclocal
automake --add-missing
./configure --with-incompatible-bdb
make
ls src/bitcoind
ls src/bitcoin-cli
ls src/qt/bitcoin-qt
cd ~/src/newcoin
find . -type f -print0 | xargs -0 sed -i 's/bitcoin/newcoin/g'
find . -type f -print0 | xargs -0 sed -i 's/Bitcoin/Newcoin/g'
find . -type f -print0 | xargs -0 sed -i 's/BitCoin/Newcoin/g'
find . -type f -print0 | xargs -0 sed -i 's/BITCOIN/NEWCOIN/g'
find . -type f -print0 | xargs -0 sed -i 's/BTC/NCN/g'
find . -type f -print0 | xargs -0 sed -i 's/btc/NCN/g'
find . -type f -print0 | xargs -0 sed -i 's/Btc/NCN/g'
find . -exec rename 's/bitcoin/newcoin/' {} ";"
find . -exec rename 's/btc/NCN/' {} ";"
grep -ir bitc
sed -i 's/bitcon/newcoin/' src/qt/locale/newcoin_da.ts
sed -i 's/bitcion/newcoin/' src/qt/locale/newcoin_ar.ts
sed -i 's/Bitconi/Newcoin/' src/qt/locale/newcoin_et.ts
find . -type f -print0 | xargs -0 sed -i '/opyright/ s/Newcoin/Bitcoin/' {} ";"
sed -i 's/newcoin/bitcoin/g' doc/release-notes/*
sed -i 's/Newcoin/Bitcoin/g' doc/release-notes/*
find . -type f -print0 | xargs -0 sed -i 's/8332/9443/' {} ";"
find . -type f -print0 | xargs -0 sed -i 's/8333/9444/' {} ";"
aclocal;automake --add-missing;./configure --with-incompatible-bdb;make
static Checkpoints::MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, uint256("0x001"));
date +%s
echo $RANDOM
openssl ecparam -genkey -name secp256k1 -out alertkey.pem
openssl ec -in alertkey.pem -text > alertkey.hex
openssl ecparam -genkey -name secp256k1 -out testnetalert.pem
openssl ec -in testnetalert.pem -text > testnetalert.hex
openssl ecparam -genkey -name secp256k1 -out genesiscoinbase.pem
openssl ec -in testnetalert.pem -text > genesiscoinbase.hex
cat alertkey.hex
cat testnetalert.hex
const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
cat genesiscoinbase.hex
txNew.vout[0].scriptPubKey = CScript() << ParseHex("...") << OP_CHECKSIG;
vFixedSeeds.clear();
vSeeds.clear();
genesis.nNonce = 414098458;
hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256("....."));
assert(genesis.hashMerkleRoot == uint256("....."));
hashGenesisBlock = uint256("0x01");
if (true && genesis.GetHash() != hashGenesisBlock)
{
Logprintf("recalculating params for mainnet.\n");
Logprintf("old mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
Logprintf("old mainnet genesis hash: %s\n", hashGenesisBlock.ToString().c_str());
// deliberately empty for loop finds nonce value.
for(genesis.nNonce == 0; genesis.GetHash() > bnProofOfWorkLimit; genesis.nNonce++){ }
Logprintf("new mainnet genesis merkle root: %s\n", genesis.hashMerkleRoot.ToString().c_str());
Logprintf("new mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
Logprintf("new mainnet genesis hash: %s\n", genesis.GetHash().ToString().c_str());
}
make
tail ~/.newcoin/debug.log
if (true && genesis.GetHash() != hashGenesisBlock)
rm -rf ~/.newcoin