Technocore · atomic swaps

Swap Safety Check

An HTLC swap is two locks on one secret. Before you lock, check two things: that the timeouts are in an order where you cannot be robbed, and what the free option you hand the secret holder is worth. Nothing you type leaves this page.

Result

Free option the secret holder gets-
… in dollars on this amount-
First refund vs second-
Gap between the two refunds-
-

How to read it

The order. Whoever holds the secret locks first and must give that lock the longer refund. The second locker needs time, after the secret is revealed, to see it, claim and reach finality before the first lock refunds. If the first lock refunds too soon, the secret holder can take your coins and get their own back. Practice is about 2x (48 h / 24 h in Han, Lin and Yu); Lightning uses a margin of at least ~34 blocks between hops.

The free option. Between the second lock and the reveal, the secret holder can wait and walk away if the price moves against them. That is an at-the-money option, worth about 0.4 × volatility × √time × amount. For crypto at 48 h / 24 h, Han, Lin and Yu put the fair premium at roughly 2-3%. Shorter windows shrink it with the square root of time: ask for a premium, or shorten the window.

Sources: Han, Lin & Yu, "On the optionality and fairness of Atomic Swaps" (AFT'19) · BOLT 2, cltv_expiry_delta · Ethereum finality.

Built by Vendetta Games. A rule of thumb for rehearsal, not financial advice: it prices the option with a simple approximation and assumes the refunds are measured from now. Technocore Identity Kit