Author

Topic: pchMessageStart - what is for? (in BC 0.8) (Read 319 times)

member
Activity: 252
Merit: 11
Lord Shiva
February 24, 2018, 06:41:40 AM
#7
But why? Because they have different genesis blocks and seed-nodes, they will not be confused in any way.
To make sure that there's no crosstalk or confusion in the first place as figuring out that they have different genesis blocks still costs bandwidth and computing power.

And are these values ​​arbitrary? Or are there any rules for choosing them?
They're arbitrary. The common recommendation for new altcoins is to just randomly generate new magic bytes.

Thank you!

It is clear now.
staff
Activity: 3374
Merit: 6530
Just writing some code
February 24, 2018, 12:17:40 AM
#6
Is it different from, for example, litecoin?
Yes.

But why? Because they have different genesis blocks and seed-nodes, they will not be confused in any way.
To make sure that there's no crosstalk or confusion in the first place as figuring out that they have different genesis blocks still costs bandwidth and computing power.

And are these values ​​arbitrary? Or are there any rules for choosing them?
They're arbitrary. The common recommendation for new altcoins is to just randomly generate new magic bytes.
member
Activity: 252
Merit: 11
Lord Shiva
February 23, 2018, 03:28:45 PM
#5

Apparently Litecoin and Viacoin (the only 2 bitcoin code forks I checked) have the same magic bytes:


why not  Smiley
sr. member
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
February 23, 2018, 03:31:03 AM
#4
Is it different from, for example, litecoin? But why? Because they have different genesis blocks and seed-nodes, they will not be confused in any way.
Apparently Litecoin and Viacoin (the only 2 bitcoin code forks I checked) have the same magic bytes:
Code:
pchMessageStart[0] = 0xfb;
        pchMessageStart[1] = 0xc0;
        pchMessageStart[2] = 0xb6;
        pchMessageStart[3] = 0xdb;
https://github.com/litecoin-project/litecoin/blob/master/src/chainparams.cpp
Quote
And are these values ​​arbitrary? Or are there any rules for choosing them?
The same file linked above has this comment:
Code:
The message start string is designed to be unlikely to occur in normal data.
         * The characters are rarely used upper ASCII, not valid as UTF-8, and produce
         * a large 32-bit integer with any alignment.
member
Activity: 252
Merit: 11
Lord Shiva
February 23, 2018, 02:38:11 AM
#3
Those are the magic bytes. They prepend every single network message so that the message can be identified as being a Bitcoin message.

Is it different from, for example, litecoin? But why? Because they have different genesis blocks and seed-nodes, they will not be confused in any way.

And are these values ​​arbitrary? Or are there any rules for choosing them?
staff
Activity: 3374
Merit: 6530
Just writing some code
February 22, 2018, 12:12:54 PM
#2
Those are the magic bytes. They prepend every single network message so that the message can be identified as being a Bitcoin message.
member
Activity: 252
Merit: 11
Lord Shiva
February 22, 2018, 08:56:55 AM
#1
Hello!

Tell me please, what is for:

Code:
pchMessageStart[0] = 0xfc;

and

Code:
pchMessageStart[4] = { 0xfb, 0xc0, 0xb6, 0xdb };

What does it do?

Thank you!

Jump to: