Create a transaction from a wallet coins (UTXOs)

by madu   Last Updated July 11, 2019 13:27 PM

I have a multisig setup where the signing is done through external HSM's. I am using Bcoin and its wallet to receive funds. What I am trying to do I have a multisig setup where the signing is done through external HSM's. I am using Bcoin and its wallet to receive funds. What I am trying to do is to create a transaction and sign it with the HSMs. There are 2 approaches:

  1. Manually create the transaction using MTX.
  2. Use the wallet to create the transaction.

Method #1 solves my problem. The code is even shown here. However, this method has a big drawback. It requires that I create the Coins. That means, I need to manually create the VOuts and VIns. Meaning that I need to get my UTXO set and choose the ones I need for the transaction. This is very tedious and error prone.

Method #2 solves this issue. When using the wallet, createTx() will create the transaction for you, choosing the VOuts and VIns from the UTXO set for that wallet. However, the problem with this approach is that createTX() signs the transaction. I do not want this as the signing needs to be done by other sources.

So, is there a way for me to get the raw transaction from a wallet without it signing? MTX has the method toRaw() which gives the raw transaction. Is there any way I can get the wallet to create the transaction, or at least create the VOut/Vin sets?

Thank you.



Related Questions


Updated February 24, 2018 10:27 AM

Updated June 15, 2018 14:27 PM

Updated February 27, 2018 17:27 PM

Updated October 26, 2017 07:27 AM

Updated August 12, 2017 12:27 PM