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
in which project/library is this command defined?
this.app.env.bitcoin.script.compile– JBaczuk – 2019-05-28T21:43:46.013Sorry for late reply https://github.com/swaponline/swap.core/blob/9295ead434117c995c33976782aa2fac8361becf/src/swap.swaps/BtcSwap.js#L183
– Aqeel – 2019-05-30T07:48:27.500