What is a Hash Time-Lock Contract (HTLC)?

A hash time-lock contract (HTLC) is a type of smart contract that allows two parties to transact on a blockchain network in a trustless manner. It uses a cryptographic hash function and a time lock to ensure that the transaction can only be completed if certain conditions are met. It works because the sender generates a random value (the "preimage") and uses it to create a cryptographic hash. They then send the hash to the receiver along with the transaction…