Bitcoinj Multisignature Address

2

In multisignature address contract, how to set multisigoutput while sending bitcoin back to the client?

I tried this,

byte[] bytes = Utils.HEX.decode("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
spendTx.addInput(new TransactionInput(params, spendTx, bytes));
ByteArrayOutputStream scriptPubKeyBytes = new ByteArrayOutputStream();
Script.writeBytes(scriptPubKeyBytes, Utils.HEX.decode("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"));
scriptPubKeyBytes.write(ScriptOpCodes.OP_CHECKSIG);

spendTx.addOutput(new TransactionOutput(params, spendTx, value, scriptPubKeyBytes.toByteArray()));

spendTx.addOutput(value, clientKey);
TransactionOutput multisigOutput = spendTx.getOutput(0);

user27079

Posted 2015-07-01T07:07:59.123

Reputation: 73

No answers