Learn how to signal a transaction utilizing BitcoinJ

0
41


Good day. You shoud have checklist of unspent outputs, for including them into inputs of your tx. Additionally it is best to generate personal keys and use particular privKey for each enter you could have.

Strive it out:

TransactionOutPoint outPoint = new TransactionOutPoint(params, utxo.getIndex(), utxo.getHash());
byte[] privKeyBytes = HEX.decode(privKeyAsHex);
ECKey ecKey = ECKey.fromPrivate(privKeyBytes);

transaction.addSignedInput(outPoint, utxo.getScript(), ecKey, Transaction.SigHash.ALL, true);



Supply hyperlink

Leave a reply