Pages:
Author

Topic: How do you create an altcoin? - page 9. (Read 21879 times)

hero member
Activity: 631
Merit: 501
April 13, 2013, 09:20:17 PM
I read it and it makes sense... i am away from my dev environment atm.
I will try it though... 5th may be able to confirm as well...
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 09:11:26 PM
Maybe this could help shed some light on the situation.
Code:
https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt


Saved a sleepless night.
We thank you so much!!
Is this confirmed working?
hero member
Activity: 631
Merit: 501
April 13, 2013, 09:10:41 PM
Maybe this could help shed some light on the situation.
Code:
https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt


Saved a sleepless night.
We thank you so much!!
hero member
Activity: 860
Merit: 1004
BTC OG and designer of the BitcoinMarket.com logo
April 13, 2013, 09:06:00 PM
Maybe this could help shed some light on the situation.
Code:
https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 09:04:23 PM
Eagerly awaiting this new weekend-coin, buahaha. So glad to see you are getting support from others in creating this, please keep us updated, I will totally mine for fun when it launches.
Thanks for the interest, I hope we can get this running. A CPU mining only *coin is in the works (or what I hope will be a CPU mining only coin).
full member
Activity: 123
Merit: 100
April 13, 2013, 08:56:09 PM
Eagerly awaiting this new weekend-coin, buahaha. So glad to see you are getting support from others in creating this, please keep us updated, I will totally mine for fun when it launches.
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 08:55:06 PM
Hmmm......

Seems like you compile the client and run it.
Extract merkle root value.
run find genesis.
gather nonce info... locating the 'genesis' info.
reload back into code.
compile.
run with -server
mine away...

I will try going down this road and see where it goes.
will report back soon!!   Grin

Awesome, cant wait to hear results!
hero member
Activity: 631
Merit: 501
April 13, 2013, 08:52:54 PM
Hmmm......

Seems like you compile the client and run it.
Extract merkle root value.
run find genesis.
gather nonce info... locating the 'genesis' info.
reload back into code.
compile.
run with -server
mine away...

I will try going down this road and see where it goes.
will report back soon!!   Grin
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 13, 2013, 08:34:41 PM
However, this still doesn't explain line 7 of this file... so I am still missing something.
The hunt continues....
 
https://github.com/freicoin/freicoin/blob/master/share/find_genesis_block.py
Of course it does, that script basically takes an ALREADY CREATED merkle root, i.e the one you claim is output in debug.log.

Personally, I would like to write a C implementation where you provide some input and a genesis block will be created for you.

