Transaction Fees The engine room of bitcoin works, if you will, and it touches a bunch of different topics. So what I wanna talk about here today is the practical details of how transaction fees are set inbitcoin today. We talked about storage in this lecture. We talked about payment services. Wetalked about exchanges. But bottom line is whenever a transaction is put into the BitCoinblock chain that transaction might pay transaction fees. Now recall from a previous lecture,that a transaction fee is just defined to be the difference the total value of coins that go into atransaction minus the total value of coins that come out. The inputs have to be always atleast as big as the outputs because a regular transaction can't create coins. But if the inputsare a little bigger than the outputs, then the difference is deemed to be a transaction fee.And that transaction fee goes to the miner who recorded this transaction, the miner whomade the block that records this transaction. We'll revisit the economics of transaction fees in a subsequent session because it's an intriguing topic. But, I want to focus on how transaction fees are set in Bitcoin as it iscurrently used at the time of this movie. These things do occasionally alter, but we'll offer youan overview of the current situation. Okay so why do transaction fees exist at all. Well the reason is, is that there's some cost that someone has to incur in order to relay your transaction. The nodes in the BitCoin peer topeer network need to relay your transaction. And ultimately a minor needs to build yourtransaction into their block. And it costs them a little bit of computational effort to do that andthe time that they spend calculating a block that's slightly larger because it contains yourtransaction is time that they could otherwise have spent trying to make a block and get ablock reward. So there is a cost both to the peers in the peer to peer network and to theminers of incorporating your transaction. So the idea of a transactions fee is to somehowcompensate people for those costs that they incur because your transaction exists.Generally you're free to set the transaction fee to whatever you want it to be, you can pay nofee or you can pay a high fee. But as a general matter if you pay a higher transaction fee It'snatural that your transaction will be relayed and recorded more quickly and more reliably. So the current consensus transaction fees are as follows. First of all, a no fee is charged if the transaction is less than 1,000 bytes in size, in total size. If all of the outputs of thetransaction are one 100th of a BitCoin or larger, that's currently worth $5 or $6 US. And if thepriority of the transaction, according to a certain formula is large enough. The priority formulaworks like this. You look at all of the inputs to the transaction, and for each one you add theproduct of the age of that input times the value of that input in BitCoins. You add that up overall the inputs, then you divide by the transaction size. So if you meet these threerequirements, then no fee will typically be charged, and your transaction will be relayed, andit will be recorded in the blockchain without a fee. Otherwise a fee is charged and that fee isabout .0001 BitCoins per 1,000 bytes and that's a fraction of a US penny per 1,000 bytes.Now just as an aside the approximate size of a transaction based on the number of inputsand the number of outputs is about 148 bytes per each input plus about 34 bytes per each
output plus about ten bytes for other information. And so, a transaction that's of small sizehas maybe two inputs and two outputs, its size would be four to five hundred bytes. Okay, so the consensus fee structure is now being upheld by the majority of miners. In other words, they won't handle transactions that don't fit the agreed-upon cost structure, orthey'll service them less. So if you don't pay the consensus fee your transactions will typically take longer to be recorded. It's worth noting that if you pay a small fee, that because of the way priority Calculation works, the priority includes age of your BitCoins. Your transaction will become more important the longer it goes unrecorded since your transaction's BitCoins steadily age.But, your transactions would most likely take longer to enter the block chain if you haven'tpaid the consensus cost. Maybe you're okay with it. The majority of the time, the mostcommon method of obtaining a loan is through a bank. If you pay more or if your priority ishigher according to the calculation, your transaction is likely to be commemorated first. Iwon't delve into the specifics of how that works. Now finally, I said this was the consensus, and that most miners do it. But in fact, there are other miners who don't enforce these rules. And who will record and operate on atransaction even if it pays a smaller fee or no fee at all. So if you make a transaction thatdoesn't meet the fee requirements it will probably find its way in the block chain anyway. Butthe way to get your transaction recorded more quickly and more reliably is to pay theconsensus fee. And that's why most wallet software and most payment services include theconsensus fee structure in the payments that go on. And so you'll see a little bit of moneyraked off for transaction fees when you engage in everyday BitCoin business.