← Back to Glossary

Hashed Time Locked Contract (HTLC)

A hashed time locked contract (HTLC) is a conditional bitcoin payment that can be settled in exactly two ways: the recipient claims the funds by revealing a secret value (a preimage) that matches a published hash before a deadline, or the sender reclaims the funds after a timelock expires. No third party enforces the deal; bitcoin script does.

How it works

HTLCs are the routing mechanism of the Lightning Network. When Alice pays Carol through an intermediary node Bob, each hop sets up an HTLC locked to the same hash, with the sender-side timelocks set longer than the receiver-side ones. Carol reveals the preimage to claim Bob's payment, Bob uses the same preimage to claim Alice's, and the whole route settles atomically: either every hop completes or every hop refunds. The decreasing timelocks guarantee that no intermediary can be left out of pocket.

The same construction powers cross-chain atomic swaps and submarine swaps between on-chain and Lightning balances, since one secret can unlock contracts on two different ledgers.

In the gold vs bitcoin debate

HTLCs illustrate a capability gap between the two assets. Conditional, self-enforcing payments across a chain of strangers are simply not possible with physical gold, which requires escrow agents, contracts, and courts for the same function. Whether that programmability matters for a store of value is contested, but for money intended to move, it is a structural advantage of the digital asset.

Ready to convert your gold to Bitcoin?

Get Your Free Kit →