cudjex (OP)
|
|
February 02, 2014, 05:45:46 PM |
|
Hey I'm trying to understand some things about coins. When I look to Saturncoin's main.cpp, pchMessage value is :a unsigned char pchMessageStart[4] = { 0xfa, 0xb4, 0xad, 0xcb }; In Litecoin's main.cpp : unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb }; In Dogecoin : unsigned char pchMessageStart[4] = { 0xc0, 0xc0, 0xc0, 0xc0 };
So what is this and how it works ?
|
|
|
|
|
|
|
|
|
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
cudjex (OP)
|
|
February 02, 2014, 08:17:13 PM |
|
Nobody knows this ?
|
|
|
|
jimhsu
|
|
February 02, 2014, 08:26:41 PM |
|
These are the magic bytes. They serve a variety of purposes, including indicating the proper network, and serving as a start for explorers such as Abe to parse. Some altcoins that don't change the magic bytes (n00b launches) have problems such as trying to download the litecoin blockchain on start. As for what "pchMessage" means exactly, I don't know. For more info, see http://james.lab6.com/2012/01/12/bitcoin-285-bytes-that-changed-the-world/
|
Dans les champs de l'observation le hasard ne favorise que les esprits préparé
|
|
|
cudjex (OP)
|
|
February 02, 2014, 08:38:04 PM |
|
Thanks for your clarification jimhsu. I didn't know it's affecting to download different blockchain.
|
|
|
|
Sharrow
Member
Offline
Activity: 66
Merit: 10
|
|
February 02, 2014, 08:51:21 PM Last edit: February 02, 2014, 09:17:58 PM by Sharrow |
|
These entries should always be altered when creating an altcoin otherwise there could be cross-talk with other currencies using similar code. It's best to do it right at the very start, before the genesis hash is created and the coin is released otherwise you will have a major fork to deal with.
One way to do it is to go to an online hexadecimal converter and use it to produce random characters for the end of your pchMessage 0x?? strings. Think up four random numbers between 0 and 255 and convert them from decimal to hex i.e. 177 = b1, 223 = df.
Change the last part of your 0x?? strings to your new values and make sure it's done for the main network in main.cpp.
|
|
|
|
cudjex (OP)
|
|
February 02, 2014, 09:39:03 PM |
|
These entries should always be altered when creating an altcoin otherwise there could be cross-talk with other currencies using similar code. It's best to do it right at the very start, before the genesis hash is created and the coin is released otherwise you will have a major fork to deal with.
One way to do it is to go to an online hexadecimal converter and use it to produce random characters for the end of your pchMessage 0x?? strings. Think up four random numbers between 0 and 255 and convert them from decimal to hex i.e. 177 = b1, 223 = df.
Change the last part of your 0x?? strings to your new values and make sure it's done for the main network in main.cpp.
Thanks for your great answer.
|
|
|
|
nibyokwy
Newbie
Offline
Activity: 51
Merit: 0
|
|
February 02, 2014, 10:30:55 PM |
|
As for what "pchMessage" means exactly, I don't know.
the 'pch' is hungarian notation and usually means 'pointer to character'. it's a way of encoding the type of the variable in the variable name to make readers of the code understand the intended types easier.
|
|
|
|
|