Bitcoin Forum
May 27, 2024, 06:57:34 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bounty $100. Help me with creating the Genesis Block in Blackcoin & mining  (Read 143 times)
marquis-ogre (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
June 08, 2018, 05:33:13 PM
Last edit: June 18, 2018, 08:58:05 AM by marquis-ogre
 #1

Hi

I am finding difficult to mine the genesis block in Blackcoin, whereas i can create the genesis block in litecoin clone. This is for educational purpose as i am 17 years old and learning how the crypto coins are made. I have learned the Litecoin 0.08 version and succeded.

Code:
if (false && 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());

I have used to this code to generate the genesis block but getting an error like Setcompact is not declared.

I even tried the GenesisH0 and created a scrypt base genesis when i have changed the values to the newly created genesis and compiled and while running the coind or coin-qt getting an assertion error.

Please someone guide me to create the correct genesis block for blackcoin clone

Thanks

Marquis Ogre
Pages: [1]
  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!