Bitcoin Forum
June 26, 2024, 08:08:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Genesis Block, failed to find valid nonce, tried all possibilities in 4 bytes  (Read 2303 times)
spencerdupre (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
November 24, 2014, 04:32:29 PM
 #1

Has this ever happened to anyone else, or am I doing something wrong?  I have this details:

Timestamp: This is a test of the emergency broadcast system.
Unix time: 1416512906
Pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f

I'm using GenesisH0, https://github.com/lhartikk/GenesisH0

It's trying all the nonces up to 4294967295 (the max of a 4 byte unsigned integer) and doesn't find a single one that produces a valid hash.
Quantum_Mechanics
Member
**
Offline Offline

Activity: 97
Merit: 10


View Profile WWW
November 24, 2014, 06:29:06 PM
Last edit: September 15, 2015, 06:41:01 PM by Quantum_Mechanics
 #2

I tryed to recreate a genesis block using https://github.com/lhartikk/GenesisH0 and got errors too.

Use this method instead:

- Set your unix time in main.cpp for both testnet and main net
- Set your timestamp
- Set your nonces to 0 in main.cpp
- Compile

You'll get an error:

Quote
Assertion failed...

-Then look in your roaming folder for debug.log (in a folder named as your coin), You'll find 3 lines at the end for exemple:

Quote
b1753ec3845a48ddc4618bc595af6dc89dac328cd48f9f8db178df5dd3b302fc Block hashed using the non-existent Merkel, based on the pzTimestamp from main.cpp
0000000000000000000000000000000000000000000000000000000000000000 Genesis block, no good because all the nNonces are set to 0 in main.cpp
2fc1b7ef46270c053711fbae934cf7f83378efd4b3e158079451d9c6c90e4700 Valid Merkel Hash, generated using the epoch time in main.cpp

- Take the Merkle Hash you got and put it in main.cpp

- Find the line in main.cpp with
Quote
if (false  && (block.GetHash() != hashGenesisBlock)) {

- Set it to true to mine the genesis block.

- Compile (as it will mine the genesis it will take some time and maybe look frozen, don't worry).

- After, (I think you'll get "assertion failded" again) back in your debug.log. You'll find a fresh nonce (block.nNonce) and your genesis block hash (block.GetHash).

- Put them both in main.cpp, don't forget to set 0x in front of the genesis hashes (both main and testnet).

- Set the line
Quote
if (true  && (block.GetHash() != hashGenesisBlock)) {
back to false

- Check if any checkpoints are set in checkpoints.cpp and if there is, change it with your genesis hash.

- Compile again

You're good Wink

NAMOAV-HFVPJ6-FP32YP-2GCM64-WSRMKX-A5KKYW-WHPY
spencerdupre (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
November 24, 2014, 10:10:37 PM
 #3

Thanks, I'm working on an automatic coin generator, so I need to automate the genesis mining process.  Compiling the source code and running it more than once is much more difficult than using a separate tool like GenesisH0.  GenesisH0 has produced multiple valid genesis hashes in my tests.  My question is, Is it more likely that GenesisH0 has a weird bug in this case, or that this specific timestamp simply has no valid hash?  Also, I can't find the string
Code:
if (false  && (block.GetHash() != hashGenesisBlock)) {
in the file main.cpp https://github.com/bitcoin/bitcoin/blob/1ee685f984bdeaac7468019c6e2cd4b7d3496aef/src/main.cpp
Quantum_Mechanics
Member
**
Offline Offline

Activity: 97
Merit: 10


View Profile WWW
November 24, 2014, 10:51:07 PM
 #4

Oh Ok, I thought you simply wanted clone an altcoin.

You can find
Code:
if (false  && (block.GetHash() != hashGenesisBlock)) {
in coins using scrypt, X11, X13 etc..

Sorry, I don't know much about GenesisH0..

NAMOAV-HFVPJ6-FP32YP-2GCM64-WSRMKX-A5KKYW-WHPY
iGotSpots
Legendary
*
Offline Offline

Activity: 2548
Merit: 1054


CPU Web Mining 🕸️ on webmining.io


View Profile WWW
November 24, 2014, 11:00:01 PM
 #5

Thanks, I'm working on an automatic coin generator, so I need to automate the genesis mining process.  Compiling the source code and running it more than once is much more difficult than using a separate tool like GenesisH0.  GenesisH0 has produced multiple valid genesis hashes in my tests.  My question is, Is it more likely that GenesisH0 has a weird bug in this case, or that this specific timestamp simply has no valid hash?  Also, I can't find the string
Code:
if (false  && (block.GetHash() != hashGenesisBlock)) {
in the file main.cpp https://github.com/bitcoin/bitcoin/blob/1ee685f984bdeaac7468019c6e2cd4b7d3496aef/src/main.cpp

Without encouraging these types of sites directly, but still offering some assistance...

You are very much over complicating the problem here. I will give you one hint...take a look at all the tabs here and try to extrapolate what I am saying. It has nothing to do with genesis blocks, but just think about what the tabs at the top do after you get through the first screen that generates random shit

http://balls.blockexplorer.cc/paperwallet/

spencerdupre (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
November 25, 2014, 01:52:40 AM
 #6

@Quantum_Mechanics That's alright, thanks for offering help.

@iGotSpots  They generate addresses from a random seed?  Sorry, I don't follow.  The error I'm getting is:
struct.error: 'I' format requires 0 <= number <= 4294967295

Which means that it has tried all 4294967295 possible nonces and failed to find a valid hash. 
spencerdupre (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
November 25, 2014, 04:38:26 AM
 #7

I've confirmed that reducing the nTime by 1, to 1416512905, does successfully hash with nonce 1668111843.  It still seems that the original params are just an unlucky combination.
smeagol
Legendary
*
Offline Offline

Activity: 1008
Merit: 1005



View Profile
November 27, 2015, 09:40:03 PM
 #8

Interesting - it seems as if bitcoin removed the debugging feature for genesis blocks in 0.8.6.  How can I get a genesis hash with a more recent bitcoin release?
Hazard
Legendary
*
Offline Offline

Activity: 980
Merit: 1000



View Profile WWW
November 28, 2015, 05:59:47 PM
 #9

Interesting - it seems as if bitcoin removed the debugging feature for genesis blocks in 0.8.6.  How can I get a genesis hash with a more recent bitcoin release?
Pen and paper. Cheesy

smeagol
Legendary
*
Offline Offline

Activity: 1008
Merit: 1005



View Profile
November 29, 2015, 02:27:22 AM
 #10

Interesting - it seems as if bitcoin removed the debugging feature for genesis blocks in 0.8.6.  How can I get a genesis hash with a more recent bitcoin release?
Pen and paper. Cheesy

Thanks!  Took 357000 tries but finally found the nonce!
cinnamon_carter
Legendary
*
Offline Offline

Activity: 1148
Merit: 1018


It's about time -- All merrit accepted !!!


View Profile WWW
November 30, 2015, 04:15:17 AM
 #11

If you are having trouble with this hopefully you learned from the experiment.

I think the creation of the genesis block is about the easiest thing there is to running any coin  Cheesy

Check out my coin Photon
Merge Mine 5 other Blake 256 coins - 6x your hash power  https://www.blakecoin.org/

The obvious choice is not always the best choice.

LOOK DEEPER - Look into the Blake 256 Family -- CC
smeagol
Legendary
*
Offline Offline

Activity: 1008
Merit: 1005



View Profile
November 30, 2015, 11:41:14 PM
 #12

If you are having trouble with this hopefully you learned from the experiment.

I think the creation of the genesis block is about the easiest thing there is to running any coin  Cheesy

Yup, just had to figure out how to print the results to the console.
tearodactyl
Full Member
***
Offline Offline

Activity: 235
Merit: 100


View Profile
April 20, 2017, 08:50:32 PM
 #13

2014 methods no longer work.
2017 Bitcoin / Litecoin codebase update
http://practicecoin.com/index.php/2017/04/19/genesis-block/
wsxdrfv
Jr. Member
*
Offline Offline

Activity: 405
Merit: 5


View Profile WWW
February 20, 2018, 01:03:39 PM
 #14

2014 methods no longer work.
2017 Bitcoin / Litecoin codebase update
http://practicecoin.com/index.php/2017/04/19/genesis-block/

Are there no updated version?

I searched a lot, haven't find any.
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!