Say I have 1 Bitcoin in my wallet. I need to pay my friend for something and it just so happens he will accept 1 Bitcoin as the payment. I send my friend my one and only Bitcoin because he is a good friend and the transaction gets confirmed.
All was fine until I went peeping under the hood. I'm running bitcoind so I ran the command listtransactions and looped over everything with an output of console.log(amount, fee).
See the picture below: (send, fee)
In reality I sent 14.3438969 Bitcoins to another address which was the entire balance of the wallet. Where could the fee (-0.0002) have come from? Since I sent the remainder of my coins there are no more to take to pay that.
First let me state that I actually sent the coins to a different address in the same wallet and if that's complicating the issue then I'm just a big dummy but I still don't get it. AFAIK senders get charged the fee? Is this correct? So that 0.0002 would get applied to the senders account (me). But I sent all of my coins so there are none left? Does this mean I have negative coins or that next time I receive part of that will pay the fee.
If anyone could address this and explain conceptually how the fees in the cases I have brought up would work it would be very helpful. I cannot seem to find the docs and who pays the fee, at won't point it's assessed, etc..