Considering you were one of the first posters in here complaining about how you couldn't work out how to download the blockchain I doubt you could do much of anything.
Litecoin:
unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
{
// Testnet has min-difficulty blocks
// after nTargetSpacing*2 time between blocks:
if (fTestNet && nTime > nTargetSpacing*2)
return bnProofOfWorkLimit.GetCompact();
CBigNum bnResult;
bnResult.SetCompact(nBase);
while (nTime > 0 && bnResult < bnProofOfWorkLimit)
{
// Maximum 400% adjustment...
bnResult *= 4;
// ... in best-case exactly 4-times-normal target time
nTime -= nTargetTimespan*4;
}
if (bnResult > bnProofOfWorkLimit)
bnResult = bnProofOfWorkLimit;
return bnResult.GetCompact();
}
unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlock *pblock)
{
unsigned int nProofOfWorkLimit = bnProofOfWorkLimit.GetCompact();
// Genesis block
if (pindexLast == NULL)
return nProofOfWorkLimit;
// Only change once per interval
if ((pindexLast->nHeight+1) % nInterval != 0)
{
// Special difficulty rule for testnet:
if (fTestNet)
{
// If the new block's timestamp is more than 2* 10 minutes
// then allow mining of a min-difficulty block.
if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2)
return nProofOfWorkLimit;
else
{
// Return the last non-special-min-difficulty-rules-block
const CBlockIndex* pindex = pindexLast;
while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit)
pindex = pindex->pprev;
return pindex->nBits;
}
}
return pindexLast->nBits;
}
Mincoin:
unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
{
// Testnet has min-difficulty blocks
// after nTargetSpacing*2 time between blocks:
if (fTestNet && nTime > nTargetSpacing*2)
return bnProofOfWorkLimit.GetCompact();
CBigNum bnResult;
bnResult.SetCompact(nBase);
while (nTime > 0 && bnResult < bnProofOfWorkLimit)
{
// Maximum 400% adjustment...
bnResult *= 4;
// ... in best-case exactly 4-times-normal target time
nTime -= nTargetTimespan*4;
}
if (bnResult > bnProofOfWorkLimit)
bnResult = bnProofOfWorkLimit;
return bnResult.GetCompact();
}
unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlock *pblock)
{
unsigned int nProofOfWorkLimit = bnProofOfWorkLimit.GetCompact();
// Genesis block
if (pindexLast == NULL)
return nProofOfWorkLimit;
// Only change once per interval
if ((pindexLast->nHeight+1) % nInterval != 0)
{
// Special difficulty rule for testnet:
if (fTestNet)
{
// If the new block's timestamp is more than 2* 10 minutes
// then allow mining of a min-difficulty block.
if (pblock->nTime > pindexLast->nTime + nTargetSpacing*2)
return nProofOfWorkLimit;
else
{
// Return the last non-special-min-difficulty-rules-block
const CBlockIndex* pindex = pindexLast;
while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit)
pindex = pindex->pprev;
return pindex->nBits;
}
}
return pindexLast->nBits;
}
--> Chain is still vulnerable to coaster exploit, in fact even more so because of the faster retarget
Code for exploit (Unix, Python 2.7)
from subprocess import Popen, PIPE, STDOUT
import time
import json
import math
class Min(object):
def __init__(self, blocks):
self.blocks = blocks
scan_time = 5
while(True):
### Get the initial block number from mincoind, store in output_j['blocks']
cmd = './mincoind getinfo' ### Command for dumping info from mincoind in json format; we use this lots
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) ### Execute command
output = p.stdout.read() ### Read the stdout that output gives us
output_j = json.loads(output) ### Convert from json to python values; we call block number using the class given above
print("Current block is " + str(output_j['blocks']))
if (math.floor(output_j['blocks']/720) % 2 == 0): ### During exploit period of 720 blocks, mine MinCoin
print ("Exploit block, mining mincoin...")
mincoin_config = open('minmine.conf','r')
card_config = open('cardconf.conf','r')
configuration = open('litecoin.conf', 'w')
### Copy the reaper configuration to litecoin.conf for mincoin
for line in mincoin_config:
configuration.write(line)
for line in card_config:
configuration.write(line)
mincoin_config.close()
card_config.close()
configuration.close()
miner_cmd = './reaper' ### Command for your miner to mine NVC
miner_thread = Popen(miner_cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
### Loop below checks to see when block we're on, terminates miner if we are on an off number block
while(True):
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read()
output_j = json.loads(output)
if not(math.floor(output_j['blocks']/720) % 2 == 0):
miner_thread.terminate()
break
else:
print("Block height still in exploit period, mining mincoin.")
time.sleep(scan_time)
else: ### Block is not exploit, mine something else
print ("Non-exploit block, mining another chain...")
mincoin_config = open('elsemine.conf','r')
card_config = open('cardconf.conf','r')
configuration = open('litecoin.conf', 'w')
### Copy the reaper configuration to litecoin.conf for other chain
for line in mincoin_config:
configuration.write(line)
for line in card_config:
configuration.write(line)
mincoin_config.close()
card_config.close()
configuration.close()
miner_cmd = './reaper' ### Command for your miner to mine something else; the same here because we use reaper
miner_thread = Popen(miner_cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
### Loop below checks to see when block we're on, terminates miner if we are on an exploit number block
while(True):
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read()
output_j = json.loads(output)
if (math.floor(output_j['blocks']/720) % 2 == 0):
miner_thread.terminate()
break
else:
print("Block not exploit height, mining another chain.")
time.sleep(scan_time)
Code for exploit (Windows, Python 2.7)
from subprocess import Popen, PIPE, STDOUT
import time
import json
import math
class Min(object):
def __init__(self, blocks):
self.blocks = blocks
scan_time = 5
while(True):
### Get the initial block number from mincoind, store in output_j['blocks']
cmd = 'mincoind.exe getinfo' ### Command for dumping info from mincoind in json format; we use this lots
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) ### Execute command
output = p.stdout.read() ### Read the stdout that output gives us
output_j = json.loads(output) ### Convert from json to python values; we call block number using the class given above
print("Current block is " + str(output_j['blocks']))
if (math.floor(output_j['blocks']/720) % 2 == 0): ### During exploit period of 720 blocks, mine MinCoin
print ("Exploit block, mining mincoin...")
mincoin_config = open('minmine.conf','r')
card_config = open('cardconf.conf','r')
configuration = open('litecoin.conf', 'w')
### Copy the reaper configuration to litecoin.conf for mincoin
for line in mincoin_config:
configuration.write(line)
for line in card_config:
configuration.write(line)
mincoin_config.close()
card_config.close()
configuration.close()
miner_cmd = 'reaper.exe' ### Command for your miner to mine NVC
miner_thread = Popen(miner_cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
### Loop below checks to see when block we're on, terminates miner if we are on an off number block
while(True):
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read()
output_j = json.loads(output)
if not(math.floor(output_j['blocks']/720) % 2 == 0):
miner_thread.terminate()
break
else:
print("Block height still in exploit period, mining mincoin.")
time.sleep(scan_time)
else: ### Block is not exploit, mine something else
print ("Non-exploit block, mining another chain...")
mincoin_config = open('elsemine.conf','r')
card_config = open('cardconf.conf','r')
configuration = open('litecoin.conf', 'w')
### Copy the reaper configuration to litecoin.conf for other chain
for line in mincoin_config:
configuration.write(line)
for line in card_config:
configuration.write(line)
mincoin_config.close()
card_config.close()
configuration.close()
miner_cmd = 'reaper.exe' ### Command for your miner to mine something else; the same here because we use reaper
miner_thread = Popen(miner_cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
### Loop below checks to see when block we're on, terminates miner if we are on an exploit number block
while(True):
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
output = p.stdout.read()
output_j = json.loads(output)
if (math.floor(output_j['blocks']/720) % 2 == 0):
miner_thread.terminate()
break
else:
print("Block not exploit height, mining another chain.")
time.sleep(scan_time)
Requires the following files to exist:
mincoind executable that is running prior to executing the python code above
reaper executable
reaper.conf (configured as per normal)
Requires reaper and mincoind to be in the same directory
minmine.conf:
host minecoinhost
port ????
user username
pass password
elsemine.conf (mines litecoin or whatever with reaper)
host litecoinhost
port ????
user username
pass password
cardconf.conf (configuration for scrypt):
protocol litecoin
worksize 256
vectors 1
aggression 20
threads_per_gpu 1
sharethreads 32
lookup_gap 2
gpu_thread_concurrency ####