Author

Topic: ELI5 - Transaction Fees (Read 88 times)

legendary
Activity: 3808
Merit: 1723
December 28, 2023, 12:54:11 AM
#5
One thing to keep in mind is that it doesn’t matter if you are sending $1 or $1M your fees will be identical. Another thing to keep in mind is that unlike ETH, if you received a lot of small transactions and you want to send them all to 1 address such as an exchange, then you will need to combine all those inputs.

And combing all of them won’t be cheap. If they were all like $20 or so, then it would cost more to move them than they are worth. Hence why right now it’s not wise making any small bitcoin transactions.
legendary
Activity: 4396
Merit: 4755
December 27, 2023, 07:11:33 PM
#4
Transaction fees are calculated base on the size of that transaction and that’s why you see discrepancies on the amounts usually paid for transactions and also the address formats matters too. Below is how they are calculated.

Legacy addresses starts from 1
Nested segwit starts from 3 (although not only nested segwit starts from 3)
Segwit version 0 starts from bc1q
Segwit version 1 starts from bc1p (pay-to-taproot)

This is the formula necessary for the calculation:

Formula:
For legacy address: vbyte= Input*148 + output*34 + 10 plus or minus input
For nested segwit: vbyte= Input*93 + output*32 + 10 plus or minus input
For segwit version 0: vbyte= Input*68 + output*31 + 10 plus or minus input
For pay-to-taproot: vbyte= Input*57.5 + output*43 + 10 plus or minus input


To know more about the input and output virtual size: https://bitcoinops.org/en/tools/calc-size/
To know more about the transaction virtual size: https://jlopp.github.io/bitcoin-transaction-size-calculator/
For mempool (beginners): https://mempool.space/
Mempool for advanced users: https://jochen-hoenicke.de/queue/#BTC%20(default%20mempool),24h,weight

For example:
If you use the vbyte calculator or that formula above for 1 input and 2 outputs for native segwit addresses, you will get 110 vbyte as the virtual size of 1 input 2 outputs transaction.

To check the fee rate, click on the above second to the last, or last link.

Assuming the fee rate is 5 sat/vbyte.

Fee rate = fee ÷ vbyte

Fee = fee rate * vbyte

Fee = 5 * 110

Fee = 550 sat (0.0000055 BTC). I mean for 1 input and 2 outputs for segwit version 0.


Which means the higher the fee rate, the higher the fee. As mempool is becoming more congested, the fee rate will increase and the fee will increase.

Also if you understand ehat I explained above, you will noticed that as the input count is increasing, the fee will also increase.

Also as the output count is increasing, the fee is also increasing. But if you send to two different addresses separately, the fee would be more. So we can still say increase in the output will make the fee to decrease, despite that the fee is increasing, but lower than sending to each addresses separately.

From the virtual sizes, you can also know that you can save more in fee if you use segwit version 0 and pay-to-taproot addresses while legacy addresses have the highest fee.

Also you will know that pay-to-taproot will be good for consolidation, while segwit version 0 for paying to many addresses.

part of the fee is calculated by size.. but the rate(multiplier) is calculated by something else

when transactions enter a mempool(waiting list) nodes group transactions together by an amount they paid for the size.
and then wait for how long those transactions remain in mempool before appearing in a block. this then determines the fee estimate of priority
which nodes then use to calculate new fee rates for newer transactions
EG if a bunch of transactions paying rate X take 2 blocktime lengths then priority becomes more then X

there is alot of calculation assumptions and defaults that aim to bump the fee up. some of which are the fee increments which are not 1sat/byte nor 1sat per 10byte nor 1sat per 100byte.. but 5000sat per kbyte, pushing people to up-bid each other by 5sat/byte leaps in bids which causes fee's to escalate quicker than bids incrementing by just 1sat per 100byte

its also worth noting that vbytes are not actual bytes. they are a miscount of real bytes which also causes more confusion. especially when different tx formats have different byte which have different vbyte

all this cludgy miscounting and assumptions do not help transactions estimate best fee, but instead used to annoy users and cause them to constantly fee bump, and thats how there is discrepancies. because discrepancies are built in to cause chaos
legendary
Activity: 1526
Merit: 1359
December 27, 2023, 04:42:04 PM
#3
Can someone give me a BRIEF, SIMPLE explanation of how fees work?  How are they calculated?

