Blockchain concepts explained with care and context.

A hash time-locked contract needs both a secret and a deadline

A computer-security desk with a small padlock, hourglass and a generic network of connected nodes on a screen.
AI-generated photographic illustration; not documentary photography.

A conditional payment needs an answer to two questions: what allows the recipient to claim it, and what happens if that condition is never met? A hash time-locked contract, or HTLC, combines a cryptographic condition with a deadline-related recovery path.

The Lightning Labs Builder’s Guide explains the hash condition using a preimage: a secret value whose hash matches the value specified in the contract. Revealing the correct preimage can satisfy the payment condition.

The timeout prevents an indefinite wait

Without a timeout path, a payment could remain unresolved if the required secret never appears. Lightning’s timelock documentation explains the use of expiry conditions in this process. The precise mechanism depends on the transaction and channel state; an expired deadline is not simply a bank reversing an ordinary transfer.

In a simplified three-person example, a sender pays through an intermediary to a recipient. Related conditional payments use the same hash, while the time conditions are arranged so the intermediary has an appropriate opportunity to resolve its own side after learning the preimage.

Keep the two protections distinct

For a learning exercise, draw one box labelled “correct preimage” and another labelled “timeout path.” Now ask what happens if the recipient reveals the secret, if nobody reveals it, and if a participant goes offline. The questions show why a hash alone is not the whole arrangement.

This sketch deliberately omits protocol details, fees, channel liquidity and operational requirements. It should not be used to construct a live contract or infer that every payment will complete instantly.

An HTLC is also not a general promise that a product purchased with the payment will be delivered. It enforces the specified payment conditions, which are narrower than the full relationship between buyer and seller.

When reading an explanation, identify the secret, the committed hash and the relevant deadline separately. If one is missing, the account may be describing only part of the mechanism.