Bitcoin Forum
June 21, 2024, 04:38:57 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 [3] 4 5 6 »  All
  Print  
Author Topic: More Genesis Block Discussion  (Read 33875 times)
awais3344
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250


View Profile
March 05, 2014, 05:44:19 PM
 #41

i ran my coin daemon on 2 pcs. And used daemon=1 and addnode=xx.xx.xx.xx (other pc's ip with running daemon)

they never connect.

Thanks it works Smiley need 2 PCs

didnt work for me   Undecided but have fun  Smiley

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
NEOSCOIN
  +POD Developers +Active Community - V2 Coming Soon! Live In-App Trading, Live Pool Stats - IRC - Arbitrush Anonymous System soon!! NEOSCOIN
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Lloydie
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
March 19, 2014, 02:06:05 PM
 #42

lightenup gave me this advice for generating a genesis block:

Awww, that is cheating!

You really have no business creating your own block chain if you don't understand the code well enough to figure out how to mine a new genesis block without somebody else's help.

Did anyone reinvent the WHEEL lately? 
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 06, 2014, 06:50:29 PM
Last edit: April 06, 2014, 08:23:56 PM by apple_talk
 #43

Using following code in main.cpp if using n-Scrypt (X11), it gives error when compiling. Any suggestion?

Code:
if (true && block.GetHash() != hashGenesisBlock)
            {
                  printf("Searching for genesis block...\n");
                  // This will figure out a valid hash and Nonce if you're
                  // creating a different genesis block:
                  uint256 hashTarget = CBigNum().SetCompact(block.nBits).getuint256();
                  uint256 thash;
                  char scratchpad[SCRYPT_SCRATCHPAD_SIZE];

                  loop
                  {
      #if defined(USE_SSE2)
                      // Detection would work, but in cases where we KNOW it always has SSE2,
                      // it is faster to use directly than to use a function pointer or conditional.
      #if defined(_M_X64) || defined(__x86_64__) || defined(_M_AMD64) || (defined(MAC_OSX) && defined(__i386__))
                      // Always SSE2: x86_64 or Intel MacOS X
                      scrypt_1024_1_1_256_sp_sse2(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
      #else
                      // Detect SSE2: 32bit x86 Linux or Windows
                      scrypt_1024_1_1_256_sp(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
      #endif
      #else
                      // Generic scrypt
                      scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
      #endif
                      if (thash <= hashTarget)
                          break;
                      if ((block.nNonce & 0xFFF) == 0)
                      {
                          printf("nonce %08X: hash = %s (target = %s)\n", block.nNonce, thash.ToString().c_str(), hashTarget.ToString().c_str());
                      }
                      ++block.nNonce;
                      if (block.nNonce == 0)
                      {
                          printf("NONCE WRAPPED, incrementing time\n");
                          ++block.nTime;
                      }
                  }

            printf("block.nTime = %u \n", block.nTime);
            printf("block.nNonce = %u \n", block.nNonce);
            printf("block.GetHash = %s\n", block.GetHash().ToString().c_str());


               }



Error when compiling:


main.cpp: In function ‘bool InitBlockIndex()’:
main.cpp:2996:35: error: ‘SCRYPT_SCRATCHPAD_SIZE’ was not declared in this scope
                   char scratchpad[SCRYPT_SCRATCHPAD_SIZE];
                                   ^
main.cpp:3012:91: error: ‘scratchpad’ was not declared in this scope
                       scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
                                                                                           ^
main.cpp:3012:101: error: ‘scrypt_1024_1_1_256_sp_generic’ was not declared in this scope
                       scrypt_1024_1_1_256_sp_generic(BEGIN(block.nVersion), BEGIN(thash), scratchpad);
                                                                                                     ^


|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
voileipa
Member
**
Offline Offline

Activity: 116
Merit: 10


View Profile
April 06, 2014, 08:30:35 PM
 #44

Here is a python script for generating the parameters needed for sha256/scrypt genesis block

https://github.com/lhartikk/GenesisH0
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 06, 2014, 08:39:08 PM
 #45

Using following code in main.cpp if using n-Scrypt (X11), it gives error when compiling. Any suggestion?

What value have you set for the scratchpad size?

“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 06, 2014, 11:24:45 PM
Last edit: April 07, 2014, 04:29:13 AM by apple_talk
 #46

Thanks Guys.

here is main.cpp file.


Code:
http://pastebin.com/TSemSTkK

The generating code works fine for scrypt, but for some reason not n-scrypt (X11). I have included complete code of main.cpp.


It seems the GenesisH0 needs update to support X11 scrypt.

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 03:13:45 PM
Last edit: April 07, 2014, 04:46:03 PM by apple_talk
 #47

Ran on Ubuntu 13.10 64bit

/GenesisH0# python genesis.py  -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -n 2083236893 -t 1231006505
Traceback (most recent call last):
  File "genesis.py", line 2, in <module>
    import scrypt
ImportError: No module named scrypt

what package I need using APT-GET, thanks


UPDATE:-
Never mind, needed python-pip installed first.
sudo apt-get install python-pip
pip install scrypt construct
and then genesis.py scrypt runs.




but, using these values in X11 scrypt does not work. fine for litecoin scrypt.
Wondering is it possible maybe get scrypt updated to support X11, which is becoming standard now.

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 07, 2014, 04:44:18 PM
 #48

Well you obviously need python implementation of scrypt...

Are trying to make your own coin? I strongly recommend that you learn a bit of c++
so that you know what kind of questions to ask when obstacles present themselves.

Especially since people might even invest their hard-earned money in the coin you have rolled.


“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 04:52:35 PM
 #49

Well you obviously need python implementation of scrypt...

Are trying to make your own coin? I strongly recommend that you learn a bit of c++
so that you know what kind of questions to ask when obstacles present themselves.

Especially since people might even invest their hard-earned money in the coin you have rolled.



yes I do have some experience & knowledge in C++, perl. I know code is looking for declared global or local variable SCRYPT_SCRATCHPAD_SIZE,

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 07, 2014, 05:50:52 PM
Last edit: April 07, 2014, 06:15:01 PM by YarkoL
 #50

Try including scrypt.h

edit. I took a look at Vertcoin source, and there you have

main.cpp 4745:
Code:
unsigned long int scrypt_scratpad_size_current_block = ((1 << (GetNfactor(pblock->nTime) + 1)) * 128 ) + 63;
            
char scratchpad[scrypt_scratpad_size_current_block];

Looks like n-scrypt resizes scratchpad per block.
Your best bet is to study Vertcoin or some other similar coin and make changes accordingly.

“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 06:37:24 PM
 #51

Try including scrypt.h

edit. I took a look at Vertcoin source, and there you have

main.cpp 4745:
Code:
unsigned long int scrypt_scratpad_size_current_block = ((1 << (GetNfactor(pblock->nTime) + 1)) * 128 ) + 63;
            
char scratchpad[scrypt_scratpad_size_current_block];

Looks like n-scrypt resizes scratchpad per block.
Your best bet is to study Vertcoin or some other similar coin and make changes accordingly.


use the above python script
got values & hash, updated main.cpp & checkpoint.cpp

removed genesis generating code from main.cpp
Compile the code.

Ran it...

root@PC:~/src# ./vicoind
vicoind: main.cpp:3050: bool InitBlockIndex(): Assertion `hash == hashGenesisBlock' failed.
Aborted (core dumped)


so I guess you are right, the scrypt does not support X11 scrypt coin. I looked at the code of the scrypt it is few lines, is it possible to modify it, maybe you can help out.


Code:
import hashlib, binascii, struct, array, os, time, sys, optparse
import scrypt

from construct import *


def main():
  options = get_args()

  # https://en.bitcoin.it/wiki/Difficulty
  bits = get_bits(options)
  target = get_target(options)

  input_script = create_input_script(options.timestamp)
  output_script = create_output_script(options.pubkey)

  # hash merkle root is the double sha256 hash of the transaction(s)
  tx = create_transaction(input_script, output_script)
  hash_merkle_root = hashlib.sha256(hashlib.sha256(tx).digest()).digest()
  print_block_info(options, hash_merkle_root)

  block_header = create_block_header(hash_merkle_root, options.time, bits, options.nonce)
  genesis_hash, nonce = generate_hash(block_header, options.scrypt, options.nonce, target)
  announce_found_genesis(genesis_hash, nonce)


def get_args():
  parser = optparse.OptionParser()
  parser.add_option("-t", "--time", dest="time", default=int(time.time()),
                   type="int", help="the (unix) time when the genesisblock is created")
  parser.add_option("-z", "--timestamp", dest="timestamp", default="The Times 03/Jan/2009 Chancellor on brink of second bailout for banks",
                   type="string", help="the pszTimestamp found in the coinbase of the genesisblock")
  parser.add_option("-n", "--nonce", dest="nonce", default=0,
                   type="int", help="the first value of the nonce that will be incremented when searching the genesis hash")
  parser.add_option("-s", "--scrypt", dest="scrypt", default=False, action="store_true",
                    help="calculate genesis block using scrypt")
  parser.add_option("-p", "--pubkey", dest="pubkey", default="04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f",
                   type="string", help="the pubkey found in the output script")

  (options, args) = parser.parse_args()
  return options


def get_bits(options):
  return 0x1e0ffff0 if options.scrypt else 0x1d00ffff


def get_target(options):
  return 0x0ffff0 * 2**(8*(0x1e - 3)) if options.scrypt else 0x00ffff * 2**(8*(0x1d - 3))


def create_input_script(psz_timestamp):
  script_prefix = '04ffff001d0104' + chr(len(psz_timestamp)).encode('hex')
  return (script_prefix + psz_timestamp.encode('hex')).decode('hex')


def create_output_script(pubkey):
  script_len = '41'
  OP_CHECKSIG = 'ac'
  return (script_len + pubkey + OP_CHECKSIG).decode('hex')


def create_transaction(input_script, output_script):
  transaction = Struct("transaction",
    Bytes("version", 4),
    Byte("num_inputs"),
    StaticField("prev_output", 32),
    UBInt32('prev_out_idx'),
    Byte('input_script_len'),
    Bytes('input_script', len(input_script)),
    UBInt32('sequence'),
    Byte('num_outputs'),
    Bytes('out_value', 8),
    Byte('output_script_len'),
    Bytes('output_script', 0x43),
    UBInt32('locktime'))

  tx = transaction.parse('\x00'*(127 + len(input_script)))
  tx.version = struct.pack('<I', 1)
  tx.num_inputs = 1
  tx.prev_output = struct.pack('<qqqq', 0,0,0,0)
  tx.prev_out_idx = 0xFFFFFFFF
  tx.input_script_len = len(input_script)
  tx.input_script = input_script
  tx.sequence = 0xFFFFFFFF
  tx.num_outputs = 1
  tx.out_value = struct.pack('<q' ,0x000000012a05f200) #50 coins
  tx.output_script_len = 0x43
  tx.output_script = output_script
  tx.locktime = 0
  return transaction.build(tx)


def create_block_header(hash_merkle_root, time, bits, nonce):
  block_header = Struct("block_header",
    Bytes("version",4),
    Bytes("hash_prev_block", 32),
    Bytes("hash_merkle_root", 32),
    Bytes("time", 4),
    Bytes("bits", 4),
    Bytes("nonce", 4))

  genesisblock = block_header.parse('\x00'*80)
  genesisblock.version = struct.pack('<I', 1)
  genesisblock.hash_prev_block = struct.pack('<qqqq', 0,0,0,0)
  genesisblock.hash_merkle_root = hash_merkle_root
  genesisblock.time = struct.pack('<I', time)
  genesisblock.bits = struct.pack('<I', bits)
  genesisblock.nonce = struct.pack('<I', nonce)
  return block_header.build(genesisblock)


# https://en.bitcoin.it/wiki/Block_hashing_algorithm
def generate_hash(data_block, is_scrypt, start_nonce, target):
  print 'Searching for genesis hash..'
  nonce = start_nonce
  last_updated = time.time()
  difficulty = float(0xFFFF) * 2**208 / target
  update_interval = int(1000000 * difficulty)

  while True:
    sha256_hash, header_hash = generate_hashes_from_block(data_block, is_scrypt)
    last_updated = calculate_hashrate(nonce, update_interval, difficulty, last_updated)
    if is_genesis_hash(header_hash, target):
      return (sha256_hash, nonce)
    else:
     nonce = nonce + 1
     data_block = data_block[0:len(data_block) - 4] + struct.pack('<I', nonce)


def generate_hashes_from_block(data_block, is_scrypt):
  sha256_hash = hashlib.sha256(hashlib.sha256(data_block).digest()).digest()[::-1]
  header_hash = scrypt.hash(data_block,data_block,1024,1,1,32)[::-1] if is_scrypt else sha256_hash
  return sha256_hash, header_hash


def is_genesis_hash(header_hash, target):
  return int(header_hash.encode('hex_codec'), 16) < target


def calculate_hashrate(nonce, update_interval, difficulty, last_updated):
  if nonce % update_interval == update_interval - 1:
    now = time.time()
    hashrate = round(update_interval/(now - last_updated))
    generation_time = round(difficulty * pow(2, 32) / hashrate / 3600, 1)
    sys.stdout.write("\r%s hash/s, estimate: %s h"%(str(hashrate), str(generation_time)))
    sys.stdout.flush()
    return now
  else:
    return last_updated


def print_block_info(options, hash_merkle_root):
  print "algorithm: " + ("scrypt" if options.scrypt else "sha256")
  print "merkle hash: " + hash_merkle_root[::-1].encode('hex_codec')
  print "pszTimestamp: " + options.timestamp
  print "pubkey: " + options.pubkey
  print "time: " + str(options.time)
  print "bits: " + str(hex(get_bits(options)))


def announce_found_genesis(genesis_hash, nonce):
  print "genesis hash found!"
  print "nonce: " + str(nonce)
  print "genesis hash: " + genesis_hash.encode('hex_codec')


# GOGOGO!
main()

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 06:39:00 PM
 #52

Now something like
https://github.com/evan82/darkcoin/blob/master/src/main.cpp
uses same setup as well?


|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 07, 2014, 06:50:53 PM
 #53

It looks like InitBlockIndex() is the same in Darkcoin, so you could try running that and see if you get the values.

“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 08:08:49 PM
 #54

It looks like InitBlockIndex() is the same in Darkcoin, so you could try running that and see if you get the values.

Got same result using darkcoin as well.

their must be easy way to change the python scrypt in include X11 info as well.

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 07, 2014, 10:00:38 PM
 #55

Ok. I had yet another look at this. I thought scrypt-n is one of the  x11 algorithms but apparently it is not.. Embarrassed
Because of that, the genesis block-producing code that you posted will not work, as it is for "standard scrypt".

When I have little more time I'll see if I can figure it out.

But first let's be clear; are you after X11 or scrypt-N coin?





“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 07, 2014, 10:10:25 PM
 #56

Ok. I had yet another look at this. I thought scrypt-n is one of the  x11 algorithms but apparently it is not.. Embarrassed
Because of that, the genesis block-producing code that you posted will not work, as it is for "standard scrypt".

When I have little more time I'll see if I can figure it out.

But first let's be clear; are you after X11 or scrypt-N coin?


X11

btw, I used the existing code... copied working X11 hash/root/timestamp from another coin, it worked like charm. So it is just the matter of script generating that needs update.


|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 08, 2014, 12:00:46 AM
Last edit: April 08, 2014, 05:49:06 PM by YarkoL
 #57

Edit:

For the sake of possible future readers, rather than handing them a fully baked solution, I will just give outline of the procedure. Y'know. give man a fish / teach him to fish and so on...

So if you want to get a new genesis block out of Darkcoin that uses X11 or any coin at all that has been forked out of Bitcoin, here are the steps, most of which can be inferred from this thread also.

You need to change szTimesstamp and nTime. Zero the nonce, merkle root and old genesis block. Compile and run. Boom. Here's the genesis block and merkle root as they come from the printf statements in InitBlockIndex().

If you substitute them into the code, your gen block will be accepted, but you will run into this:
Code:
hash doesn't match nBits.

The code snippet (see above) that begins with
Code:
if (true && block.GetHash() != hashGenesisBlock)

will help you to find the right hash for nBits. You just need to read what it does. It is looping an algorithm and increasing nonce to find a block that satisfies the difficulty. I.e. it is mining. Is it running scrypt? No it isn't, this is X11, so get rid of all that. Where do you get the X11 algorithm? Take a look at the error message you're getting.

That should be enough...


“God does not play dice"
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 08, 2014, 02:24:19 AM
 #58

appreciate  Smiley
I will try it shortly.

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
apple_talk
Sr. Member
****
Offline Offline

Activity: 473
Merit: 250


"Proof-of-Asset Protocol"


View Profile
April 08, 2014, 07:04:41 AM
 #59

did not work, it failed.

|
 
 
50
|
 




                       ▄
           ▄▄▄▄▄▄███████
▄▄▄▄█████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████

█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
█████████  █████████████
▀▀▀▀█████  █████████████
           ▀▀▀▀▀▀███████
                       ▀
|
 
 
$1,5 M
|



        ▄▄▄█████████▄▄▄
      ▄█████▀▀███▀▀█████▄
    ▄███▀     ███     ▀███▄
   ████       ███       ████
  ███▀                   ▀███
 ███▀                     ▀███
▄██▀       █████████       ▀██▄
███                         ███
███        █████████        ███
███                         ███
▀██▄       █████████       ▄██▀
 ███▄                     ▄███
  ███▄                   ▄███
   ████       ███       ████
    ▀███▄     ███     ▄███▀
      ▀█████▄▄███▄▄█████▀
        ▀▀▀█████████▀▀▀
|
 
|
 
<>
<>
<>
<>
 
GITHUB
TWITTER
YOUTUBE
FACEBOOK
YarkoL
Legendary
*
Offline Offline

Activity: 996
Merit: 1013


View Profile
April 08, 2014, 07:07:18 AM
 #60

did not work, it failed.

Worked for me. What error report?

“God does not play dice"
Pages: « 1 2 [3] 4 5 6 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!