<p>The transaction fees in a block <em>are</em> included in the coinbase transaction, which is a special type of transaction in that it does not have any inputs. </p>

<p>The value of the coinbase transaction’s output can be up to:</p>

<p><code>Current block reward + (sum of all inputs in the block - sum of all outputs in the block)</code></p>

<p>Claiming more than this will result in the block being invalid, but claiming less than this is allowed (though probably not in the miner’s best interests!)</p>

CC BY-SA 4.0
2018-07-11T00:27:04.453Z
Haha I'll gladly eat my words that makes sense, I never noticed before!
JBaczuk
CC BY-SA 4.0
2018-07-11T00:06:08.803Z
2018-07-11T00:06:08.803Z
chytrik
<p>I'm wondering where does a miner get an input for a transaction that spends the tx fees received from mining a block? It's not out of the coinbase transaction.</p>

<transaction-fees><mining-reward>
How does a miner create a transaction input to spend tx fees?
JBaczuk
# How does a miner create a transaction input to spend tx fees?

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

I'm wondering where does a miner get an input for a transaction that spends the tx fees received from mining a block? It's not out of the coinbase transaction.

**Tags:** transaction-fees, mining-reward


---

## 1 answers

### Answer by username_1 on 2018-07-11. Score: 6 | Accepted answer

The transaction fees in a block *are* included in the coinbase transaction, which is a special type of transaction in that it does not have any inputs.

The value of the coinbase transaction’s output can be up to:

`Current block reward + (sum of all inputs in the block - sum of all outputs in the block)`

Claiming more than this will result in the block being invalid, but claiming less than this is allowed (though probably not in the miner’s best interests!)

> **Comments:**
> **username_0**: Haha I'll gladly eat my words that makes sense, I never noticed before!  

---

