Post
Topic
Board Bitcoin Technical Support
Re: btc wallet features
by
DannyHamilton
on 26/10/2017, 15:44:16 UTC
If we have 10 unspent outputs in a wallet, instead of sending to one address, if it sends to 10 different addresses, the fee will also be much greater?

The fee is the same on a "per byte" basis regardless of how many addresses, inputs, or outputs you have.  What changes is how many bytes it takes to create the transaction.

Creating a transaction requires approximately 10 bytes to start with. Then, each unspent output that you use as an input to fund the transaction adds approximately 149 bytes.  Each new unspent output that you create (each recipient that you send to) adds 34 bytes.

So, if you pay a fee of 0.00000100 BTC per byte, and you spend (use as inputs) 3 unspent outputs to send to 4 addresses...

10 + (149 * 3 inputs) + (34 * 4 outputs) = 593 bytes
593 bytes * 0.00000100 BTC per byte = 0.000593 BTC fee

However, if you pay the exact same fee of 0.00000100 BTC per byte, and you spend (use as inputs) 4 unspent outputs to send to 2 address...

10 + (149 * 4 inputs) + (34 * 2 outputs) = 674 bytes
674 bytes * 0.00000100 BTC per byte = 0.000674 BTC fee

As you can hopefully see, it isn't as simple as "which wallet is cheaper" or "will more addresses make it more expensive".  It all depends on how you receive the bitcoins, and how you structure the transaction.

If we have different addresses in a wallet with different amount of unspent outputs, the choice of which output to be spent choosing by the wallet will affect the size of the transaction?

Some wallets offer a feature called "coin control" that allows the user to choose which unspent outputs they want to spend as inputs in the transaction they are creating.  Also, Bitcoin Core has a command "createrawtransaction" that allows you to choose exactly which unspent outputs you want to spend as inputs, and exactly which new outputs you want to send the bitcoins to.