Bitcoin Forum

Bitcoin => Project Development => Topic started by: Initscri on May 22, 2014, 05:55:40 AM



Title: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: Initscri on May 22, 2014, 05:55:40 AM
Bitcoin Transaction Splitting Script

I recently created a script for the splitting of Bitcoin transactions based off the BlockChain.info API for cooldgamer (https://bitcointalk.org/index.php?action=profile;u=79720).

Within the middle of the messages, he requested and asked if the script could be licensed as open source; and as such, here we are! Thank you to cooldgamer for providing the bounty.

This script uses the BlockChain.info API to split Bitcoin Transactions to a Bitcoin Address based off a certain percentage.

For example, you can send 1 Bitcoin to ADDRESS1
and you can have it setup to split the transaction to send:
.4 Bitcoins to ADDRESS2 (40%)
.2 Bitcoins to ADDRESS3 (20%)
.05 Bitcoins to ADDRESS4 (5%)
.35 Bitcoins to ADDRESS5 (35%)

It works with any amount of outputs and includes fee calculation (w/ custom fee (optional)).

Obviously, a fair warning: This script is a tad bit messy. It works, but I recommend testing the script on a smaller scale before production use. It has and is being used within production for certain users already.
I am not responsible for any lost funds or any loss whatsoever by the use of this script whether in production or development.

The script is located on Github.

https://i.imgur.com/3N8aR63.png (https://github.com/Initscri/BTC-Split-Script--PHP-)
Read readme.md for installation and setup instructions.

If you wish to be so kind to donate, you can send donations to :
16E4K1oDxefRAbLGS2Fh42C4SXgZMjeL3i

Thank you,
Initscri


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: Initscri on May 29, 2014, 12:31:27 AM
Also, to note. It is better to utilize allow_url_fopen within your php.ini configuration.

The script does support curl but is untested.


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: BitCoinDream on July 06, 2014, 10:04:34 AM
Does not blockchain.info directly offer this API for multi-send ?


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: 1000000 on July 07, 2014, 07:37:07 PM
Does not blockchain.info directly offer this API for multi-send ?
My thoughts exactly, what's wrong with just using the API directly?
Code:
https://blockchain.info/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&shared=$shared&fee=$fee


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: Initscri on July 07, 2014, 08:09:56 PM
Does not blockchain.info directly offer this API for multi-send ?
My thoughts exactly, what's wrong with just using the API directly?
Code:
https://blockchain.info/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&shared=$shared&fee=$fee

This script is intended to be used for callbacks.

The specific use case for the client who requested this script was to make a forwarding address. Specifically, where when a specific address receives a transaction, the amount is split and sent to multiple other addresses based on a percentage value. This whole process happening automatically and without delay (with the availability for confirmation delay).


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: BelieveTheHype on July 09, 2014, 03:16:00 AM
Does not blockchain.info directly offer this API for multi-send ?
My thoughts exactly, what's wrong with just using the API directly?
Code:
https://blockchain.info/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&shared=$shared&fee=$fee

This script is intended to be used for callbacks.

The specific use case for the client who requested this script was to make a forwarding address. Specifically, where when a specific address receives a transaction, the amount is split and sent to multiple other addresses based on a percentage value. This whole process happening automatically and without delay (with the availability for confirmation delay).

Hi Initscri. I recently started a project that will most probably involve using this code you have put up. If I am able to bring my project to life successfully, I shall certainly donate for your addition to the community. I also wanted to see if needed, you might have to time to help a bit more on the project itself. I am not sure as of right now if additional help is needed as I'm waiting for my developer to figure out how large scale the project will be.

Thanks
A Believer



Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: Initscri on July 09, 2014, 03:18:53 AM
Does not blockchain.info directly offer this API for multi-send ?
My thoughts exactly, what's wrong with just using the API directly?
Code:
https://blockchain.info/merchant/$guid/sendmany?password=$main_password&second_password=$second_password&recipients=$recipients&shared=$shared&fee=$fee

This script is intended to be used for callbacks.

The specific use case for the client who requested this script was to make a forwarding address. Specifically, where when a specific address receives a transaction, the amount is split and sent to multiple other addresses based on a percentage value. This whole process happening automatically and without delay (with the availability for confirmation delay).

Hi Initscri. I recently started a project that will most probably involve using this code you have put up. If I am able to bring my project to life successfully, I shall certainly donate for your addition to the community. I also wanted to see if needed, you might have to time to help a bit more on the project itself. I am not sure as of right now if additional help is needed as I'm waiting for my developer to figure out how large scale the project will be.

Thanks
A Believer



Hi,

Awesome. I'm glad to hear it is being put to good use. As for the employment opportunity (freelance), I would happy to help. Just PM me the specifics and details of the project when you have a better understanding of the scale of the project.

Thanks,


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: BelieveTheHype on July 09, 2014, 03:35:17 AM
awesome.. Will def. keep you up to date.
Question. Did we figure out if there is a limit to the amount of addresses you can send it to? I heard someone mention 30, but then also read its being used in production by a few entities. So I figured I would just ask you.

-A


Title: Re: [ANN] Bitcoin Transaction Split Script using BlockChain.info API
Post by: Initscri on July 09, 2014, 03:58:44 AM
awesome.. Will def. keep you up to date.
Question. Did we figure out if there is a limit to the amount of addresses you can send it to? I heard someone mention 30, but then also read its being used in production by a few entities. So I figured I would just ask you.

-A

I have only tested up to 15 with this script. However, the script can support as many as BlockChain.info's sendmany API will allow (which I think may be unlimited).

I'd recommend you test the script before production with an estimate of the amount of addresses you require.