Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: MaximC on December 17, 2016, 08:40:33 AM



Title: Split bitcoin payment
Post by: MaximC on December 17, 2016, 08:40:33 AM
Is here any open source software / script to split bitcoin transaction into two?

IN transaction 1 - OUT transaction A, transaction B

transaction A is predefined address with predefined amount.
transaction B is the rest of money and variable address (anytime other).

Thank you.


Title: Re: Split bitcoin payment
Post by: longbob72 on December 17, 2016, 08:47:14 AM
If I understood you correctly, you wish to use 1 input in 2 different transactions? That's not possible (only one transaction can get confirmed).


Title: Re: Split bitcoin payment
Post by: MaximC on December 17, 2016, 08:53:55 AM
If I understood you correctly, you wish to use 1 input in 2 different transactions? That's not possible (only one transaction can get confirmed).

I know that is possible do the script in transaction and after the transaction is done, can be next two transactions.
just split the transaction in any way.


Title: Re: Split bitcoin payment
Post by: longbob72 on December 17, 2016, 09:29:10 AM
Now that I think about it, you referred the outputs as different transactions.
Just in case that you're not aware, a transaction can have more than one output addresses. An input can't be used in multiple transactions but you can "split" the bitcoins from one input to many addresses in a single transaction. Most wallets does this automatically with change addresses.

You really don't need any script to split the coins unless you're looking for a way to make transactions automatically.


Title: Re: Split bitcoin payment
Post by: MaximC on December 17, 2016, 09:31:54 AM
Now that I think about it, you referred the outputs as different transactions.
Just in case that you're not aware, a transaction can have more than one output addresses. An input can't be used in multiple transactions but you can "split" the bitcoins from one input to many multiple addresses in a single transaction. Most wallets does this automatically with change addresses.

You really don't need any script to split the coins unless you're looking for a way to make transactions automatically.

You are true.
But i am searching for automation.


Title: Re: Split bitcoin payment
Post by: shorena on December 17, 2016, 10:15:44 AM
Now that I think about it, you referred the outputs as different transactions.
Just in case that you're not aware, a transaction can have more than one output addresses. An input can't be used in multiple transactions but you can "split" the bitcoins from one input to many multiple addresses in a single transaction. Most wallets does this automatically with change addresses.

You really don't need any script to split the coins unless you're looking for a way to make transactions automatically.

You are true.
But i am searching for automation.

Its probably possible with the bitcoin core build in API or any other API. The question is why, as this would increase the UTXO set and result in higher fees for you over time.


Title: Re: Split bitcoin payment
Post by: MaximC on December 17, 2016, 10:25:22 AM
Now that I think about it, you referred the outputs as different transactions.
Just in case that you're not aware, a transaction can have more than one output addresses. An input can't be used in multiple transactions but you can "split" the bitcoins from one input to many multiple addresses in a single transaction. Most wallets does this automatically with change addresses.

You really don't need any script to split the coins unless you're looking for a way to make transactions automatically.

You are true.
But i am searching for automation.

Its probably possible with the bitcoin core build in API or any other API. The question is why, as this would increase the UTXO set and result in higher fees for you over time.

I am try find the way have some part of money from transaction and rest send to address.
Not sure how it can be done.


Title: Re: Split bitcoin payment
Post by: shorena on December 17, 2016, 11:04:45 AM
-snip-
I am try find the way have some part of money from transaction and rest send to address.
Not sure how it can be done.

This is a normal wallet process called change, every wallet can do it and most APIs do it for you when you issue a payment.