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 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.