I'm trying this example to generate the hexadecimal encoded version of an unsigned transaction to push it to another device where it will be signed. In spite of being able to print the hexadecimal encoded version of the SIGNED transaction I am unable to get the hexadecimal encoded version of the raw transaction I want to send over the wire. Is there any method that converts the unsigned data into hex to be sent?
var tx = new bitcoin.TransactionBuilder();
tx.addInput("d18e7106e5492baf8f3929d2d573d27d89277f3825d3836aa86ea1d843b5158b", 1);
tx.addOutput("12idKQBikRgRuZEbtxXQ4WFYB7Wa3hZzhT", 149000);
console.log("Hexadecimal encoded UNSIGNED transaction");
// The following code just works, but i want to tell another device to sign the transaction
//console.log(tx);
// var key = bitcoin.ECPair.fromWIF("L1Kzcyy88LyckShYdvoLFg1FYpB5ce1JmTYtieHrhkN65GhVoq73");
//tx.sign(0, key);
//console.log("Hexadecimal encoded SIGNED transaction");
//console.log(tx.build().toHex());
@febrezo so you want to sign on another device, but have the hex for the transaction sent without all the required signatures?
In bitcoinjs-lib terms, we call this an incomplete transaction.
console.log(tx.buildIncomplete().toHex());
Let me know if that is what you were after :+1:
That is, incomplete transactions was the concept! Thanks for the info. I'm closing the issue too!
Most helpful comment
@febrezo so you want to sign on another device, but have the hex for the transaction sent without all the required signatures?
In bitcoinjs-lib terms, we call this an incomplete transaction.
Let me know if that is what you were after :+1: