[Ethereum] How to spend ether from multiple accounts

accountsethertransactions

I would like to know how to send ether from multiple accounts. For example, suppose I have 3 accounts with 5 ether in each account, how do I send the total (15 ether) to an account in a single transaction? I'm asking because from what I understand the "from" parameter in "sendTransaction" only accepts a single account.

The reason I'm asking this is because I need to accept Ether payments in my system and I would like to generate a unique account for each deposit, but I'm not sure how to spend the Ether I receive without having to send multiple transactions.

Thanks!

Best Answer

This is a fundamental difference between Bitcoin and Ethereum.

In Ethereum having multiple accounts is not like having multiple unspent transactions in Bitcoin, because each Ethereum account has it's own private key and a balance.

Therefore you would have to separately sign each payment from each account - in effect creating a separate transactions everytime.

There are two points that I see with this, the first is that with short block times, you are not penalised in terms of lost time if you are creating multiple payments, and the second is that the fees for each payment are applicable for each payment rather than one overall calculated fee.

If all the accounts were part of a multisig-ring payment this might work however, but it is not very flexible if you only wanted to use one account for something.

Related Topic