Hash Time-locked Contracts (HTLCs)

One of the earliest models developed to enable cross-chain operations was Hash Time-locked Contracts (HTLCs), which employs hash locks [10] and timelocks [11] to ensure that the operations remain atomic. Even though HTLC implementations differ across projects, the overall concept remains the same [12].

How do HTLCs work?

To understand how HTLCs enable cross-chain swaps, consider the following scenario: Alice has a token X on Chain A and wishes to trade it with Bob, who has token Y on Chain B.

Step 1) Alice hashes a secret code to obtain hash lock h1. Alice also generates a timelock t1 corresponding to an upper bound in which the hash lock can be unlocked.

Step 3) Bob acknowledges that Alice has locked her funds.

Step 7) If the swap does not go through, Alice and Bob can claim their funds back once the timelock on the individual contracts expires.


One upside of using HTLC techniques is that they do not introduce any trust assumptions. However, they suffer from a range of issues that limits their efficacy.

  • They require all the concerned parties to always be online. Both the sender and the receiver need to monitor the involved blockchains during execution actively.

  • They are very slow and inefficient since every cross-chain swap requires a total of four transactions (two on each blockchain) [13].

  • Given the high fees and waiting periods involved with HTLC-based swaps, the scalability of this approach is also a concern.

Last updated