opendexnetwork / opendex.network

Website 👋
https://opendex.network
GNU Affero General Public License v3.0
19 stars 10 forks source link

Free Options Problem #25

Open kilrau opened 4 years ago

kilrau commented 4 years ago

Moved here from https://github.com/ExchangeUnion/xud/issues/881:

Problem description: Read this or watch this, this for the full mailing list version.

TL,DR: the preimage holder (in our case always the taker) can delay the release of preimage from t0 to t1 and watch the market in the interval [t0, t1] and decide at t1 to execute the swap or not depending if the price agreed in the swap is better than the market at t1 or not. Release preimage if yes, fail the swap if no. This creates a free financial option for the preimage holder and is fatal for the non-preimage holder since her funds are locked up for the interval [t0, t1].

This issue is to collect discussion and research in two different directions

  1. how to reduce exposure to above described free option scenario and
  2. enforce <block (e.g. 10 seconds) timeouts for payment channel atomic swaps and to enforce releasing amounts in the HTLCs of the swap. Enforcing means the protocol can enforce this timeout without the the misbehaving party responding/cooperating. Currently the non-preimage holder can decide between waiting for preimage holder to finalize the trade or cancel the trade by uncooperative channel close and a lengthy 7 days cltv waiting time to get funds back. Both not very nice options.

We are currently aware of the following approaches: