Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: throwaway084575 on June 09, 2014, 03:03:53 PM



Title: how to send multiple payments without waiting for change?
Post by: throwaway084575 on June 09, 2014, 03:03:53 PM
So we are building a web app and want people to be able to withdrawal their bitcoins when ever they want as fast as possible. But how do other services deal with multiple people requesting a payout when 1 payout has to wait for a confirmation to get the change back to send the next payment?

Im guessing that createrawtransaction can spend from a given input so that the rest can stay put for another transaction but how can one automate this?

Is there an open source hot wallet software that deals with these issues?

Something that has an API so our app can talk to it and control it?

I noticed blockchain.info has a sendmany method in their API but yeah 3rd party issues.


Title: Re: how to send multiple payments without waiting for change?
Post by: gmaxwell on June 09, 2014, 05:42:43 PM
First and foremost, use sendmany. I don't understand why you're bringing up bc.i.

Technically you can spend unconfirmed outputs, but it's advisable to avoid it.

For high throughput environments you should also avoid merging your coins beyond the amounts you'll be paying where you can, so that you'll have more outputs to spend.


Title: Re: how to send multiple payments without waiting for change?
Post by: throwaway084575 on June 11, 2014, 04:18:23 PM
Thanks for your great advice gmaxwell and thanks for all your amazing work on bitcoin, especially the coinjoin stuff, amazing. 

So the problem is people may randomly ask for withdrawals and sendmany will mean we send out in batches through some type of cron.

When you say that it is advisable to avoid spending unconfirmed outputs, What can go wrong?

We hope to have a higher throughput eventually so to avoid merging coins like you advise is there a function or setting in bitcoin core? which software would be best used as a hotwallet?



Title: Re: how to send multiple payments without waiting for change?
Post by: Rannasha on June 12, 2014, 05:38:28 AM
Thanks for your great advice gmaxwell and thanks for all your amazing work on bitcoin, especially the coinjoin stuff, amazing. 

So the problem is people may randomly ask for withdrawals and sendmany will mean we send out in batches through some type of cron.

When you say that it is advisable to avoid spending unconfirmed outputs, What can go wrong?

We hope to have a higher throughput eventually so to avoid merging coins like you advise is there a function or setting in bitcoin core? which software would be best used as a hotwallet?

The problem with spending unconfirmed outputs is transaction malleability. If the txid of the first transaction in a chain is changed, all transactions that use outputs from this first transaction become invalid.

If you want to avoid sending withdrawals in batches, you could look into splitting large outputs (such as transfers from a cold wallet) into several smaller ones periodically. That way a single small withdrawal doesn't lock too many coins in an unconfirmed change output.