I have seen this discussed here but didn't get a satisfactory answer. What is the recommended way to send ether to multiple recipients?
One way that I have thought of is follows:
Deploy a smart contract that accepts ether from any account along with a list of recipient addresses+amounts.
The contract splits the funds to the various accounts. However, I have some concerns:
What if the recipient is a contract that has some weird code in its fallback function? There may be other security issues too.
What is the best way to do this? Is there a well tested smart contract that takes care of the border cases that I can reuse?
If it helps, I am using Web3j and Ethereumj to interact with the blockchain.
EDIT: An alternate way is to send multiple transactions and not use a contract at all. Is there any economical benefit of the contract? It seems that even via a contract, Ethers are sent to multiple addresses and would incur linearly increasing cost. Is this correct? Are the costs similar?