Correct, the fee you pay when you send bitcoins is all about how you receive the bitcoins
. . .To be a "proper" transaction fee, the fee must be computed in terms of bitcoins (or satoshis)
PER BYTE. The number of BTC being transferred does not matter.
The necessary fees change constantly depending on how many transactions are waiting for confirmation. If there are no transactions waiting for confirmation at all, it is entirely possible to get a transaction confirmed with 0 fees (or extremely low fees). If there are lots of transactions waiting, then you'll need to pay more per byte than most of the waiting transaction so that miners will want to confirm your transaction instead of the others that are waiting.
If you know what the size of your transaction (in bytes) will be then the following website can be used to estimate what your fee should be:
https://bitcoinfees.21.co/That site keeps an eye on the transactions that are waiting and the transactions that are getting confirmed, and it estimates what fee you'd need to pay per byte to get confirmed quickly.
The size (in bytes) of a transaction depends on the number of inputs and the number of outputs.
The transaction will typically have
10 bytes required for the framework of the transaction.
If you are only sending to a single address with your transaction then the transaction will only have 1 or 2 outputs.
Each output is 34 bytes.
Your wallet will choose from the transactions that were paid to you in the past to supply value to the transaction. Each of the previous payments you received that it chooses adds another input to the transaction.
Each input will probably be 148 bytes.
So,
for example, if you previously received 8 payments to your wallet:
- 0.1 BTC
- 0.5 BTC
- 0.04 BTC
- 0.25 BTC
- 0.0001 BTC
- 0.34 BTC
- 0.0032 BTC
- 0.9 BTC
- 0.00005 BTC
And you want to send 1.75 BTC to someone. Your wallet might choose the following
4 inputs (I've color coded them in red above so you can see them):
- 0.9 BTC
- 0.5 BTC
- 0.34 BTC
- 0.04 BTC
That provides a total of:
0.9 + 0.5 + 0.34 + 0.04 =
1.78 BTC of value to the transaction.
Now your wallet creates
1 output of 1.75 BTC to send the bitcoins where you wanted them to go.
This leaves:
1.78 BTC - 1.75 BTC = 0.03 BTC of value remaining in the transaction.
The total size of the transaction so far is:
(4 inputs X 148 bytes each) + (1 output X 34 bytes each) + 10 bytes = 636 bytes.
If the transaction doesn't do anything with that extra 0.03 BTC, then it becomes a transaction fee.
That would be an excessive fee:
0.03 BTC / 636 bytes = 0.00004717 BTC (or 4717 satoshis) per byte.
Lets imagine for a moment that 180 satoshis (0.00000180 BTC) per byte is a reasonable fee...
So the transaction needs ANOTHER output so it can send the excess "change" BTC back into the wallet (sort of like getting $15 in change when you pay with a $20 bill for something that costs $5).
This extra output will add another 34 bytes to the transaction.
The transaction is now 670 bytes.
So, since we are imagining that we want to pay 180 satoshis per byte, and the final transaction size is 670 bytes (4 inputs and 2 outputs) we need a fee of:
180 satoshis per byte X 670 bytes =
120600 satoshis (or 0.001206 BTC).
Now lets imagine that you are using a faucet to collect BTC (that's a HORRIBLE idea). Let's say the faucet pays you 0.00001 BTC every 60 seconds, and you find a way to work the faucet 24 hours a day without missing a payment.
After 1 month, you will have collected 43,200 payments of 0.00001 BTC each. You will have a total of 0.432 BTC.
Now you want to send 0.01 BTC to someone.
Your wallet needs to choose 1000 of those 0.00001 BTC payments to add up to 0.01 BTC.
That's 1000 inputs!.
1000 inputs X 148 bytes per input = 148000 bytes.
Even if you only have 1 (34 bytes) output (plus the 10 bytes of framework), that's still 148044 bytes.
If the fee is going to be 180 satoshis per byte, then your fee to send the transaction will be:
180 satoshis per byte * 148044 bytes = 26647920 satoshis (or 0.26647920 BTC).
As you can see, the fee doesn't depend on the amount of BTC being sent.
In the first example, you can send 1.75 BTC with a fee of only 0.001206 BTC
In the second example, sending 0.01 BTC requires a fee of 0.2664792 BTC . . .
So, the lesson is not to receive small payments if you can avoid it, and use wallet software that does a good job of optimizing which received payments to spend so that it can minimize the inputs and outputs in the long run.