<p>The transaction fee is implicitly specified. It is given to the miner as the remainder of the transaction: the difference between the sum of all transaction inputs and the sum of all transaction outputs is left free to be collected by the miner.</p>
<p>See also:
<a href="https://bitcoin.stackexchange.com/questions/80784/collecting-block-reward-and-transaction-fees?rq=1">collecting block reward and transaction fees</a></p>

CC BY-SA 4.0
2021-06-12T11:41:02.137Z
2021-06-12T17:50:34.687Z
2021-06-12T17:50:34.687Z
leevancleef
<p>I've recently looked up the exact format of a transaction and came up with this (<a href="https://betterprogramming.pub/the-bitcoin-script-language-e4379908448f" rel="noreferrer">source with explanation</a>):</p>
<p><a href="https://i.sstatic.net/uyBFG.png" rel="noreferrer"><img src="https://i.sstatic.net/uyBFG.png" alt="enter image description here" /></a></p>
<p>However, this seems not to include transaction fees. Are they not part of the transaction? Or do they have a special output lock script that basically makes it available to everybody?</p>

<transactions><transaction-fees>
Where are transaction fees specified?
Martin Thoma
# Where are transaction fees specified?

(Asked by: username_0 on 2021-06-12)

I've recently looked up the exact format of a transaction and came up with this ([source with explanation](https://betterprogramming.pub/the-bitcoin-script-language-e4379908448f)):

[![enter image description here](https://i.sstatic.net/uyBFG.png)](https://i.sstatic.net/uyBFG.png)

However, this seems not to include transaction fees. Are they not part of the transaction? Or do they have a special output lock script that basically makes it available to everybody?

**Tags:** transactions, transaction-fees


---

## 1 answers

### Answer by username_1 on 2021-06-12. Score: 5

The transaction fee is implicitly specified. It is given to the miner as the remainder of the transaction: the difference between the sum of all transaction inputs and the sum of all transaction outputs is left free to be collected by the miner.

See also:
[collecting block reward and transaction fees](https://bitcoin.stackexchange.com/questions/80784/collecting-block-reward-and-transaction-fees?rq=1)


---

