How to calculte the transaction fees,0.00011689?
price_per_byte is the key that effect transaction cost for user. Generally standard fees for price_per_byte = 206 satoshi per byte which is too costly and higher for user, we can reduce it upto 2 satoshi. it will cost very low.
206 satoshi per byte transaction completes in very next block or in very next transaction means immediately. while 2 satoshi per kb transaction takes upto 2 to 3 hours to complete transaction.
general transaction space will be 224 to 299 kb if user send BTC to single user amount is not the matter here, so transaction cost will be very low based how much satoshi amount user has setup for transaction.
generally you can calculate the fees based on this formula:
fee = (n_inputs * 148 + n_outputs * 34 + 10) * price_per_byte
So you would have to know how many inputs are necessary for your transaction, and usually you have two outputs. To further understand these details, one would have to have a look at how transactions are set up in the ecosystem (bitcoin.org -> developper section is a good start).
Assuming you have one input, and two outputs, this sums up to ~350 Bytes, multiplied with 35 Satoshi per Byte would a near value of your picture. So there is a value slightly less than 35 Satoshi per bytes chosen.
- How does the client (on screenshot) calculates fees?
- How to calculate fees in your own environment?
a1) Depends on client
a2) There are many ways. For example, you can make the transaction twice: first time create and sign it with zero fees, take the size in bytes and multiply by the rate you want to. Next create final transaction with wanted satoshi-per-byte fee.