<blockquote>
  <p>If so, what prevents it to be spent by anyone not the intended recipient?</p>
</blockquote>

<p>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.</p>

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

CC BY-SA 4.0
2018-05-14T04:53:47.573Z
2018-05-14T04:53:47.573Z
Paul
<blockquote>
  <p>So output is changed to anyone-can-spend output? If so, what prevents it to be spent by anyone not the intended recipient?</p>
</blockquote>

<p>No, it is not changed.</p>

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

<p>To <strong>new nodes</strong>, 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.</p>

CC BY-SA 4.0
2018-05-13T20:51:28.887Z
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?
sinoTrinity
CC BY-SA 4.0
2018-05-13T20:52:29.820Z
The definition of an anyone-can-spend output is that it does not require any signature or witness to spend.
Pieter Wuille
CC BY-SA 4.0
2018-05-13T21:09:26.847Z
What happens to a transaction with only-someone-can-spend output, sent from a SegWit node to a non-SegWit node?
sinoTrinity
CC BY-SA 4.0
2018-05-13T21:10:05.343Z
The non-SegWit node will interpret it as an anyone can spend, and accept it.
Pieter Wuille
CC BY-SA 4.0
2018-05-13T21:45:58.477Z
To unlock `scriptPubKey` from UTXO output, the old non-SegWit node still needs `scriptSig`/witness in input, which is missing. So it will treat the transaction invalid, no? Is `scriptPubKey` removed from output, like witness from input?
sinoTrinity
CC BY-SA 4.0
2018-05-13T22:22:23.833Z
No, re-read my answer: nothing is changed. The `scriptPubKey` for SegWit outputs can be spent using an empty `scriptSig`. However, for SegWit nodes it requires a valid witness to spend. Old nodes don't know or care about witnesses, and will accept with no signature at all (that's the definition of anyone-can-spend).
Pieter Wuille
CC BY-SA 4.0
2018-05-13T22:26:59.580Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/77436/discussion-between-sinotrinity-and-pieter-wuille).
sinoTrinity
CC BY-SA 4.0
2018-05-13T22:38:01.370Z
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).
Pieter Wuille
CC BY-SA 4.0
2018-05-13T20:34:50.630Z
2018-05-13T21:00:35.183Z
2018-05-13T21:00:35.183Z
Pieter Wuille
<p>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?</p>

<p>So <a href="https://bitcoin.stackexchange.com/questions/53000/how-does-a-non-upgraded-node-read-a-segwit-transaction">output</a> is changed to anyone-can-spend output? If so, what prevents it to be spent by anyone not the intended recipient?</p>

<segregated-witness><anyone-can-spend>
Why non-SegWit nodes do not reject SegWit block since there is no witness?
sinoTrinity
# Why non-SegWit nodes do not reject SegWit block since there is no witness?

(Asked by: username_0 on 2018-05-13)

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](https://bitcoin.stackexchange.com/questions/53000/how-does-a-non-upgraded-node-read-a-segwit-transaction) is changed to anyone-can-spend output? If so, what prevents it to be spent by anyone not the intended recipient?

**Tags:** segregated-witness, anyone-can-spend


---

## 2 answers

### Answer by username_2 on 2018-05-13. Score: 5 | Accepted answer

> 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.

> **Comments:**
> **username_0**: 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?  
> **username_2**: The definition of an anyone-can-spend output is that it does not require any signature or witness to spend.  
> **username_0**: What happens to a transaction with only-someone-can-spend output, sent from a SegWit node to a non-SegWit node?  
> **username_2**: The non-SegWit node will interpret it as an anyone can spend, and accept it.  
> **username_0**: To unlock `scriptPubKey` from UTXO output, the old non-SegWit node still needs `scriptSig`/witness in input, which is missing. So it will treat the transaction invalid, no? Is `scriptPubKey` removed from output, like witness from input?  
> **username_2**: No, re-read my answer: nothing is changed. The `scriptPubKey` for SegWit outputs can be spent using an empty `scriptSig`. However, for SegWit nodes it requires a valid witness to spend. Old nodes don't know or care about witnesses, and will accept with no signature at all (that's the definition of anyone-can-spend).  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/77436/discussion-between-username_0-and-username_2-username_2).  
> **username_2**: 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).  

---

### Answer by username_1 on 2018-05-14. Score: 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.


---

