- Does sendtoaddress automatically collect as many unspent outputs as needed?
- Is there any way to specify the from address?
- How is the fee computed? I just tested with two transactions: a) 0.0001 xbt, fee 0.00017519 b) 0.001 xbt, fee 0.00017441.
1) Yes. See this question for more detail.
2) The from address will be an array of address that hold the unspent outputs. If you want to select which outputs are sent and from what address, you can use coin control in the QT wallet, or you can create a raw transaction using
3) Fee is computed by the number of bytes your transaction has, not necessarily the amount of the bitcoins you send. If you have a lot of small unspent outputs that go into your transaction it will make the transaction larger and thus a larger fee.
The code for the fee calculations
As of right now it looks like the tx fee per 1,000 bytes is 10,000 satoshis (0.00010000) to create a transaction.