I have a vast amount of Ethereum wallets, all packed with Ether. I need to transfer all the Ether to a single account. I don't want to do it manually. Is there a way to script it or use a smart contract or anything else?

3 Answers 3


There is going to be a level of manual work that will be unavoidable since each wallet will need to be recognized and unlocked via a private key.

You could use web3 and some sort of key/value formatted data and loop through that to unlock and send the ether balance (minus gas) to whatever account you want to send it too.

  • That's what I was thinking about. I have a csv file with the public keys of the wallets. So I would first go and check the balance and calculate the gas, as I want to fully withdraw everything from the wallets. Than I would use my list with privat and public keys to generate the transactions and to sign them. Do you think this should work this way?
    – Manuel
    Commented Apr 30, 2018 at 14:26

You can use web3js or web3py, as you do not seem to have the accounts linked to a node with a json file per account, you can use web3 to get the balance of each account then build the transaction locally, sign it with the corresponding private_key and send sendRawTransaction. Then repeat for every account.

You can see how to sign using your private key and send raw transactions here


I also have a similar sort of situation. I have an HD wallet and many of the child addresses will have Ethereum. So my plan is:

Loop through each index (address) in the HD wallet and check the balance. If the balance is found create a send transaction with a locally signed and keep it in memory. At the end of processing, send all the transactions as a batch to an Ethereum node.

Is this the right/best approach?

I am creating a crypto exchange and I am giving each customer a address from my HD wallet (using index) and so I can recover all eth from HD wallet which will have eth from multiple customers. Please suggest, if this is the right approach?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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