oh its similar with gas fee on ethereum but its usually calculated by the wallet buy you can still reduce it right
This is how it works:
Blocks have a limit block size, in bytes (it is actually
virtual bytes, but lets keep things simple).
And each transaction has a different size. The more inputs/outputs you have, the bigger the transaction size will be.
You can set how much fee per byte you are going to pay (the fee rate), which is measure in sat/byte (satoshi per byte). Miners will put the transaction with higher fee rate in the block first. When the block is full, transaction which paid higher fee rate will be confirmed and those who paid less will stay in the mempool.
So, how do you reduce total fees???
You can reduce transaction size by using
segwit or reducing
inputs and
outputsAnd you can reduce the fee rate, which will reduce the total fees as well, but it will make your transaction get confirmed later on...