In Segment 4.6, we'll talk about Transaction Fees. This is a topic that's come up before in a previous lecture and we'll come up again later in a later lecture. And transaction fees are one of the bits of how 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 in bitcoin today. We talked about storage in this lecture. We talked about payment services. We talked about exchanges. But bottom line is whenever a transaction is put into the BitCoin block 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 a transaction minus the total value of coins that come out. The inputs have to be always at least as big as the outputs because a regular transaction can't create coins. But if the inputs are 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 who made the block that records this transaction. The economics of transaction fees are interesting, and we'll come back to this in a later lecture. But what I wanna talk about today is how transaction fees are actually set in BitCoin as it operates, as of the time of this film. These things do change from time to time, but we'll give you a snapshot of what's going on right now. 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 to peer network need to relay your transaction. And ultimately a minor needs to build your transaction into their block. And it costs them a little bit of computational effort to do that and the time that they spend calculating a block that's slightly larger because it contains your transaction is time that they could otherwise have spent trying to make a block and get a block reward. So there is a cost both to the peers in the peer to peer network and to the miners of incorporating your transaction. So the idea of a transactions fee is to somehow compensate 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 no fee or you can pay a high fee. But as a general matter if you pay a higher transaction fee It's natural 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 the transaction are one 100th of a BitCoin or larger, that's currently worth $5 or $6 US. And if the priority of the transaction, according to a certain formula is large enough. The priority formula works like this. You look at all of the inputs to the transaction, and for each one you add the product of the age of that input times the value of that input in BitCoins. You add that up over all the inputs, then you divide by the transaction size. So if you meet these three requirements, then no fee will typically be charged, and your transaction will be relayed, and it will be recorded in the blockchain without a fee. Otherwise a fee is charged and that fee is about .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 inputs and 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 size has maybe two inputs and two outputs, its size would be four to five hundred bytes. All right, now the current status quo is that most miners enforce the consensus fee structure. Which means that they will either not service or will service less transactions that don't meet the consensus fee structure. 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. The longer your transaction sits without being recorded, the higher its priority will get because its BitCoins get slowly older. But in any case, if you haven't paid the consensus fee, your transactions will probably take longer to find their way into the block chain. Maybe that's okay with you. Most miners prioritize transaction based on the fees that are paid, and based on the priority formula. And I'm not gonna go into the details of how that works, but if you pay more or if your priority is higher according to the formula, then your transaction probably gets memorialized first. 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 a transaction even if it pays a smaller fee or no fee at all. So if you make a transaction that doesn't meet the fee requirements it will probably find its way in the block chain anyway. But the way to get your transaction recorded more quickly and more reliably is to pay the consensus fee. And that's why most wallet software and most payment services include the consensus fee structure in the payments that go on. And so you'll see a little bit of money raked off for transaction fees when you engage in everyday BitCoin business.