1

From my understanding, segwit blocks send transaction information without the witness, which includes the signature. I thought nodes needed the signature to verify the transactions?

1 Answer 1

3

This is not correct.

All segwit blocks do differently is having the witnesses (which include the signature) in a separately-hashed area. They're still an integral part of the block, and full validation cannot proceed without the witness data. Removing or altering the witness data will invalidate a block.

What this does permit is stripping the witness data without affecting validity according to pre-segwit validation rules. This is the basis for using segwit as a blocksize increase (the old 1 MB block size limit thus only applies to the non-witness part, as old nodes don't see the witness data). However, nodes that implement the segwit rules need the full witness.

6
  • Can you please explain what a non-segwit node sees when a segwit node notifies it of a new block, vs what a non-segwit node would see from a non-segwit node? I think I'm having trouble understanding how the witness data can be stripped and still be seen as valid
    – Jefumaru
    Jan 14, 2021 at 21:31
  • 1
    There is no difference. Non-witness nodes are never sent the witness data. Witness nodes strip it before sending it to them. Jan 14, 2021 at 21:40
  • So they strip the portion of their block that contains witness data, correct? If this is true, then the non-witness node doesn't receive the witness data (which includes the signature). If so, how do non-witness nodes verify the block?
    – Jefumaru
    Jan 15, 2021 at 17:36
  • 1
    Yes. To them, the block is valid without witnesses. Every script that requires a witness looks like one that is always true to non-witness nodes. Jan 15, 2021 at 17:49
  • 1
    They validate everything they care about. That does not include the validation of witness spends, as those look like anyonecanspend to them. But non-segwit scripts are still validated, PoW is validated, inflation is checked, UTXOs must exist, ... Jan 15, 2021 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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