What a great opportunity to share some of my experiences.
It took some hairs being pulled out, but I finally managed to get sendmany to work. Some observations (in decreasing order of triviality):
1. You run bitcoind from the daemon folder with one of the commands in
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list.
2. You should specify the application data directory, if it is not the default, with -datadir=
your_directory before the command.
3. You should unlock the wallet with walletpassphrase.
4. Your bitcoin.conf file should have settings to allow this, my own file looks exactly like this:
# JSON-RPC
server=1
rpcuser=a
rpcpassword=b
rpcallowip=10.0.0.*
rpcport=8332
5. You can't use sendmany from an account which has no sufficient funds. However, you can move funds from one account to another even if the first account hasn't sufficient funds, and simultaneously creating the sending account if it does not exist.
6. On Windows, addresses should be triple-double-quoted.
So it can look for example like this:
bitcoind -datadir="C:\Bitcoin" walletpassphrase JustSomePassword 20
bitcoind -datadir="C:\Bitcoin" move "Sendmany sink" "Sendmany source" 0.003
bitcoind -datadir="C:\Bitcoin" sendmany "Sendmany source" {"""1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW""":0.001,"""1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac""":0.001,"""1HUrNJfVFwQkbuMXwiPxSQcpyr3ktn1wc9""":0.001}
Both account names can be entered verbatim and needn't exist in advance.
However, after so doing I realized that the Bitcoin-qt GUI displays a list item for every address to which payment was sent this way. This is incredibly messy and I didn't want it.
So I ended up using blockchain.info MyWallet for this. I hoped it would have an interface where you can paste a tsv of addresses and amounts to send, but I could find no such thing. What it does have is an HTTP GET API. The syntax is available at
https://blockchain.info/api/api_send. So after moving funds to MyWallet, you can enter this in your browser URL bar:
https://blockchain.info/merchant/your_id/sendmany?password=your_password&recipients={"1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW":100000,"1BTC1oo1J3MEt5SFj74ZBcF2Mk97Aah4ac":100000,"1HUrNJfVFwQkbuMXwiPxSQcpyr3ktn1wc9":100000}
Note that unlike bitcoind sendmany, the MyWallet API takes amounts in satoshis.
This doesn't cover the problem of how to generate the JSON parameter encoding all actual payments; this can be done with some Excel-fu and/or search-replace. I have put up an example at
https://bitcoil.co.il/Sendmany-example.xlsx; the payment per share is in A1, the addresses and share counts are in columns B-C, D and E should be completed down. The last row of E is the recipients parameter in MyWallet format.
Is there a limit with "sendmany" ?
There shouldn't be, but a limitation may exist because of the interface used. The command line may have a limit on the number of characters you can use it for; when using the MyWallet GET API there is a browser limit on the characters in the URI. I have successfully used the latter to send to 88 addresses with a 3606 character URI. If the API also accepts POST it could be more scalable, but slightly harder to use.
try to avoid making double payments by accident.
One added benefit of using MyWallet as I described is that you can load it with only as many bitcoins as you intend to pay, making it much harder to make double or otherwise erroneous payments.
however big transactions might become exponentially expensive due to blockchain spam prevention.
The word "exponentially" is commonly misused to describe things which show only polynomial growth (or no asymptotic growth at all). Here is a rare example of misusing it to describe hyperbolic growth (as the total block size approaches the limit, the transaction fee has a vertical asymptote with a simple pole).