Assuming we have two parties (A & B). How the following scenario be achieved using smart contracts?

User A will deposit some funds (x coins). user A can receive penalty funds from user B, So user B will also deposit funds (y coins).

if, within certain time (time locked), B provides a preimage to a certain hash value. Then, he gets the x coins and the B coins (y coins) back. otherwise A can get his coins back and also the B'coins (y coins) ?

A related nice answer is in here:

1.Zero knowledge contingent payment on etherum?

  1. Is the following scenario doable by a smart contract?

Your Answer

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

Browse other questions tagged or ask your own question.