What Is the Role of a “Hash Time Lock Contract” (HTLC) in Atomic Swaps?
An HTLC is a smart contract that enables trustless, cross-chain atomic swaps without an intermediary. It locks up funds on both blockchains using a cryptographic hash lock and a time lock.
Only a party who knows the pre-image (secret) of the hash can claim the funds, and they must do so before the time lock expires, ensuring that both legs of the swap are executed or neither is.