0

I have an Ethereum wallet address (the public key is known by other people). I periodically receive payment on this address (and cannot change it/receive to other address).

I need: When I receive a payment on it, automatically and immediately it sends/forward them to my new wallet address (the private key is known only by me).

Is this possible and how? I am new to programming, kindly inform me on how to begin doing this.

  • This is possible from a script running somewhere (e.g. a cron job). It's quite straightforward; come back with detailed questions if you run into trouble. – smarx Jul 7 '18 at 17:40
0

If you are new to programming, i would suggest you to first study javascript and understand how to work with NodeJs by hosting an application on a server such a Amazon Web Services (AWS).

With that, you will then need to set up an Ethereum node either using Geth or Parity on lightmode. After that, you will need to be able to understand this section of the document here to automate the payment by passing in the privateKey: http://web3js.readthedocs.io/en/1.0/web3-eth.html#sendtransaction

What you'll need to do first is to.

  1. Check you public address for balance if any using web3.eth.getBalance
  2. If balance is not the same as the previous amount, then send whatever amount you want to the new address using sendTransaction.
0

If you knew you would want to set this up in advance, you could use a contract as the initial receiving address and give it a fallback function to automatically forward your ETH. Note that this has the downside that sending to such a contract would require the sender to supply more gas than they normally would while making a transfer, which may cause some payments to fail if they don't realise they should do this.

However, it sounds like your address is already decided and shared, and you've used a normal Externally Owned Account rather than a contract. You can do this with a script polling for changes to the balance of your address, and creating a new transaction to send them on each time a significant amount arrives. See @Zinxer's answer for practical suggestions for how you might implement this.

Unfortunately this will require that a continually-running internet-connected computer somewhere has access to the private key of the receiving address, which is not ideal from a security perpective as if someone were to hack that computer they could steal the private key and take both funds in the address at the time, and any funds sent to it subsequently.

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.