Skip to main content
1 of 3
ieatpizza
  • 2.1k
  • 9
  • 11

Does Alice pay more or does Bob get less? (the fee has to come from somebody)

Alice pays more.

It works like this: Alice submits a transaction with inputs adding up to, for example, 0.016 BTC. This transaction includes outputs totaling 0.015 BTC to Bob. The difference, in this example 0.001 BTC, would be the transaction fee in this case.

The way to calculate the fee

The fee of Bitcoin transactions is calculated on the size of the transaction, not the value being transacted. For each byte of your transaction, you are bidding a certain number of satoshi -- so for example, if you chose a 100 sat/byte fee, and your transaction is 600 bytes, then you should include a 600*100=60000 sat (0.0006 BTC) fee.

You are bidding for space in a block. Because only a certain amount of transactions can go into each block, most miners will select the transactions with the highest satoshi per byte fee, because it is more profitable for them to collect these fees. You could choose a 0 sat/byte fee, in effect making your transaction free of fees, but miners will probably not include your transaction in a block because they'd be losing money, so your transaction will never confirm.

With smaller altcoins like Bitcoin Cash and Dogecoin, where there isn't such high transaction volume, you can use a 0 sat/byte fee, because the blocks aren't full anyways, so miners will include your transaction for free.

I can understand if they send over US$1 million and the fee is $13, then they probably don't mind and "want" to include a fee.

The price of the transaction is completely irrelevant to the fees. Since it's by the size of your transaction... if your $10 USD transaction is very complicated and results in a large transaction, you may end up paying a hilariously large fee to have it confirmed. By contrast, if your $1M transaction is very simple and the transaction is very small, then the fees for that transaction will be low, despite it being a high value transaction.

The miner gets the fee -- is that the miner who originally did the mining of the coin, or is it that somehow, the fee (or transaction) gets encrypted and a new miner has to mine it. It is described as: all the miners compete to find the next new Bitcoin, but there is also Proof of Work (to get a fraction of Bitcoin), but there is no mentioning of the miner getting a transaction fee. How does it factor into the flow or procedure?

The miner who mines the block that first includes your transaction gets your transaction fee. Let's say your transaction was included in block #123. The miner who mined block #123 receives your transaction fee.

ieatpizza
  • 2.1k
  • 9
  • 11