1

Segwit nodes know about the move of the witnesses to another part of the transaction block.

What would happen when they receive a transaction between two legacy nodes, knowing that they will build it following the "old" format, with a txid.

While segwit nodes are looking for a wtxid and witnesses (scriptsig and redeem script) being on another place.

Also, how would the miners consider this particular transaction, currently ?

2 Answers 2

5

Segwit did not change the rules for existing output types. The non-segwit standard output types P2PKH (Pay to Public Key Hash) and P2SH (Pay to Script Hash) still work exactly as they always have. Legacy nodes that don't understand segwit will only create addresses for non-segwit output types, and thus any transactions created by legacy nodes will never include any witness data.

Naturally, the more modern segwit nodes are backwards-compatible and can read non-segwit transactions just fine. Only transactions that spend segwit outputs include witness data.

4

Segwit nodes can recognise legacy transaction types and will handle them in the traditional way.

A legacy node would create a transaction that omits the optional segwit flag. When this transaction data is received by a segwit node, it can see that the segwit flag is not present and therefore knows to treat it using the old rules.

See What are the parts of a Bitcoin transaction in segwit format? for details of Segwit flag.

3
  • Ok so Segwit nodes are not capable of fighting against transaction malleability in this case, as they are still judging by the old rules ? Jun 24, 2022 at 18:50
  • 3
    Yes, only transactions that solely spend segwit outputs are covered by segwit's malleability protections. Inputs which spend legacy outputs do not have their behavior modified. Jun 25, 2022 at 3:22
  • But it seems like wtxids are also malleable before the transaction confirmation, according to this: bitcoin.stackexchange.com/questions/83677/…. Jun 27, 2022 at 2:44

Your Answer

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

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