Author

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

member
Activity: 294
Merit: 11
Lord Shiva
February 24, 2018, 05: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: 3458
Merit: 6793
Just writing some code
February 23, 2018, 11:17:40 PM
#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: 294
Merit: 11
Lord Shiva
February 23, 2018, 02: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, 02: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: 294
Merit: 11
Lord Shiva
February 23, 2018, 01: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: 3458
Merit: 6793
Just writing some code
February 22, 2018, 11:12:54 AM
#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: 294
Merit: 11
Lord Shiva
February 22, 2018, 07: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: