2

My question comes from not understanding how BIP 144 works? Regarding the BIP what I ask is, whether legacy nodes support the new parser, so that they treat Segwit tranasctions as valid? There it is stated:

Parsers supporting this BIP will be able to distinguish between the old serialization format (without the witness) and this one. The marker byte is set to zero so that this structure will never parse as a valid transaction in a parser that does not support this BIP. If parsing were to succeed, such a transaction would contain no inputs and a single output.

In relation to my main question, I could not understand how legacy nodes treat the witness fields of a segwit transaction?

2 Answers 2

5

Legacy nodes (that is, nodes before segwit) do not receive witness data.

Witness data is a separate data structure. It is only relayed if a node asks for it.

Older nodes don't know it exists, so they don't ask for it, and thus don't receive it.

Since segwit data does not contribute to the txid, old nodes can receive the regular block and still validate it as normal. They just interpret the segwit inputs as "anyone-can-spend" equivalents.

3
  • But a segwit transaction is sent with the new serialisation, how do they parse it? How do they "skip" the witness part ? I hope my question makes sense.
    – Ifo0
    Commented Aug 1, 2018 at 20:07
  • Yes, it makes sense, it may just be, that you think the client requests a tx... before doing so, there is a handshake, which tells about the capabilities of a node. Based on this the nodes get or do not get segwit data. See a discussion held here: bitcointalk.org/index.php?topic=1682183.msg21389041#msg21389041 Commented Aug 1, 2018 at 23:02
  • Perfect! Now it makes sense, I was looking exactly for this in-depth explanation we get in the forum! Thank you @pebwindkraft !
    – Ifo0
    Commented Aug 5, 2018 at 10:25
1

I actually got the full answer I was looking for in one of the comments above! Please refer to the forum discussion, the very last post on the page gives an in-depth explanation to the the answer in the comment. Sadly I can't upvote it yet, so I am posting this as a separate answer.

But a segwit transaction is sent with the new serialisation, how do they parse it? How do they "skip" the witness part ? I hope my question makes sense. – Ifo0 Aug 1 at 20:07

Yes, it makes sense, it may just be, that you think the client requests a tx... before doing so, there is a handshake, which tells about the capabilities of a node. Based on this the nodes get or do not get segwit data. See a discussion held here: bitcointalk.org/index.php?topic=1682183.msg21389041#msg21389041 – pebwindkraft

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.