I understand that P2SH addresses are used to allow "segwit unaware" wallets to create outputs spendable by segwit wallets (please correct me if I got something wrong). For new clients I think I got it: they will check that the script cointaned in the witness matches the script hash and execute it.

What I do not understand is how this output is spendable by a segwit aware client to the eyes of an old client. Because it clearly doesn't look like an anyone can spend. How does it work?


  • Why doesn't it look like an anyone can spend?
    – Osias Jota
    Commented Mar 15, 2018 at 22:21
  • 1
    My statement came from the belief that the p2sh address was generated by encoding hash160 <witness program hash> op_equal. I found this: github.com/bitcoinbook/bitcoinbook/issues/440 . This means that decoding it makes it an anyone can spend for old clients right?
    – domegabri
    Commented Mar 15, 2018 at 23:26
  • In addition to the previous comment: github.com/bitcoin/bips/blob/master/… . Segwit clients use a non-empty scriptSig when spending outputs received from old clients.
    – domegabri
    Commented Mar 16, 2018 at 17:39

1 Answer 1


There was a longer discussion thread in bitcointalk, I proide two references:



(Both threads are worthwhile to read in it's entirety). In short: before nodes talk to each other, they verify the capabilities. And a segwit node would reduce the information for a non-segwit node, so that he can understand the transaction details.

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.