1

For example, I have 3 accounts with balances:

1 account - 5 ether

2 account - 15 ether

3 account - 7 ether

I want to send 20 ether, so it will be used 1 and 2 account. I understand, how to make through just simple transactions, but for this will need to pay fee for every transaction. And for every transaction, before send, I need to unlock account. Contract can't unlock account, so I don't understand how will ether withdraw from this accounts and how it could have a permission to do this. Please help.

2

Short: You cannot send from multiple accounts in one transaction.

Long: Every account is controlled by its associated private key. That means all Ether that leave this account need to be signed by that key and then the signed transaction broadcasted to the entire network. Therefore you cannot just have one transaction that sends Ether from three private key controlled accounts. What you could do is have a multi-signature smart contract. This contract would hold all Ether and you could, e.g. have any one of the three accounts control it. This allows you to still send funds if you have lost the key to one account. Note that at the same time it means that all funds are at risk if an attacker gains access to any of those three private keys. Therefore you might be better of setting up a 2-of-3 multisig and need 2 out of all 3 private keys signing a transaction. Read here more on multisig smart contracts for Ethereum.

  • @Sebastian, So multi-sig contract allow to withdraw money from 3 accounts and make inner transactions call? Or this 3 accounts have access to ether to each one? – DeV1doR Jul 7 '17 at 11:10
  • The former: A multisig is actually a smart contract that holds the funds (not the private key controlled accounts!). You can choose a multisig in which e.g. all three private key controlled ccounts can spend from that multisig contract. keep in mind that you do need a (small) amount of Ether on each of the three accounts in order to pay for the transaction costs (gas). For now smart contracts never pay for gas. This might change in the long run but not too soon. So for now you just need to keep sufficient ETH on your private key accounts to pay for the gas. – Validity Labs - Sebastian Jul 7 '17 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.