<blockquote>
  <p>how does the miner prove he has access in his wallet to the fee amount?</p>
</blockquote>

<p>Miners do not prove this.
The ability to reap the difference in inputs and outputs in a <a href="https://bitcoin.stackexchange.com/questions/4571/what-is-the-coinbase">coinbase transaction</a> is baked into the bitcoin consensus rules.
Any miner who was lucky enough to find a block can sum all the differences in included transaction inputs and outputs in a block and aggregate them in the coinbase transaction.</p>

<p>The miner <a href="https://bitcoin.stackexchange.com/questions/1991/what-is-the-block-maturation-time">can then spend the coinbase outputs 100 blocks later</a>.</p>

<p>Edit #1: @eponymous's comments regarding potential reduction in bitcoin supplies if miner does not reap <em>all</em> transaction fees.</p>

<p>Suppose a miner elects to not reap <em>all</em> the difference in inputs and outputs in a coinbase transaction, then the supposedly total supply of bitcoins will be reduced. The 21M bitcoin supply is a theoretical limit that assumes that all miners reap all potential transaction fees and block subsidy rewards. </p>

<p>Example: Total difference in inputs and outputs is 1 BTC, but miner reaps 0.9BTC. Then 0.1BTC will be lost from circulation.</p>

<p>Edit #2: Included @pwuille's excellent explanation on <a href="https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually">the existence of 21M bitcoins</a></p>

CC BY-SA 3.0
2017-11-07T20:20:14.997Z
Note that they don't necessarily have to take the fees they're entitled to, but some value less. It's an upper threshold not a requirement.
Claris
CC BY-SA 3.0
2017-11-08T16:51:15.250Z
@eponymous: if they took less, would that bitcoin be lost forever?
lollercoaster
CC BY-SA 3.0
2017-11-08T21:31:05.493Z
Yes. It’d be gone forever.
rny
CC BY-SA 3.0
2017-11-08T22:35:06.803Z
Yes, the supply is less than 21M due to some coins never having being mined.
Claris
CC BY-SA 3.0
2017-11-09T00:02:09.160Z
See https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually for details.
Pieter Wuille
CC BY-SA 3.0
2017-11-07T17:22:35.520Z
2017-11-09T00:16:44.357Z
2017-11-09T00:16:44.357Z
rny
<p>We have the rule for transactions that</p>

<pre><code>txFee = Σ(inputs) − Σ(outputs)
</code></pre>

<p>However, the coinbase transaction is exempt from the above rule, but restrained by a rule on the whole block:</p>

<pre><code>Σ(inputs) &gt; Σ(outputs) − blockSubsidy
</code></pre>

<p>This latter rule allows the miner to send themselves all transaction fees and the block subsidy in a coinbase output. Coinbase outputs are only allowed to be spent after they have matured to 100 confirmations, but otherwise work just like any other transaction output. Thus, the miner can prove that the funds are his just like any other user.</p>

<p>The block subsidy follows the reward schedule: <a href="https://bitcoin.stackexchange.com/q/161/5406">How many bitcoins will there eventually be?</a></p>

CC BY-SA 3.0
2017-11-09T15:51:13.230Z
2017-11-09T15:51:13.230Z
Murch
<p>If the fee isn’t written into the ledger, and it’s just the difference between the input transaction amount and the output transaction amount, how does the miner prove he has access in his wallet to the fee amount?</p>

<transaction-fees><protocol>
How do fees get processed in bitcoin? (protocol question)
lollercoaster
# How do fees get processed in bitcoin? (protocol question)

(Asked by: username_0 on 2017-11-07)

If the fee isn’t written into the ledger, and it’s just the difference between the input transaction amount and the output transaction amount, how does the miner prove he has access in his wallet to the fee amount?

**Tags:** transaction-fees, protocol


---

## 2 answers

### Answer by username_1 on 2017-11-07. Score: 4

> how does the miner prove he has access in his wallet to the fee amount?

Miners do not prove this.
The ability to reap the difference in inputs and outputs in a [coinbase transaction](https://bitcoin.stackexchange.com/questions/4571/what-is-the-coinbase) is baked into the bitcoin consensus rules.
Any miner who was lucky enough to find a block can sum all the differences in included transaction inputs and outputs in a block and aggregate them in the coinbase transaction.

The miner [can then spend the coinbase outputs 100 blocks later](https://bitcoin.stackexchange.com/questions/1991/what-is-the-block-maturation-time).

Edit #1: @eponymous's comments regarding potential reduction in bitcoin supplies if miner does not reap *all* transaction fees.

Suppose a miner elects to not reap *all* the difference in inputs and outputs in a coinbase transaction, then the supposedly total supply of bitcoins will be reduced. The 21M bitcoin supply is a theoretical limit that assumes that all miners reap all potential transaction fees and block subsidy rewards.

Example: Total difference in inputs and outputs is 1 BTC, but miner reaps 0.9BTC. Then 0.1BTC will be lost from circulation.

Edit #2: Included @pwuille's excellent explanation on [the existence of 21M bitcoins](https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually)

> **Comments:**
> **username_2**: Note that they don't necessarily have to take the fees they're entitled to, but some value less. It's an upper threshold not a requirement.  
> **username_0**: @eponymous: if they took less, would that bitcoin be lost forever?  
> **username_1**: Yes. It’d be gone forever.  
> **username_2**: Yes, the supply is less than 21M due to some coins never having being mined.  
> **username_3**: See https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually for details.  

---

### Answer by username_4 on 2017-11-09. Score: 0

We have the rule for transactions that
txFee = Σ(inputs) − Σ(outputs)

However, the coinbase transaction is exempt from the above rule, but restrained by a rule on the whole block:
Σ(inputs) > Σ(outputs) − blockSubsidy

This latter rule allows the miner to send themselves all transaction fees and the block subsidy in a coinbase output. Coinbase outputs are only allowed to be spent after they have matured to 100 confirmations, but otherwise work just like any other transaction output. Thus, the miner can prove that the funds are his just like any other user.
The block subsidy follows the reward schedule: How many bitcoins will there eventually be?


---

