Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Mushoz on November 11, 2013, 11:35:05 AM



Title: Bitcoind Sendmany Change Address
Post by: Mushoz on November 11, 2013, 11:35:05 AM
I was wondering if it is possible to use sendmany to specify a change address. Say I want to send 1 BTC to address A while address B is the address from which the client is sending the Bitcoins (Because it's the only address in the wallet containing any BTC), which contains 5 BTC. Can I use sendmany to do the following:

Create a sendmany transaction that:
-Sends 1 BTC to A
-Sends 4 BTC to B

Because address B is the only address containing any BTC, it will use the BTC from that address as the inputs. Since the output amount equals the input amount, this leaves no unspent inputs, so the client won't send any change to a new address C.

So would this be possible? Or will I have to use raw transactions for this? I prefer not to use raw transactions if I don't have to, because of the added risks of bugs causing BTC losses.


Title: Re: Bitcoind Sendmany Change Address
Post by: deepceleron on November 11, 2013, 10:54:16 PM
There are a few cases where this will work as expected, like if you were to spend your entire wallet balance exactly including fees, then all wallet inputs will be spent as you specify. Otherwise, Bitcoin will compose a transaction from available inputs in a way that minimizes change, but spending an amount where the change is zero, given the automatic inclusion of unpredictable fees, is hard.

see coin control.