Pass Multiple addresses in redeem p2sh script

0

I have the following code

const script = this.app.env.bitcoin.script.compile([
hashOpcode,
Buffer.from(secretHash, "hex"),
this.app.env.bitcoin.opcodes.OP_EQUALVERIFY,

 Buffer.from(recipientPublicKey, "hex"),
 this.app.env.bitcoin.opcodes.OP_EQUAL,
 this.app.env.bitcoin.opcodes.OP_IF,

 Buffer.from(recipientPublicKey, "hex"),
 this.app.env.bitcoin.opcodes.OP_CHECKSIG
])

But i want to pass one more address. Like this:

Buffer.from(recipientPublicKey, "hex"),
this.app.env.bitcoin.opcodes.OP_EQUAL,
this.app.env.bitcoin.opcodes.OP_AND,
Buffer.from(exchangePublicKey, "hex"),
this.app.env.bitcoin.opcodes.OP_EQUAL,
this.app.env.bitcoin.opcodes.OP_IF,

Buffer.from(recipientPublicKey, "hex"),
this.app.env.bitcoin.opcodes.OP_CHECKMULTISIG,
this.app.env.bitcoin.opcodes.OP_AND,
Buffer.from(exchangePublicKey, "hex"),
this.app.env.bitcoin.opcodes.OP_CHECKMULTISIG,
this.app.env.bitcoin.opcodes.OP_ELSE,

But its not working and i am getting only on 1 in txout. whats the correct way to add another multisig address ?

Just want to follow this pattern:

redeem script: 2 <pubKey1> <pubKey2> <pubKey3> 3 OP_CHECKMULTISIG 

Aqeel

Posted 2019-05-27T09:10:27.807

Reputation: 3

in which project/library is this command defined? this.app.env.bitcoin.script.compileJBaczuk 2019-05-28T21:43:46.013

No answers