Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: r3wt on May 24, 2013, 04:42:05 AM



Title: Help 4 friend. script multiple payments via list of addresses
Post by: r3wt on May 24, 2013, 04:42:05 AM
he is currently running a bitcoin faucet script he downloaded from god knows where. he got hacked, and his money was drained. in order to advert this, he has decided he wants to manually send then via his home computer. i've already scripted it up to save the addresses to a text file he can login to the admin interface and copy and paste into a script. i do not know the first thing about the bitcoin client, and i was wondering if it were possible to script multiple payments by copying the addresses into a config file or some type of script. he lost almost everything but is willing to make a donation to anyone who can help solve this problem.


Title: Re: Help 4 friend. script multiple payments via list of addresses
Post by: scintill on May 24, 2013, 10:03:37 PM
The "sendmany" RPC command (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) is what you want.  I think the default "account name" is just an empty string.  So if your script can generate a command like
Code:
sendmany '' '{"1qkfasdf...":0.01,"1ert90lO...":0.01}'
, in new bitcoin-qt clients you can paste that into the debug console (Help > Debug window > Console) and it should send the specified amounts to the specified addresses, in one transaction.


Title: Re: Help 4 friend. script multiple payments via list of addresses
Post by: r3wt on May 24, 2013, 10:31:36 PM
The "sendmany" RPC command (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) is what you want.  I think the default "account name" is just an empty string.  So if your script can generate a command like
Code:
sendmany '' '{"1qkfasdf...":0.01,"1ert90lO...":0.01}'
, in new bitcoin-qt clients you can paste that into the debug console (Help > Debug window > Console) and it should send the specified amounts to the specified addresses, in one transaction.

thanks man! you have given me a great idea how to accomplish this in a way where my client can login, copy the script from a text field that loads the file, paste it into the console and then clear the text file and save it. thanks again so much!!! pm me where to send a donation.


Title: Re: Help 4 friend. script multiple payments via list of addresses
Post by: scintill on May 25, 2013, 12:38:16 AM
thanks man! you have given me a great idea how to accomplish this in a way where my client can login, copy the script from a text field that loads the file, paste it into the console and then clear the text file and save it. thanks again so much!!! pm me where to send a donation.

No problem, and thank you for the donation!  I will PM.  I will try to help if you have further questions.  One thing I am not sure of is accounts, but I know there is a "listaccounts" command to see the balances of the accounts and "move" to move a sum from one account to another (not a blockchain transaction, just bookkeeping within the client.)  The page I linked has information on those commands.


Title: Re: Help 4 friend. script multiple payments via list of addresses
Post by: Raoul Duke on May 25, 2013, 12:43:57 AM
Just be careful not to have repeated addresses on the list or it will fail.


Title: Re: Help 4 friend. script multiple payments via list of addresses
Post by: scintill on May 25, 2013, 12:57:07 AM
Just be careful not to have repeated addresses on the list or it will fail.

Good point, you would have to sum up repeated address payouts first.