<p>In theory, you pay whatever fee you want, in order to bid for space in the blockchain. Miners are free to include or ignore your transaction, but a higher fee likely incentivizes them to accept it.</p>
<p>In practice, what matters is the fee per vbyte (feerate) of the transaction (vbyte is defined as the size in bytes of the entire transaction, but every byte in the witness only counts as 0.25). The reason is that the actual protocol rule says that blocks are limited to 1000000 vbytes. That is the constrained resource. Miners want to make as much money with the space available, and thus will select transactions with the higher fee/vbyte (feerate) first.</p>
<p>Adding more inputs does increase a transaction's vsize, but so adding more outputs, or using more complex scripts. It's not a simple function of the number of inputs (or outputs). For example, spending a multisig output generally takes up more vbytes.</p>

CC BY-SA 4.0
2021-09-21T00:20:57.433Z
2021-09-21T00:20:57.433Z
Pieter Wuille
<p>I'm wondering how transaction fees work.</p>
<p>Do you pay based on the entire transaction or per output basis?</p>
<p>i.e. imagine the base fee is 10000 satoshis. You're trying to send money to <code>X</code> address. You are sending it from 5 unspent outputs, will you need to pay 50000 satoshis or 10000 satoshis?</p>

<transactions><transaction-fees>
Do you pay a transaction fee per spent output or per total transaction?
Trevor
# Do you pay a transaction fee per spent output or per total transaction?

(Asked by: username_0 on 2021-09-21)

I'm wondering how transaction fees work.

Do you pay based on the entire transaction or per output basis?

i.e. imagine the base fee is 10000 satoshis. You're trying to send money to `X` address. You are sending it from 5 unspent outputs, will you need to pay 50000 satoshis or 10000 satoshis?

**Tags:** transactions, transaction-fees


---

## 1 answers

### Answer by username_1 on 2021-09-21. Score: 3 | Accepted answer

In theory, you pay whatever fee you want, in order to bid for space in the blockchain. Miners are free to include or ignore your transaction, but a higher fee likely incentivizes them to accept it.

In practice, what matters is the fee per vbyte (feerate) of the transaction (vbyte is defined as the size in bytes of the entire transaction, but every byte in the witness only counts as 0.25). The reason is that the actual protocol rule says that blocks are limited to 1000000 vbytes. That is the constrained resource. Miners want to make as much money with the space available, and thus will select transactions with the higher fee/vbyte (feerate) first.

Adding more inputs does increase a transaction's vsize, but so adding more outputs, or using more complex scripts. It's not a simple function of the number of inputs (or outputs). For example, spending a multisig output generally takes up more vbytes.


---

