2

SegWit is meant to be backward-compatible. When a SigWit block is relayed to a non-SegWit node, the witness part is stripped. If this is the case, wouldn't it be invalid since the non-SegWit node sees no witness/signature in transaction input?

So output is changed to anyone-can-spend output? If so, what prevents it to be spent by anyone not the intended recipient?

2 Answers 2

5

So output is changed to anyone-can-spend output? If so, what prevents it to be spent by anyone not the intended recipient?

No, it is not changed.

A SegWit output is anyone-can-spend from the view of old nodes. This means that to them, it can be legally spent without signature.

To new nodes, it has a different meaning, and requires a (valid) witness to be spent. Nodes that care about SegWit outputs enforce this rule, and will not accept a blockchain that spends without such a witness.

8
  • If this is the case, wouldn't a transaction be regarded invalid since the non-SegWit node sees no witness/signature in transaction input to unlock the fund? May 13, 2018 at 20:51
  • The definition of an anyone-can-spend output is that it does not require any signature or witness to spend. May 13, 2018 at 20:52
  • What happens to a transaction with only-someone-can-spend output, sent from a SegWit node to a non-SegWit node? May 13, 2018 at 21:09
  • The non-SegWit node will interpret it as an anyone can spend, and accept it. May 13, 2018 at 21:10
  • 1
    I can't respond in chat right now, but your last message is spot on: SegWit outputs use a special lock script that can be spent without unlock script (to old nodes). May 13, 2018 at 22:38
1

If so, what prevents it to be spent by anyone not the intended recipient?

Most nodes (the ones who have updated) would reject this transaction. Every miner would reject this transaction out of fear that their block (and block reward) would be rejected.

You can fork off into a chain that spends those outputs though, if you wanted.

0

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.