Author

Topic: Trying to understand how fee works... But its kinda weird. (Read 125 times)

legendary
Activity: 2730
Merit: 7065
A bitcoin block has a weight limit of 4.000.000 weight units (WU). To understand how much your transaction "weighs", simply multiply your virtual size times 4. For the two transactions you made, the first one weighs 5328 WU and pays 30.0 sat/vByte while the second one weighs only 884 WU and pays 147.7 sat/vByte. Miners will always prioritize the second one because it pays more per vbyte and they have more free space to include other transactions.

In my town, we have a taxy service that drives around on the boulevard. They charge a fixed fee per person for each drive on the boulevard. That means that each person pays a fixed fee and the ride isn't exclusive for you. The driver can pick up additional people along the boulevard. If the drive is $5, one person pays $5, if two people enter the cab, they pay $10 in total, etc., you get the point. You have limited capacity in a taxy (that's your weight unit) and it's in your interest, as the driver, to fill it up and get paid as much as possible every time you drive.

Now you have two options.
You can take that tall and fat dude who will take up your entire backseat (he represents your 5328 WU transaction), or you can pick up that skinny teenager who weighs 884 WU. If you go for the fat dude, you wont have any more space on the backseat. Even if he pays $6 or $7 for the ride, it pays off more to drive the teenager for $5 because you know that along the way you will stop for more potential clients who will have room in the backseat and increase your earnings to $10 or $15. That is why miners will rather mine the 2nd of your two transactions because they know they will have much more space to include other transactions and earn more overall. 
legendary
Activity: 2352
Merit: 6089
bitcoindata.science
I made this transaction:
662f7e90b1e3d6f55c06388c07b62e15c6ab672c936372b64e8748c22d3923fb (game purchase on indiegala)

And it had a really hard time getting into a block even tough paying like 0.0004 in fee. Sites listed it like miners didn't want this transaction.

Then I did this transaction:
f3cb81d3a01f03b4e3b473fd3d264d0661d31f9081ca8ec6c544fee08b4ef853 (purchase of 100€ Steam gift card on bitrefill)

and this time, even when paying LESS in fee - 0.00032649 - it got pretty quick into a block and some sites listed it as a preferable transaction for miners.

What causes this?
It seems that 1000 satoshis / kB is the standard, but miners aren't following that what I understand, because the fee's I paid on both transactions were pretty high, and still the first block had trouble getting across.


How do miners calculate which fee to "require"?

A block has a limited size, in bytes (it is actually virtual byte, but lets consider it as bytes now to make it simple).

Each transaction has a different size. There are many things that control transaction size:
 
  • address format - old address format is called Legacy, and those addresses are bigger in bytes
  • number of inputs - Each time you receive BTC, even if using the same address, you generate one input. Each input occupy a space in the transaction size. The more inputs, the bigger the transction size.
  • number of outputs - number of destination addresses. Usually a transaction has at least 2 outputs, one as change (to receive back the remaning btc) and one destination.



Now let's look your transactions

 
  • This transaction has 7 inputs and 2 outputs. This transaction has the size of 1332 vB. You paid 30 sat/vbyte in this one.
  • While this tranasction transaction has only 1 input and 1 output, and the size of 221vB. The second transaction has 1/6 of the former transaction, and you paid 130 sat/vbyte in that one.

Miners will of course prefer a small transaction paying 130 sat/vbyte than a big one, which you paid only 30 sat/vbyte.
legendary
Activity: 1512
Merit: 4795
Leading Crypto Sports Betting & Casino Platform
Exactly is it as nc50lc commented. The first transaction has 7 inputs and 2 outputs, the inputs and outputs are higher than the second transaction with 1 input and 1 output. The more the input and output, the more the transaction weight, especially the input add much more to the weight, and transaction fee are calculated in weight or vbyte.

Transactions fee are calculated in weight or vbyte, not the actual amount you are paying. The miners make use of feerate (sat/vbyte) which you can check using reputed mempool observer.

Reputed mempool observers
https://jochen-hoenicke.de/queue/#BTC,24h,fee
https://mempool.space/
https://mempool.observer/

The higher the weight of the transaction, the high the fee.
Feerate= sat/vbyte
Fee= feerate*vbyte

The feerate to get a transaction confirmed is determined by the mempool state of congestion. And the more the transaction weight or vbyte (from most especially the transaction input), the increase in the feerate to get such transaction confirmed and the increase in fee that will be paid.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
1000 satoshis/vKB is far from the standard, in fact it is lower than the minimum fees to enter the mempool.

As mentioned, miners have to prioritize the fee rates over the total fees in order to maximize the profit from their very limited block size. It doesn't make sense for them to prioritize total fees, just won't be a good way to maximize the amount of fees collected.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
Miners aren't prioritizing transaction based from the total fee, they'll base it from the fee rate.

First, take note of the transaction's "virtual size" and "Transaction fees" from here:
The first transaction's size is higher than the second transaction so even though their total fee is almost identical, the fee rate will be lower for the transaction with higher size.
If you're not familiar, 'fee rate' is equal to the 'total fee' divided by 'virtual size'.
full member
Activity: 129
Merit: 119
I made this transaction:
662f7e90b1e3d6f55c06388c07b62e15c6ab672c936372b64e8748c22d3923fb (game purchase on indiegala)

And it had a really hard time getting into a block even tough paying like 0.0004 in fee. Sites listed it like miners didn't want this transaction.

Then I did this transaction:
f3cb81d3a01f03b4e3b473fd3d264d0661d31f9081ca8ec6c544fee08b4ef853 (purchase of 100€ Steam gift card on bitrefill)

and this time, even when paying LESS in fee - 0.00032649 - it got pretty quick into a block and some sites listed it as a preferable transaction for miners.

What causes this?
It seems that 1000 satoshis / kB is the standard, but miners aren't following that what I understand, because the fee's I paid on both transactions were pretty high, and still the first block had trouble getting across.


How do miners calculate which fee to "require"?
Jump to: