Skip to main content

How Do Hash Time-Locked Contracts (HTLCs) Ensure Trustlessness in an Atomic Swap?

HTLCs require both parties to create a cryptographic hashlock and a timelock. Party A sends funds locked by a secret key's hash.

Party B sends funds locked by the same hash. To claim Party A's funds, Party B must reveal the secret key.

Once revealed, Party A can use that same key to claim Party B's funds. The timelock ensures funds are returned if the swap is not completed within a set time.

This eliminates counterparty risk.

How Do Hash-Based Commitments, like Hash Time-Locked Contracts (HTLCs), Facilitate Cross-Chain Atomic Swaps of Options?
What Is a ‘Hidden Limit Order’ and Is It Compatible with Stop-Limit Functionality?
Define “Atomic Swap” and Its Role in Trustless Cross-Chain Trading
What Is the “Nothing at Stake” Problem in PoS and How Is It Addressed?