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);

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.