Skip to content

Hashed Timelock Contract

  • Jon Hodl 
What Is An HTLC?

What Is A Hashed Timelock Contract?

A hashed timelock contract is a smart contract that allows anyone to lock bitcoin at an address until certain conditions have been met. For example, one party might require that the other party provide proof of receipt before the funds are released. HTLCs are often used in conjunction with payment channels, such as the lightning network, to facilitate trustless payments.

If you’ve been involved in the bitcoin space for any length of time, you’ve probably heard of the Lightning Network. The Lightning Network is a payment protocol that uses smart contracts to enable trustless, near-instant payments between two parties. A key component of the Lightning Network is the Hashed Timelock Contract (HTLC).

An HTLC is typically made up of two parts: a hash lock and a timelock. The hash lock is a cryptographic math equation that must be solved in order to release the funds. The timelock is a mechanism that ensures that the funds can only be released after a certain amount of time has elapsed. This combination of hashlock and timelock makes it virtually impossible for one party to cheat or defraud the other.

HTLCs are commonly used in conjunction with payment channels, such as the Lightning Network. Payment channels are off-chain transactions that are only broadcast to the blockchain when they are finalized. This allows for much faster and cheaper payments, as there is no need to wait for confirmations from the blockchain. However, it also means that there is a greater risk of one party defaulting on the payment. To mitigate this risk, HTLCs are often used to lock up funds in escrow until both parties have signed off on the transaction.