<p>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.</p>
<p>If you want to know the exact weight to used, you can use this:
<code>(signed_tx_weight - unsigned_tx_weight) + 41*4</code>.</p>
<p>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: <code>fee you paied / real weight after sign</code>. If the real weight is higher or slower, than the real fee_rate will be lower or higher.</p>

CC BY-SA 4.0
2024-07-29T10:32:08.920Z
Also, the fee calculated is something like : fee_rate * ((input_weight - (41 * 4) + unsigned_tx_weight) / 4 )
newgate92
CC BY-SA 4.0
2024-07-29T10:28:54.280Z
2024-07-29T10:28:54.280Z
newgate92
<p>I am trying to use bitcoin-cli <code>fundrawtransaction</code> 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 <code>input_weights</code> parameter to do it. (there is no &quot;inputs&quot; parameter). I don't know how to set the <code>weight</code> in the <code>input_weights</code> and don't know what's their effects.</p>
<p>There seems to be a min(165) and max(400000) value of <code>weight</code> 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?</p>
<p>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!</p>

<transaction-fees><bitcoin-cli><raw-transaction><transaction-weight>
What's the "weight" meaning in fundrawtransaction cmd's input_weights parameter
newgate92
# What's the "weight" meaning in fundrawtransaction cmd's input_weights parameter

(Asked by: username_0 on 2024-07-28)

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!

**Tags:** transaction-fees, bitcoin-cli, raw-transaction, transaction-weight


---

## 1 answers

### Answer by username_0 on 2024-07-29. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: Also, the fee calculated is something like : fee_rate * ((input_weight - (41 * 4) + unsigned_tx_weight) / 4 )  

---

