Pages:
Author

Topic: More Genesis Block Discussion - page 6. (Read 33932 times)

member
Activity: 84
Merit: 10
May 01, 2013, 09:19:33 PM
#7
here's another quote about the same deal for peoples reference:

Quote
I got most of the coding done, it's mainly the gensis block is where I'm stuck at, if anyone would like to help pm me,

... the guy working with beertokens and WEEDS set-up a tool where anybody can create a genesis block fairly easily ... multi-coin and etc

https://bitcointalksearch.org/topic/m.300830

https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt


for people who need advice compiling in windows...

install openssl-1.0.1d or e, then make sure the include dir is in the build script.
For windows build you see details here:
https://bitcointalksearch.org/topic/building-headless-bitcoin-and-bitcoin-qt-on-windows-149479

sr. member
Activity: 294
Merit: 250
May 01, 2013, 08:43:23 PM
#6
Do I just change the phrase and the software will hash it, or do I need to Pre hash the text?

Choose a date.
Change the text.
Start with nonce = 0.
Have it calculate the new block.
Get the block hash and make it the merkel root.

Done.
member
Activity: 70
Merit: 10
April 30, 2013, 09:08:24 PM
#5
Bump because I would like to know this as well.
member
Activity: 84
Merit: 10
April 29, 2013, 08:15:34 AM
#4
Quote
   1996    +  // Genesis block:
     1997    +  // block.nTime = 1366559428
     1998    +  // block.nNonce = 2085386442
     1999    +  // block.GetHash = 384b060671f4a93948e9c168216dadb0ca2fbc54aa11c86b0345b6af1c59b2f5
     2000    +  // CBlock(hash=384b060671f4a93948e9, PoW=00000951e146b0026411, ver=1,
     2001    +  //  hashPrevBlock=00000000000000000000, hashMerkleRoot=5a2e19825b,
     2002    +  //  nTime=1366559428, nBits=1e0ffff0, nNonce=2085386442, vtx=1)
     2003    +  // CTransaction(hash=5a2e19825b, ver=1, vin.size=1, vout.size=1, nLockTime=0)
     2004    +  // CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d010441746f646f3a207265706c616365207769746820736f6d657468696e672074686 17420656e7375726573206e6f207072656d696e696e6720746f6f6b20706c616365)
     2005    +  // CTxOut(error)
     2006    +  // vMerkleTree: 5a2e19825b

Let me rephrase the question, of the variables above, when creating an altcoin how many of them HAVE to be changes, if they need to be changes how many of them are arbrtitrary how many need to be generated by some other process.
member
Activity: 84
Merit: 10
April 28, 2013, 09:25:41 AM
#3
Do I just change the phrase and the software will hash it, or do I need to Pre hash the text?
sr. member
Activity: 574
Merit: 250
April 28, 2013, 03:10:22 AM
#2
The phrase is hashed into the block.

It is meant to be a proof of date.   It is mean to be some fact that would not have been known before the date in it, to prove the block was made on of after that date.
member
Activity: 84
Merit: 10
April 27, 2013, 04:03:21 PM
#1
This is a seperate discussion from the one about how to generate a Genesis Block here:

https://bitcointalksearch.org/topic/the-genesis-block-187888

This thread I want to past the parts of the code that cover the genesis block for discussion of what the code is doing so I can better understand the process. I am using the SmallChange source code who's commit really well shows you all the edits you need to make a new Altcoin, I've been able to make all the changes except the pieces below which I am still trying to understand before I do any major tinkering (all the following snippets are found in main.cpp)...

to see the small change source edits go here: https://github.com/bfroemel/smallchange/commit/947a0fafd8d033f6f0960c4ff0748f76a3d58326

Code:
1971 	1974 	         pchMessageStart[1] = 0xc1;
1972 1975         pchMessageStart[2] = 0xb7;
1973 1976         pchMessageStart[3] = 0xdc;
1974   -        hashGenesisBlock = uint256("0xf5ae71e26c74beacc88382716aced69cddf3dffff24f384e1808905e0188f68f");
   1977 +        hashGenesisBlock = uint256("0xa50faf35e1dddf4a076a907fbcef6d9d1595390cdb1c818a35dae53b67ad0aa8");

In this part I guess it just relates to generating the Gblock and puting in the number there.

