# <center><i class="fa fa-edit"></i> 4.6 Transaction Fees </center> ###### tags: `Blockchain` The following notes are taken from [Coursera](https://www.coursera.org/learn/cryptocurrency/home/week/2) --- Definition: ``` transaction fee = value of inputs - value of outputs ``` - Fee goes to miner who records the transaction - Cost resources for - Peers to relay your transaction - Miner to record your transaction - Transaction fee compensates for (some of) these costs - Generally, higher fee means transaction will be forwarded and recorded faster ### Current Consensus Fees - No fee if: - tx less than 1000 bytes in size - All outputs are 0.01 BTC or larger, and - Priority is large enough - `Priority = (sum of inputAge*inputValue) / (trans size)` - Otherwise fee is 0.0001 BTC per 1000 bytes - Approx transaction size: `148 Nᵢₙₚᵤₜₛ + 34 Nₒᵤₜₚᵤₜₛ + 10` - 10 for other information --- - Most miners enforce the consensus fee structure - If you don't pay the consensus fee, your transaction will take longer to be recorded - Miners prioritize transaction based on fees and the priority formula