On a practical level, how exactly is the amount of a Bitcoin transaction fee determined? Yes, I know that you can actually set the transaction fee to anything you want, but I'm of course talking about a transaction which will actually be &quot;processed&quot; in a reasonable timeframe, &quot;reasonable&quot; being &quot;what the average person would accept&quot;.
I've been working for a long time now on a service which exclusively supports Bitcoin for payments. I'm afraid that somebody who is supposed to pay me the Bitcoin amount of $5 USD will feel appalled at the very notion of paying another $5 in Bitcoin just to send my service that actual $5.
I've done numerous Bitcoin transactions, but it has varied wildly in the amount. I can't really figure out how Bitcoin Core is deciding on the amount. (I've never changed it in.)
I'm aware of these &quot;side-chains&quot;, but I don't understand how I'm supposed to actually use them in practice. Introducing a bunch of requirements and extra complexity seems even worse than having people &quot;bite the bullet&quot; with large fees (compared to the amount sent).
You might say that I should be having them &quot;deposit&quot; Bitcoin and then hold it on my side, but due to the way that this service is constructed technically, as well as the expected usage pattern, such an &quot;account&quot; cannot be made; they have to get an &quot;invoice&quot; for each time they purchase something, with a unique Bitcoin receive address to which they send the amount. Again, the problem is that I fear that the transaction fees will put people off.
In general, how should I handle this?
Bitcoin transaction fees are usually calculated based on the size (in bytes) that the transaction takes up. This is a number known as 'fee rate', usually written as 'satoshis per byte', and the idea is that you are bidding for space within a block, where most miners will select transactions with the highest sat/byte fee to prioritize for confirmation. The average fee rate according to Bitinfocharts is about 97 sat/byte, meaning for each byte the transaction takes up, you add 0.00000097 BTC in fees. You can probably get away with using anywhere from 50-100 sat/byte and have your transaction confirmed within a reasonable amount of time. The value of the transaction in BTC is completely irrelevant.
If you're handling many withdrawals, often, service operators will batch the withdrawals of multiple users together into a single transaction to save on fees, by generating a transaction that has many outputs, one for each user's withdrawal. Alternatively, you could offer deposits and withdrawals through the Lightning Network to minimize fees.