So if I understand correctly...  (more likely it's more complex... maybe not).

The genesis block is created.
Merkle root is created and output in the debug.log
find_genesis is run to get the Time Stamp, Nonce and Hash
This is all put back into the code (With Merkle value) and compiled
We are ready to mine.

I think it's basically this. This is the code from Bitcoin for creating the genesis block's coinbase.

Code:
        const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
        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("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;

Which outputs this merkle 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b(though not sure if it needs to big or little endian).

Then

Quote
#!/usr/bin/env python

from hashlib import sha256

VERSION    = '01000000'.decode('hex')
PREVBLOCK  = '00'.decode('hex') * 32
MERKLEROOT = '4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b'.decode('hex')
DIFFICULTY = 'ffff001d'.decode('hex')

def block_hash(unixtime, nonce):
  unixtime = hex(unixtime)[2:].decode('hex')[::-1]
  nonce    = hex(nonce)[2:]
  nonce    = '0'*(8-len(nonce)) + nonce
  nonce    = nonce.decode('hex')[::-1]
  return sha256(sha256(
      VERSION + PREVBLOCK + MERKLEROOT + unixtime + DIFFICULTY + nonce
    ).digest()).digest()

unixtime = 1356123600
nonce    = 0
print "Starting at unixtime %d and nonce %d" % (unixtime, nonce)
while block_hash(unixtime, nonce)[-4:] != '\x00\x00\x00\x00':
  nonce = nonce+1
  if nonce > 4294967295:
    unixtime, nonce = unixtime+1, 0
    print "Advancing to unixtime %d and nonce %d" % (unixtime, nonce)
  elif 0 == (nonce%100000):
    print nonce

print 'Found block!'
print "UNIXTIME: %d" % unixtime
print "NONCE:    %d" % nonce
print "HASH:     %s" % block_hash(unixtime, nonce)[::-1].encode('hex')
legendary
Activity: 938
Merit: 1000
What's a GPU?
April 13, 2013, 08:32:01 PM
Should I open an IRC channel on freenode for this subject/thread? I just crossed my mind as something that may be a good idea

/join #noobcoin Wink
hero member
Activity: 631
Merit: 501
April 13, 2013, 08:30:29 PM
However, this still doesn't explain line 7 of this file... so I am still missing something.
The hunt continues....
 
https://github.com/freicoin/freicoin/blob/master/share/find_genesis_block.py
Of course it does, that script basically takes an ALREADY CREATED merkle root, i.e the one you claim is output in debug.log.

Personally, I would like to write a C implementation where you provide some input and a genesis block will be created for you.

So if I understand correctly...  (more likely it's more complex... maybe not).

The genesis block is created.
Merkle root is created and output in the debug.log
find_genesis is run to get the Time Stamp, Nonce and Hash
This is all put back into the code (With Merkle value) and compiled
We are ready to mine.


legendary
Activity: 938
Merit: 1000
What's a GPU?
April 13, 2013, 08:26:51 PM
However, this still doesn't explain line 7 of this file... so I am still missing something.
The hunt continues....
 
https://github.com/freicoin/freicoin/blob/master/share/find_genesis_block.py
Of course it does, that script basically takes an ALREADY CREATED merkle root, i.e the one you claim is output in debug.log.

Personally, I would like to write a C implementation where you provide some input and a genesis block will be created for you.

So do it! Haha I remember a few years ago I tried to make GarrCoin Tongue (In a similar situation as you, OP, bored and in high school haha) I got stuck at the genesis block as well. I'll be following this!
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 08:25:37 PM
Should I open an IRC channel on freenode for this subject/thread? I just crossed my mind as something that may be a good idea
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 13, 2013, 08:12:55 PM
However, this still doesn't explain line 7 of this file... so I am still missing something.
The hunt continues....
 
https://github.com/freicoin/freicoin/blob/master/share/find_genesis_block.py
Of course it does, that script basically takes an ALREADY CREATED merkle root, i.e the one you claim is output in debug.log.

Personally, I would like to write a C implementation where you provide some input and a genesis block will be created for you.
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 08:10:58 PM
*eats popcorn* Im exited Cheesy
hero member
Activity: 631
Merit: 501
April 13, 2013, 08:06:18 PM
However, this still doesn't explain line 7 of this file... so I am still missing something.
The hunt continues....
 
https://github.com/freicoin/freicoin/blob/master/share/find_genesis_block.py
hero member
Activity: 631
Merit: 501
April 13, 2013, 08:02:06 PM
Line 2011 of main.cpp
block.hashMerkleRoot = block.BuildMerkleTree();

https://bitcointalksearch.org/topic/how-is-the-genesis-block-made-171355
Final post from maaku

Looks like the Merkle root is created and output in the debug.log file
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 13, 2013, 07:58:33 PM
Got some info from the devs of Bitcoin. Apparently this whole ordeal with Serialization is so that the data from this code

Code:
        const char* pszTimestamp = "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
        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("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;

is converted to bytes without caring what datatype they are from.
member
Activity: 98
Merit: 10
x1 7970 | Aprox. 587 kh/s
April 13, 2013, 07:34:35 PM
Not that it's completely relevant... but I have been in programming for over 20 years.
I'll keep researching and reading code... if nothing else, I will try to decode the process as much as I can and relay all the information back here.... unless a dev comes in and goes "Oh.. 1, 2, 3... Done!".
Awesome, thanks for your help so far. Would have never gotten to this point. Can't wait to see how this all turns out, amazing thread.
hero member
Activity: 631
Merit: 501
April 13, 2013, 07:33:26 PM
Not that it's completely relevant... but I have been in programming for over 20 years.
I'll keep researching and reading code... if nothing else, I will try to decode the process as much as I can and relay all the information back here.... unless a dev comes in and goes "Oh.. 1, 2, 3... Done!".
Pages:
Jump to: