Author

Topic: What does "pchMessage" mean ? (Read 646 times)

newbie
Activity: 51
Merit: 0
February 02, 2014, 05:30:55 PM
#7
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.
sr. member
Activity: 507
Merit: 252
February 02, 2014, 04:39:03 PM
#6
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.
member
Activity: 66
Merit: 10
February 02, 2014, 03:51:21 PM
#5
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.
sr. member
Activity: 507
Merit: 252
February 02, 2014, 03:38:04 PM
#4

Thanks for your clarification jimhsu. I didn't know it's affecting to download different blockchain.
sr. member
Activity: 364
Merit: 264
February 02, 2014, 03:26:41 PM
#3
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/
sr. member
Activity: 507
Merit: 252
February 02, 2014, 03:17:13 PM
#2
Nobody knows this ?
sr. member
Activity: 507
Merit: 252
February 02, 2014, 12:45:46 PM
#1
Hey

I'm trying to understand some things about coins.

When I look to Saturncoin's main.cpp, pchMessage value is :a
Code:
unsigned char pchMessageStart[4] = { 0xfa, 0xb4, 0xad, 0xcb };
In Litecoin's main.cpp :
Code:
unsigned char pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb };
In Dogecoin :
Code:
unsigned char pchMessageStart[4] = { 0xc0, 0xc0, 0xc0, 0xc0 };

So what is this and how it works ?

Jump to: