Original HTLC
Introduction to original atomic swaps and their challenges
Atomic Swaps (HTLC - Hashed Time Lock Contract) enable peer-to-peer asset exchange without requiring one chain to know the state of the other. The user generates a secret and locks funds on the source chain, the Solver locks funds on the destination chain, and they exchange the secret to unlock their respective funds, with a time limit ensuring fund retrieval if the exchange fails.
The standard HTLC flow
User Lock
The user generates a secret S and computes hashlock HASH(S), then creates an HTLC, locking funds for the selected Solver in the source network.
Solver Lock
The Solver detects this HTLC and creates a counterparty HTLC with the same hashlock, locking funds for the user (initial amount minus the Solver fee) in the destination network.
User Unlock
The user detects the HTLC in the destination network and reveals S to claim the funds.
Solver Unlock
The Solver detects the revealed S and reveals it in the source network to claim their funds.
Challenges with HTLCs
Despite their potential, HTLCs have proven impractical for real-world bridging due to three main issues:
- Secret Management: Users must generate and securely manage a secret until the counterparty completes their transaction.
- Claim Transaction on the Destination Chain: Users may lack assets on the destination chain, especially if it’s their first time interacting with that network.
- Liveness: Users must maintain the state of the bridging process locally and actively monitor and respond to counterparty transactions.
These challenges significantly impact the user experience and create barriers to adoption. The requirement for users to have assets on the destination chain is particularly problematic, as it creates a chicken-and-egg situation for those trying to bridge to a new network for the first time. Furthermore, the user managing the secret creates a dependency issue. If the user closes the browser, clears the cache, or loses access to the secret, the transaction flow cannot be recovered from the chain data.
Was this page helpful?