<p>When you create a raw transaction, you must specify all inputs and outputs, and any leftover will go towards the fee (to the miner). <strong><em>The raw transaction does not do any fee calculation.</em></strong></p>

<p>Example Transaction:</p>

<pre><code>input1: .1BTC
input2: .2BTC

output1: .299BTC
</code></pre>

<p>The resulting fee would be:</p>

<pre><code>fee: .001BTC
</code></pre>

<p>This amount gets added to the coinbase transaction (by the miner) of the block which includes this transaction.</p>

CC BY-SA 4.0
2018-07-23T22:21:08.293Z
2018-07-23T22:21:08.293Z
JBaczuk
<p>I'm currently working on a project (I'm a beginner in the world of cryptocurrencies) where we are using Raw Transactions, I want to know if in raw transactions there's a flag similar to subtractFeeFromAmount flag that exists in the sendToAddress method.</p>

<transactions><transaction-fees><raw-transaction><sendtoaddress>
Raw transactions - SubtractFeeFromAmount flag
Gerardo Gutiérrez
# Raw transactions - SubtractFeeFromAmount flag

(Asked by: username_0 on 2018-07-23)

I'm currently working on a project (I'm a beginner in the world of cryptocurrencies) where we are using Raw Transactions, I want to know if in raw transactions there's a flag similar to subtractFeeFromAmount flag that exists in the sendToAddress method.

**Tags:** transactions, transaction-fees, raw-transaction, sendtoaddress


---

## 1 answers

### Answer by username_1 on 2018-07-23. Score: 5 | Accepted answer

When you create a raw transaction, you must specify all inputs and outputs, and any leftover will go towards the fee (to the miner). The raw transaction does not do any fee calculation.
Example Transaction:
input1: .1BTC
input2: .2BTC

output1: .299BTC

The resulting fee would be:
fee: .001BTC

This amount gets added to the coinbase transaction (by the miner) of the block which includes this transaction.


---

