Bitcoin Forum
October 19, 2017, 08:46:48 PM *
News: Latest stable version of Bitcoin Core: 0.15.0.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 »  All
  Print  
Author Topic: How do you create an altcoin?  (Read 21173 times)
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 12:34:35 AM
 #121

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.

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
1508446008
Hero Member
*
Offline Offline

Posts: 1508446008

View Profile Personal Message (Offline)

Ignore
1508446008
Reply with quote  #2

1508446008
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1554

Reverse engineer from time to time


View Profile
April 14, 2013, 12:58:33 AM
 #122

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<unsigned char>((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.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 01:02:06 AM
 #123

Line 2011 of main.cpp
block.hashMerkleRoot = block.BuildMerkleTree();

https://bitcointalk.org/index.php?topic=171355.0
Final post from maaku

Looks like the Merkle root is created and output in the debug.log file

I will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 01:06:18 AM
 #124

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

I will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 01:10:58 AM
 #125

*eats popcorn* Im exited Cheesy

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1554

Reverse engineer from time to time


View Profile
April 14, 2013, 01:12:55 AM
 #126

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.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 01:25:37 AM
 #127

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

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
Garr255
Legendary
*
Offline Offline

Activity: 952


What's a GPU?


View Profile
April 14, 2013, 01:26:51 AM
 #128

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!

“First they ignore you, then they laugh at you, then they fight you, then you win.”  -- Mahatma Gandhi

Average time between signing on to bitcointalk: Two weeks. Please don't expect responses any faster than that!
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 01:30:29 AM
 #129

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 will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
Garr255
Legendary
*
Offline Offline

Activity: 952


What's a GPU?


View Profile
April 14, 2013, 01:32:01 AM
 #130

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

“First they ignore you, then they laugh at you, then they fight you, then you win.”  -- Mahatma Gandhi

Average time between signing on to bitcointalk: Two weeks. Please don't expect responses any faster than that!
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1554

Reverse engineer from time to time


View Profile
April 14, 2013, 01:34:41 AM
 #131

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<unsigned char>((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')

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 01:52:54 AM
 #132

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

I will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 01:55:06 AM
 #133

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!

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
bob777fred
Full Member
***
Offline Offline

Activity: 123


View Profile
April 14, 2013, 01:56:09 AM
 #134

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.
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 02:04:23 AM
 #135

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).

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
idev
Hero Member
*****
Offline Offline

Activity: 855


View Profile
April 14, 2013, 02:06:00 AM
 #136

Maybe this could help shed some light on the situation.
Code:
https://github.com/sacarlson/MultiCoin/blob/master/create_new_genisis_block.txt
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 02:10:41 AM
 #137

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!!

I will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 02:11:26 AM
 #138

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?

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
wmikrut
Hero Member
*****
Offline Offline

Activity: 610



View Profile WWW
April 14, 2013, 02:20:17 AM
 #139

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...

I will NEVER ask for any kind of funds up front in a buy/sale of anything on bitcointalk.

BM-2cTFihJKmSwusMAoYuUHPvpx56Jozv64KK
pixel
Member
**
Offline Offline

Activity: 98


x1 7970 | Aprox. 587 kh/s


View Profile
April 14, 2013, 02:25:20 AM
 #140

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...
5th got it working via his/her own method, told us in IRC

Currently Mining: Litecoin, Xencoin, and Worldcoin (Just because its fun!, don't yell at me ;_;)
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!