Bitcoin Forum
October 23, 2018, 03:20:40 PM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to change the merkel hash of some cryptocoin?  (Read 972 times)
Solidsmart
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
November 10, 2014, 09:54:58 AM
 #1

for example litecoindark, i wanna fork it
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
1540308040
Hero Member
*
Offline Offline

Posts: 1540308040

View Profile Personal Message (Offline)

Ignore
1540308040
Reply with quote  #2

1540308040
Report to moderator
e1ghtSpace
Legendary
*
Offline Offline

Activity: 1428
Merit: 1000


Crypto since 2014


View Profile WWW
November 10, 2014, 11:08:02 AM
 #2

for example litecoindark, i wanna fork it
Follow this guide: http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guide

You'll also need the genesis mining code. I found it with a quick google.

Here it is:
Quote
    // If genesis block hash does not match, then generate new genesis hash.
    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;

        while(true)
        {
            thash = scrypt_blockhash(BEGIN(block.nVersion));
            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());
Source: http://stackoverflow.com/questions/20772606/how-to-create-a-genesis-block-of-my-altercoin
(I added "true &&" to the beginning so it is easier to follow the tutorial.

Place it above block.print() in main.cpp.
Solidsmart
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
November 10, 2014, 11:15:39 AM
 #3

for example litecoindark, i wanna fork it
Follow this guide: http://devtome.com/doku.php?id=scrypt_altcoin_cloning_guide

You'll also need the genesis mining code. I found it with a quick google.

Here it is:
Quote
    // If genesis block hash does not match, then generate new genesis hash.
    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;

        while(true)
        {
            thash = scrypt_blockhash(BEGIN(block.nVersion));
            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());
Source: http://stackoverflow.com/questions/20772606/how-to-create-a-genesis-block-of-my-altercoin
(I added "true &&" to the beginning so it is easier to follow the tutorial.

Place it above block.print() in main.cpp.
tnx to u
Solidsmart
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
November 10, 2014, 11:22:55 AM
 #4

i did that all yesterday too,but when i come to testnet, to create merkel ,it just does nothing,i can wait hours
e1ghtSpace
Legendary
*
Offline Offline

Activity: 1428
Merit: 1000


Crypto since 2014


View Profile WWW
November 10, 2014, 08:09:15 PM
 #5

i did that all yesterday too,but when i come to testnet, to create merkel ,it just does nothing,i can wait hours

I normally just skip the test net and go straight to the main net. It is less confusing that way.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!