1

During the multiple issues with Bitcoin this year with soft and hard forks, and Segwit, I have read as much as I can about how all these changes are "deployed", eg BIP9, BIP91, BIP148, BIP's 141-146.

However no matter how much I read I am still confused by it all and the terminology, such as "locking in", "signalling", "activation", "deployment".

I understand Segwit was implemented in v0.13.1 (and above) of Bitcoin Core which was released on 27/10/2016.

So all the Segwit changes have been in the Bitcoin Core software since that date ?

So when "activation" of Segwit occurred - did that mean a flag within the Bitcoin client, say "ACTIVATION_FLAG", became true and then the Segwit functionality thus started to run - because it is contained inside an "if" block :-

if (ACTIVATION_FLAG) {
    do Segwit stuff
}

However Segwit is a complex upgrade to Bitcoin so there must be many places where changes are made to Bitcoin for Segwit - so how many such "if" blocks are there ?

Can someone give me some links to where these "if" blocks are located in the Bitcoin source code?

Is this the mechanism for changes in general?

Can anyone explain this deployment/activation/signalling stuff in easy to understand terms - my eyes just glaze over every time I read about it.

I have read Andreas Antonopolous's book and understand the mechanism of Bitcoin and I can break down transactions and blocks into individual bytes and understand exactly what every byte means and how it fits into the described formats in the documentation. I can also understand Segwit and how it changes this mechanism.

When I can see every single bit and byte and what it does and the exact descriptions in detail I can piece together what's happening - but when I am faced merely with words and sentences I often just completely cannot understand what is going on. I have to figure it out from first principles or I am lost!

Thank you

1

However Segwit is a complex upgrade to Bitcoin so there must be many places where changes are made to Bitcoin for Segwit - so how many such "if" blocks are there ?

As of writing, there are 23 to 34 places where behavior changes based on whether segwit is active, depending on how you count. (e.g. if you pass a boolean to a function, and that function contains an if, and the function return value is passed to another if, is that 1 or 2 if statements?)

If you have a copy of the repository you can find them with the following commands:

  1. grep -RI "SEGWIT" * | grep THRESHOLD_ACTIVE
  2. grep -RI "fPreSegWit" *
  3. grep -RI "IsWitnessEnabled" *
  4. grep -RI "fWitnessEnabled" *
  5. grep -RI "witnessEnabled" *

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.