1

I am trying to use bitcoin-cli fundrawtransaction to add inputs to a transaction with only outputs generated from other program. I need to use the specific inputs from my wallet. But I only find the input_weights parameter to do it. (there is no "inputs" parameter). I don't know how to set the weight in the input_weights and don't know what's their effects.

There seems to be a min(165) and max(400000) value of weight which I find it in the code. If I send a value between min and max, the difference seems to be the fee I pay in the transaction. The problem is what weight should I set? Is there any different between different input weight?

I know the concept of size/weight of transaction. But I don't know the meaning of input weight and don't know how to set it correctly. Thanks!

1 Answer 1

1

I think I have figure it out. The input's weight is used to calculate the fee used in the transaction before signing the transaction.

If you want to know the exact weight to used, you can use this: (signed_tx_weight - unsigned_tx_weight) + 41*4.

However, If you set the weight higher or lower than the real weight of input, your fee_rate options will behave higher or lower than the one you set. Because you calculate more or less weight of your transaction, and the real fee_rate is: fee you paied / real weight after sign. If the real weight is higher or slower, than the real fee_rate will be lower or higher.

1
  • Also, the fee calculated is something like : fee_rate * ((input_weight - (41 * 4) + unsigned_tx_weight) / 4 )
    – newgate92
    Commented Jul 29 at 10:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.