0

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?

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.