5

I would like to lock my ether in an account 90 days. Is there a way of doing this? How can it be done? Would it be a smart contract?

eth
  • 85,679
  • 53
  • 285
  • 406
Patoshi パトシ
  • 4,800
  • 7
  • 45
  • 93

1 Answers1

5

Yes, you would need a smart contract. You would send the contract a certain amount of ETH and the contract would hold it. You would then need a withdraw function that would check to see (1) if you are the owner and (2) if the time has expired. If the conditions are not met, it doesn't do anything. If the conditions are met, it always you to withdraw.

ryepdx put together a "weak hands" contract a while ago to do exactly this. I haven't used it myself so you will want to look over the code and test with a small amount first to make sure everything goes as intended. It's also almost 200 days old so you'll really want to test it in case anything broke during homestead.

tayvano
  • 15,961
  • 4
  • 45
  • 74
  • can it be withdrawn automatically when it reaches 90 days? – Patoshi パトシ May 05 '16 at 20:29
  • 1
    Something has to call to withdraw, however, you could use something like http://www.ethereum-alarm-clock.com/ to make a call at a specified block and you can estimate time based on # of blocks so yes. It's just a bit more complex. – tayvano May 05 '16 at 22:25