What is the new way to pre-mine the genesis block in litecoin?

by Sophie259   Last Updated June 13, 2019 00:27 AM

I found so many articles and solution to a problem that existed well ago, which was about mining the genesis block and identifying the nonce for Litecoin.

Example of solutions

Stackexchange solution

Bitcointalk solution

The problem with those solution is that they were specific for windows and FOR a specific litecoin version but I guess Linux developer could find the alternative to %appdata% and identify their debug.log file in ~.litecoin/debug

Since those questions, a lot has changed. Litecoin doesn't use main.cpp and the "LoadBlockIndex()" doesn't even exist anymore. We could argue that we can still use that solution if we go back in time, download an old version of Litecoin and do the process according to the steps. It's very time consuming!

I looked for all type of solutions to generate the genesis block where I would input the timestamp message (different from litecoin's), the nTime to get the nNonce in a debug file. For example, this solution argues that it will create the genesis block for all consensus algorithms, including Scrypt (the one used by Litecoin), yet all of them solutions work except the one for Scrypt (lol).

This one is much better, however it works only if you input the correct nonce which we can't know unless we access the debug log in the first two links of this post.

It seems that main.cpp was split into net_processing.cpp and validation.cpp (source), yet the information we are looking for (pszTimestamp, nTime, nNonce) can be found in /src/chainparams.cpp

I have honestly tried to "bruteforce" chainparams.cpp with different values for genesis.nTime, genesis.nNonce and by changing the pszTimestamp as well, the last parameter being available in CreateGenesisBlock function (link).

So far I did no progress and everytime I compile and get this error:

[email protected]:/home/user/Desktop/litecoin/src# ./litecoind litecoind: chainparams.cpp:123: CMainParams::CMainParams(): Assertion `consensus.hashGenesisBlock == uint256S("0x12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2")' failed. Aborted (core dumped) [email protected]:/home/user/Desktop/litecoin/src#

I go and check my supposed to find "debug.log" on Linux at ~ / .litecoin / where I don't find it.

[email protected]:/home/user/Desktop/litecoin/src# cd ~ [email protected]:~# ls -a . .bash_history .cache .dbus .litecoin .profile .. .bashrc .config .gvfs .local .synaptic

[email protected]:~# cd .litecoin/

[email protected]:~/.litecoin# ls -a . ..

Is it possible to have a solution, with proper explanation, step by step to the question asked here which would be applicable to the newest Litecoin code?



Related Questions


Updated February 12, 2018 19:27 PM

Updated June 18, 2018 14:27 PM

Updated March 09, 2018 13:27 PM

Updated October 03, 2018 17:27 PM

Updated December 10, 2017 14:27 PM