0

Is there a smart contract or service that lets me input my Ethereum private key or any crypto private key for that matter and have the smart contract sweep or forward a portion of funds to another address in the future?

Basically its a "Cryptocurrency Smart Forwarding Service" if such a thing even exists.

0

To my knowledge, no such service exists, although building one would not be terribly difficult if you have access to a node.

Naturally, entrusting private keys to a third party is a terrible idea and you should absolutely not do this.

Using a smart contract is a lot easier. You can easily deploy a forwarding smart contract that forwards funds to a cold wallet, and simply share that contract's address with whoever is sending you ether. That way, regardless of when they send you money, it will automatically be forwarded to your address.

A very simple forwarding contract may look something like:

contract Forwarder {
  address public destination;
  constructor() public {
    destination = msg.sender;
  }

  function() payable public {
    destination.transfer(msg.value);
  }
}
  • What would be the benefit over simply sharing the wallet address? – Nicolas Massart Oct 10 '18 at 22:14
  • It's an easy way to manage incoming payments without managing a key for each sender. Many exchanges use such contracts, and give each use a contract address. This also allows them to update the cold storage address and reroute payments at any point (extensions are possible to allow erc20 transfers, although they can't be forwarded automatically). – Raghav Sood Oct 10 '18 at 22:54
  • ok, but not with the contract you indicated in your answer I guess. This one doesn't provide any update mechanisms and is not doing much than if we provide the account address directly, but it's just a simplified version of forwarder as I understand. – Nicolas Massart Oct 11 '18 at 5:06
  • Of course, that's just an example. A real implementation would ideally just be a proxy around a single forwarder instance, so that you can change the address in one place and update all your contracts at once. It would also ideally support ERC20 transfer functions (if done via a series of delegatecalls, you could build it to support standards that don't even exist yet. – Raghav Sood Oct 11 '18 at 5:08

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.