Hash Time‑Locked Contract (HTLC)
1 min read
Pronunciation
[hash tym-lokd kon-trakt]
Analogy
Like a sealed envelope that only opens when you provide the correct secret code or returns to the sender after a deadline.
Definition
A smart contract that locks funds until a cryptographic preimage is revealed or a timeout elapses, enabling trustless atomic swaps and payment channels.
Key Points Intro
HTLCs underpin cross‑chain atomic swaps and off‑chain payment networks by enforcing conditional transfers.
Key Points
Hashlock: Requires preimage of a known hash to unlock funds.
Timelock: Refund path after expiry if preimage not provided.
Atomicity: Ensures either both sides of an exchange occur or none.
Use cases: Lightning Network, atomic token swaps.
Example
Alice and Bob perform an atomic swap: Alice locks BTC in an HTLC on Bitcoin, Bob locks ETH in an HTLC on Ethereum; exchange secrets to claim each other’s funds.
Technical Deep Dive
Security Warning
Caveat
HTLCs require both parties to be online to claim funds before timeout.
Hash Time‑Locked Contract (HTLC) - Related Articles
No related articles for this term.