Code:
1992 	  	-
1993   -        // Genesis Block:
1994   -        // CBlock(hash=12a765e31ffd4059bada, PoW=0000050c34a64b415b6b, ver=1, hashPrevBlock=00000000000000000000, hashMerkleRoot=97ddfbbae6, nTime=1317972665, nBits=1e0ffff0, nNonce=2084524493, vtx=1)
1995   -        //   CTransaction(hash=97ddfbbae6, ver=1, vin.size=1, vout.size=1, nLockTime=0)
1996   -        //     CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d0104404e592054696d65732030352f4f63742f32303131205374657665204a6f62732c204170706c65e280997320566973696f6e6172792c2044696573206174203536)
1997   -        //     CTxOut(nValue=50.00000000, scriptPubKey=040184710fa689ad5023690c80f3a4)
1998   -        //   vMerkleTree: 97ddfbbae6
1999   -
   1995 +    
   1996 +  // Genesis block:
   1997 +  // block.nTime = 1366559428
   1998 +  // block.nNonce = 2085386442
   1999 +  // block.GetHash = 384b060671f4a93948e9c168216dadb0ca2fbc54aa11c86b0345b6af1c59b2f5
   2000 +  // CBlock(hash=384b060671f4a93948e9, PoW=00000951e146b0026411, ver=1,
   2001 +  //  hashPrevBlock=00000000000000000000, hashMerkleRoot=5a2e19825b,
   2002 +  //  nTime=1366559428, nBits=1e0ffff0, nNonce=2085386442, vtx=1)
   2003 +  // CTransaction(hash=5a2e19825b, ver=1, vin.size=1, vout.size=1, nLockTime=0)
   2004 +  // CTxIn(COutPoint(0000000000, -1), coinbase 04ffff001d010441746f646f3a207265706c616365207769746820736f6d657468696e67207468617420656e7375726573206e6f207072656d696e696e6720746f6f6b20706c616365)
   2005 +  // CTxOut(error)
   2006 +  // vMerkleTree: 5a2e19825b
   2007 +        


I'm assuming there are all the variables, but what is what and would I get them all from running a genesis block generating script.

Code:
  // Genesis block
-        const char* pszTimestamp = "NY Times 05/Oct/2011 Steve Jobs, Apple’s Visionary, Dies at 56";
+        const char* pszTimestamp = "todo: replace with something that ensures no premining took place";
         CTransaction txNew;
         txNew.vin.resize(1);
         txNew.vout.resize(1);
         txNew.vin[0].scriptSig = CScript() << 486604799 << CBigNum(4) << vector((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));
-        txNew.vout[0].nValue = 50 * COIN;
-        txNew.vout[0].scriptPubKey = CScript() << ParseHex("040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9") << OP_CHECKSIG;
+        txNew.vout[0].nValue = 0;
+        txNew.vout[0].scriptPubKey = CScript() << 0x0 << OP_CHECKSIG; // a privkey for that 'vanity' pubkey would be interesting ;)

This is the part that confuses me the most, what does the sentence have to do to it. Is the genesis block a numerical version of that phrase and they need to match?

Code:
2013 	  	-        block.nTime    = 1317972665;
   2021 +        block.nTime    = 1366559428;
2014 2022         block.nBits    = 0x1e0ffff0;
2015   -        block.nNonce   = 2084524493;
   2023 +        block.nNonce   = 2085386442;
2016 2024
2017 2025         if (fTestNet)
2018 2026         {
2019   -            block.nTime    = 1317798646;
2020   -            block.nNonce   = 385270584;
   2027 +            block.nTime    = 1366559428;
   2028 +            block.nNonce   = 386402991;
2021 2029         }
2022 2030
2023 2031         //// debug print
2024 2032         printf("%s\n", block.GetHash().ToString().c_str());
2025 2033         printf("%s\n", hashGenesisBlock.ToString().c_str());
2026 2034         printf("%s\n", block.hashMerkleRoot.ToString().c_str());
2027   -        assert(block.hashMerkleRoot == uint256("0x97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9"));
   2035 +        assert(block.hashMerkleRoot == uint256("0x5a2e19825b4162f68602039040f1e05d9f924ff00a3aff7327ca6abd6f3279bc"));
2028 2036  


here seems to be just more plugging in of the variables from above
Pages:
Jump to: