Author

Topic: Segwit - P2SH nested in a P2WSH (Read 674 times)

sr. member
Activity: 384
Merit: 258
January 11, 2017, 08:49:28 PM
#3
Makes sense. Thanks !
staff
Activity: 3458
Merit: 6793
Just writing some code
January 09, 2017, 06:24:39 PM
#2
You have the wrong assumption here. The normal p2sh output is not some special output that triggers a special behavior. There is no special behavior. The way script validations works is the input script (i.e. scriptsig) and the output script (p2sh in this case) are concatenated (input then output) and evaluated command by command.

Your p2sh script as the script of a p2wsh script would thus hash whatever is on top of the stack and compare that to the hash you specify. It would not go looking elsewhere.
sr. member
Activity: 384
Merit: 258
January 09, 2017, 06:07:36 PM
#1
Hi there,

A (stupid) question about segwit : what happens if I use a P2SH script (HASH160 <20-byte-hash> EQUAL) as the witness script of a P2WSH scriptpubkey ? Is it processed as a simple validation of a hash or does it also trigger the evaluation of the P2SH script ?

Thanks in advance !
Jump to: