<p>Every transaction references input UTXOs (also called VOUTs) as VINs and outputs bitcoins to certain addresses. The input value, in bitcoins, is summed up. This sum is the maximum amount that can be allocated to outputs, but does not need to (and usually is not) what is completely allocated to outputs.</p>

<p>Usually, the sum of outputs is slightly less than the sum of inputs. In Bitcoin, the difference between these two is paid to the coinbase address of the block that the transaction is included in.</p>

<p>Most likely, your client uses the "change address" paradigm. From your HD wallet, a new key pair and address are derived. This new address serves as a change address. You specify how much bitcoins you want to spend to an output(s), the remaining amount is then calculated from the subtraction of all the specified output amounts. This remaining amount is then subtracted further, using a fee estimate. The final value is paid to that change address, which you control. The fee estimate then becomes what is paid to the miner. All of these operations are automated by your wallet client, so you normally don't need to fiddle with these change addresses. However, it can be customized.</p>

<p>Following this logic, all you need to do to customize your fee is to increase/decrease the number of bitcoins sent to your change address. The higher the number, the smaller the fee, and vice versa. After calculating all these parameters, you can then create a custom transaction, serialize it (createrawtransaction), sign it (signrawtransaction), and broadcast it.</p>

CC BY-SA 4.0
2019-04-04T03:34:12.500Z
Thanks for answering. Any documentation or any formula is available to calculate the fee...???
salman faris
CC BY-SA 4.0
2019-04-04T00:43:38.320Z
2019-04-04T00:43:38.320Z
Expectator
<p>I like to doing to submit every new transaction with user specific fee. I don't see any valid documentation for achieve it using RPC call. Give any suggestion. </p>

<p>Thankyou</p>

CC BY-SA 4.0
2019-04-02T18:32:42.700Z
Can you provide additional details as to what exactly you are trying to achieve?
Ugam Kamat
CC BY-SA 4.0
2019-04-03T03:30:51.703Z
Hi.. I try to setup a bitcoin web based wallet. I planning to setup a full node on cloud and do the wallet operation by using RPC call. I need to setup a user choosing fee for every withdrawal transaction. How to achieve it..??
salman faris
CC BY-SA 4.0
2019-04-03T06:57:35.003Z
Fees = inputs - outputs. You can just adjust how much the user is allowed to spend in the outputs when they are consuming their UTXO.
Ugam Kamat
CC BY-SA 4.0
2019-04-03T07:01:11.833Z
Any way are available to calculate the exact fee before sending transaction...???
salman faris
<bitcoind><transaction-fees><json-rpc>
Submitt transaction with custome fee
salman faris
# Submitt transaction with custome fee

(Asked by: username_0 on 2019-04-02)

I like to doing to submit every new transaction with user specific fee. I don't see any valid documentation for achieve it using RPC call. Give any suggestion.

Thankyou

**Tags:** bitcoind, transaction-fees, json-rpc

> **Comments:**
> **username_1**: Can you provide additional details as to what exactly you are trying to achieve?  
> **username_0**: Hi.. I try to setup a bitcoin web based wallet. I planning to setup a full node on cloud and do the wallet operation by using RPC call. I need to setup a user choosing fee for every withdrawal transaction. How to achieve it..??  
> **username_1**: Fees = inputs - outputs. You can just adjust how much the user is allowed to spend in the outputs when they are consuming their UTXO.  
> **username_0**: Any way are available to calculate the exact fee before sending transaction...???  

---

## 1 answers

### Answer by username_2 on 2019-04-04. Score: 1

Every transaction references input UTXOs (also called VOUTs) as VINs and outputs bitcoins to certain addresses. The input value, in bitcoins, is summed up. This sum is the maximum amount that can be allocated to outputs, but does not need to (and usually is not) what is completely allocated to outputs.

Usually, the sum of outputs is slightly less than the sum of inputs. In Bitcoin, the difference between these two is paid to the coinbase address of the block that the transaction is included in.

Most likely, your client uses the "change address" paradigm. From your HD wallet, a new key pair and address are derived. This new address serves as a change address. You specify how much bitcoins you want to spend to an output(s), the remaining amount is then calculated from the subtraction of all the specified output amounts. This remaining amount is then subtracted further, using a fee estimate. The final value is paid to that change address, which you control. The fee estimate then becomes what is paid to the miner. All of these operations are automated by your wallet client, so you normally don't need to fiddle with these change addresses. However, it can be customized.

Following this logic, all you need to do to customize your fee is to increase/decrease the number of bitcoins sent to your change address. The higher the number, the smaller the fee, and vice versa. After calculating all these parameters, you can then create a custom transaction, serialize it (createrawtransaction), sign it (signrawtransaction), and broadcast it.

> **Comments:**
> **username_0**: Thanks for answering. Any documentation or any formula is available to calculate the fee...???  

---

