Author

Topic: Send from one address, pay fee from different address? (Read 300 times)

HCP
legendary
Activity: 2086
Merit: 4361
Generally, a wallet will just find inputs that add up to (at least) the amount you want to send+calculated fee... Which inputs are used is dependent on how the wallet is designed. Some will try to minimise the number of inputs to minimise transaction size by selecting the largest available inputs until the required amount is reached. Some wallets prefer to use oldest inputs first. Or, as mentioned above, some wallets allow you to choose the coins you want to use.

Anything left over, gets returned as change. Where the change ends up, is dependent on how your wallet works. Some wallets return it to one of the addresses used as an input. Some wallets create a new (change) address and put the change there. Some wallets let you choose if you want to use change addresses or not.

I'm not quite sure what it is that you're attempting to achieve by "sending a whole coin from one address and pay fee from another address"? Are you concerned that if you have say 1.0 BTC in addressA, and 0.001BTC in addressB that you want to use as fee and you want to send 1.0 BTC to your friend... that it will only let you send 0.999 BTC from AddressA after taking the 0.001 BTC fee from addressA?

With Electrum if you just put 1.0 BTC in the amount to send... it will add the fee on to the amount you're trying to send... it won't subtract it. So it would just use 1.0 from addressA and 0.001 from addressB... send 1.0 to your friend and use the 0.001 as fee.

The only time that this might not happen is if the amount you want to send+fee is greater than the wallet balance.
newbie
Activity: 23
Merit: 0
I think I need to just try it out by paying myself and see what happens!
legendary
Activity: 3472
Merit: 10611
If it is not too complicated, can you explain why letting the wallet choose is better?
because it complicates things, you selecting outputs manually, calculating if it is enough, making sure the transaction is confirmed that you are spending, and generally things like that.

Quote
Also held down CMD (on a Mac) and selected the coins to spend, and both showed up in a "From" box on the send tab as you said. I stopped there. Address A was 2 coins and (change) address B was say 0.84 and I wanted to send you 2 coins even.  If I did go through with the send, would it automatically send you 2 coins from address A and take the fee from the change address B? If Electrum starts by taking out the fees first, I would end up with change in A and B would be empty. A little arcane... and a tad OCD perhaps!

this is how a transaction and fee works:
when you spend bitcoin you are spending transactions, these transactions have a value. for example here is my bitcoin address: https://blockchain.info/address/1PHLkjiXvvUfw7AtZoPC6hhnNg6jZ836kw
0a927f86e75129a312d1e756cc1ded476fae6855aadec801c9885ed7c2f290f0 has a 0.03 value
13a4c5470acd599743073873294d64c5234a98281b4df9db9c0ec9a5471ad6a0 has a 0.0225 value
and so on.
my total balance is currently 0.16023 BTC

if i wanted to send you 0.01BTC i usually choose one of these outputs (for priority the oldest one is chosen = e506d3..... which is 0.035) and in the transaction that i make i put 0.01BTC in front of your bitcoin address to pay you that much and i am left with 0.025BTC.
now comes the fee part. i can send this 0.025BTC back to my original address or a new (change) address and how much i send there determines the fee. if can sent the whole thing and fee will be 0 or send 0.02 and fee will be 0.005
in other words there is no variable in a transaction saying fee is XX. instead it is calculated automatically based on leftover.

the other thing i can do is i can select all the outputs (all 6 of them total of 0.16023) and make a big transaction and send you your 0.01BTC and be left with 0.15023BTC which i can send 0.15 to a new address and fee will be 0.00023BTC

now what i mean by this is that it doesn't matter where those transactions are coming from (0a927f86e75.... and 13a4c5470a.... can belong to different addresses) in the end you are left with that total anyways and you can send the leftover to address A or address B or a new address C

makes sense?
newbie
Activity: 23
Merit: 0
yes. it is possible. however it is better if you let wallet choose it for you.

what you can do is first enable "coins" tab from "Wallet > Coins (Ctrl+c)"
then select the transaction outputs (coins) that you want to spend. hold down "Ctrl" key to select multiple and then right click and choose "spend".
you'll be directed to the "send" tab ready to spend "from addresses" that you want.

If it is not too complicated, can you explain why letting the wallet choose is better?

Also held down CMD (on a Mac) and selected the coins to spend, and both showed up in a "From" box on the send tab as you said. I stopped there. Address A was 2 coins and (change) address B was say 0.84 and I wanted to send you 2 coins even.  If I did go through with the send, would it automatically send you 2 coins from address A and take the fee from the change address B? If Electrum starts by taking out the fees first, I would end up with change in A and B would be empty. A little arcane... and a tad OCD perhaps!
legendary
Activity: 3472
Merit: 10611
yes. it is possible. however it is better if you let wallet choose it for you.

what you can do is first enable "coins" tab from "Wallet > Coins (Ctrl+c)"
then select the transaction outputs (coins) that you want to spend. hold down "Ctrl" key to select multiple and then right click and choose "spend".
you'll be directed to the "send" tab ready to spend "from addresses" that you want.
newbie
Activity: 23
Merit: 0
Would it be possible to send a whole coin from one address and the fee comes from the change purse?
Jump to: