Glossary · deep dive

HTLC

Hash Time-Locked Contract: pay if you reveal a secret before a deadline, otherwise refund.

A Hash Time-Locked Contract is a conditional payment with two paths:

  1. Hash lock: the receiver can claim the money by revealing a secret (the preimage) whose SHA-256 hash matches a value fixed in advance.
  2. Time lock: if the secret is not revealed before a deadline, the sender gets a refund.

Why it matters

HTLCs let payments travel across several payment channels safely. Each hop locks money to the same hash. When the final receiver reveals the preimage to collect, every hop can use that same secret to collect from the previous one. Nobody along the route can steal the funds, and if something fails, the timelocks return the money.

HTLCs also make atomic swaps between blockchains possible.