Good question.  Its kinda complicated, with a few things that matter:

First up is how big the transaction is and, if it requires more space in the block, so miners want a bigger tip.

Theres also how fast you wanna move your coins.  You in a hurry? You can pay extra so the miners push your payment to the front of the line.  Gets it in the next block coming up.   

And heres the tricky one - how congested the whole network is.  More folks moving coins at once fees climb up.  Miners get flooded and can take the highest bidders.

So no crystal ball for future fees.  Too many moving pieces.  Network traffic jams are hard to predict.  But those are the basics - size, speed, congestion.  Thats the recipe behind transaction fees.
sr. member
Activity: 504
Merit: 279
December 27, 2023, 04:02:11 PM
#2
Fees as you know are tips paid to miners to get your transaction been included into the next block. In bitcoin there is no standard or default amount set as transaction fee rather it depends on how congested the bitcoin network is at that time. There are some block explorers like mempool.space that suggest fee rates. For you to get your transaction confirmed in the next block you need to pay a higher fee according to those fee rates set by some of these explorers, although it is not a criteria but it’s best since mining pools sort there transactions into be included into blocks base on the fees paid.

Transaction fees are calculated base on the size of that transaction and that’s why you see discrepancies on the amounts usually paid for transactions and also the address formats matters too. Below is how they are calculated.

Legacy addresses starts from 1
Nested segwit starts from 3 (although not only nested segwit starts from 3)
Segwit version 0 starts from bc1q
Segwit version 1 starts from bc1p (pay-to-taproot)

This is the formula necessary for the calculation:

Formula:
For legacy address: vbyte= Input*148 + output*34 + 10 plus or minus input
For nested segwit: vbyte= Input*93 + output*32 + 10 plus or minus input
For segwit version 0: vbyte= Input*68 + output*31 + 10 plus or minus input
For pay-to-taproot: vbyte= Input*57.5 + output*43 + 10 plus or minus input


To know more about the input and output virtual size: https://bitcoinops.org/en/tools/calc-size/
To know more about the transaction virtual size: https://jlopp.github.io/bitcoin-transaction-size-calculator/
For mempool (beginners): https://mempool.space/
Mempool for advanced users: https://jochen-hoenicke.de/queue/#BTC%20(default%20mempool),24h,weight

For example:
If you use the vbyte calculator or that formula above for 1 input and 2 outputs for native segwit addresses, you will get 110 vbyte as the virtual size of 1 input 2 outputs transaction.

To check the fee rate, click on the above second to the last, or last link.

Assuming the fee rate is 5 sat/vbyte.

Fee rate = fee ÷ vbyte

Fee = fee rate * vbyte

Fee = 5 * 110

Fee = 550 sat (0.0000055 BTC). I mean for 1 input and 2 outputs for segwit version 0.


Which means the higher the fee rate, the higher the fee. As mempool is becoming more congested, the fee rate will increase and the fee will increase.

Also if you understand ehat I explained above, you will noticed that as the input count is increasing, the fee will also increase.

Also as the output count is increasing, the fee is also increasing. But if you send to two different addresses separately, the fee would be more. So we can still say increase in the output will make the fee to decrease, despite that the fee is increasing, but lower than sending to each addresses separately.

From the virtual sizes, you can also know that you can save more in fee if you use segwit version 0 and pay-to-taproot addresses while legacy addresses have the highest fee.

Also you will know that pay-to-taproot will be good for consolidation, while segwit version 0 for paying to many addresses.
newbie
Activity: 11
Merit: 6
December 27, 2023, 03:52:20 PM
#1
Can someone give me a BRIEF, SIMPLE explanation of how fees work?  How are they calculated? Why is there a discrepancy in opinion regarding how high the fees will be as we approach more halvings?  Lots of speculation about how expensive fees will need to be in the future.  Any insight, would be appreciated.  FWIW I'm not a computer dude, as much simplicity as possible would be most appreciated.  Thanks in advance! 
Jump to: