Scripts within Scripts

3

I have read the following:

https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki

https://darkwallet.is/bip16-17

However, I would like to know, can one specify a pay-to-script hash that includes another pay-to-script hash?

E.G.

Script for payer: DUP HASH160 EQUALVERIFY CHECKSIG

scriptA: DUP HASH160 EQUALVERIFY CHECKSIG

Can one include a CHECKSIG operation for another script inside a script referred to by a pay-to-script hash?

I'm probably not communicating this clearly, but I would basically like to know whether I can "daisy-chain" pay-to-script hashes together. Let me know if I should add more examples, or what changes I should make to this.

Nathan Basanese

Posted 2014-07-15T20:49:11.173

Reputation: 303

As @amaclin said - no, but perhaps if you say why'd you need that, someone might propose an alternate solution. E.g. it's possible to daisychain a set of transactions...kolinko 2014-07-17T20:58:10.020

Answers

3

No.

BIP-16 says that client executes script and if it matches P2SH - removes top item from the stack and executes it as script. That's all. No inner loops and checks.

amaclin

Posted 2014-07-15T20:49:11.173

Reputation: 5 763