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: