Bitcoin Forum
June 21, 2024, 12:56:47 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: forking a coin : how to merkle root  (Read 1117 times)
iwantodev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 13, 2015, 08:29:44 PM
 #1

I'm trying to fork a X13 coin I like but i'm missing something important.

I've made all the code changes I want, then I use GenesisH0 to get merkle root, genesis hash, pszTimestamp and nTime, add those to the code and compile.

But when I launch the windows-qt i get an Assertion failed ! error.
Expression: block.hashMerkleRoot == uint256("0xb8a521c89f62af3b80565dec94e5a08eafe4e15b372550f77409832a20cf4398")

Please someone help me out. What am i doing wrong ? Why is it not accepting my merkle root?
rnicoll
Full Member
***
Offline Offline

Activity: 199
Merit: 110


View Profile
September 15, 2015, 02:57:39 PM
 #2

I'm trying to fork a X13 coin I like but i'm missing something important.

I've made all the code changes I want, then I use GenesisH0 to get merkle root, genesis hash, pszTimestamp and nTime, add those to the code and compile.

But when I launch the windows-qt i get an Assertion failed ! error.
Expression: block.hashMerkleRoot == uint256("0xb8a521c89f62af3b80565dec94e5a08eafe4e15b372550f77409832a20cf4398")

Please someone help me out. What am i doing wrong ? Why is it not accepting my merkle root?

One thought is to check whether the transaction and merkle hashes are calculated using SHA256 (as Scrypt coins do, because it's a lot cheaper than using Scrypt) or X13. I think X11 coins often use X11 for identity hashes as well as PoW, might be the same for X13.

Dogecoin Core developer, ex-researcher, trader.

Unless stated otherwise, opinions are my own and do not necessarily reflect that of other Dogecoin developers.
Quantum_Mechanics
Member
**
Offline Offline

Activity: 97
Merit: 10


View Profile WWW
September 15, 2015, 06:26:58 PM
 #3

I'm trying to fork a X13 coin I like but i'm missing something important.

I've made all the code changes I want, then I use GenesisH0 to get merkle root, genesis hash, pszTimestamp and nTime, add those to the code and compile.

But when I launch the windows-qt i get an Assertion failed ! error.
Expression: block.hashMerkleRoot == uint256("0xb8a521c89f62af3b80565dec94e5a08eafe4e15b372550f77409832a20cf4398")

Please someone help me out. What am i doing wrong ? Why is it not accepting my merkle root?

I made a post some times ago that might help you: https://bitcointalk.org/index.php?topic=871564.msg9642571#msg9642571

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

Activity: 4
Merit: 0


View Profile
September 22, 2015, 12:18:25 AM
 #4

Thanks for the information guys.
I followed your guide Quantum_Mechanics and it helped alot. I finally was able to succefully clone a X11 coin yet I had to remove some code to get the qt to launch.

I changed the merkle root, genesis block, time and nNonce. Compiled, but was still getting an assertion error.

assertion failed: block.checkblock()

Out of desperation I removing this code from main.cpp
Code:
assert(block.CheckBlock());

Now the qt is running ok but i'm wondering if the part of code I removed will cause some kind of problem.

Can someone tell me what this code is for ? What does it do ?
Code:
assert(block.CheckBlock());

Thanks
achow101
Staff
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
September 22, 2015, 01:18:25 AM
 #5

Thanks for the information guys.
I followed your guide Quantum_Mechanics and it helped alot. I finally was able to succefully clone a X11 coin yet I had to remove some code to get the qt to launch.

I changed the merkle root, genesis block, time and nNonce. Compiled, but was still getting an assertion error.

assertion failed: block.checkblock()

Out of desperation I removing this code from main.cpp
Code:
assert(block.CheckBlock());

Now the qt is running ok but i'm wondering if the part of code I removed will cause some kind of problem.

Can someone tell me what this code is for ? What does it do ?
Code:
assert(block.CheckBlock());

Thanks
That is a check to make sure that the blocks are good and valid. Normally, if checkblock fails, then this line will cause the program to shutdown and warn the user that something has gone wrong. You have basically removed a security and safety feature.

iwantodev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 22, 2015, 01:23:01 AM
 #6

Oh shoot! I can't do that.
iwantodev (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
September 22, 2015, 01:48:06 AM
 #7

This is the error I see when looking into debug.log

Code:
ERROR: CTransaction::CheckTransaction() : coinbase script size is invalid
ERROR: CheckBlock() : CheckTransaction failed

What? But I want the script size to be valid!
Quantum_Mechanics
Member
**
Offline Offline

Activity: 97
Merit: 10


View Profile WWW
September 23, 2015, 08:15:57 PM
 #8

Maybe you should start again without removing any part of the code.
Which coin are you cloning ?

Found the guide I used when I started in crypto:
https://bitcointalk.org/index.php?topic=217636.0
It's for scrypt coin but cloning is similar though, maybe it can help

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

Activity: 996
Merit: 1013


View Profile
September 25, 2015, 07:21:00 AM
 #9

This is the error I see when looking into debug.log

Code:
ERROR: CTransaction::CheckTransaction() : coinbase script size is invalid
ERROR: CheckBlock() : CheckTransaction failed

What? But I want the script size to be valid!

Can you post the actual genesis block here (from gettransaction)?

The error implies that there is something wrong with the length of the signature. Either it does not
exist, or it is too long. The latter might be the case if your choice of the human-readable timestamp
string is something huge

“God does not play dice"
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!