Asset prices are temporarily delayedSome assets have stopped receiving fresh price data. Updates will resume automatically once the pipeline recovers.
Bitculator

Get Bitculator on Android

Marketcap:

$1,949,474,730,593

Volume 24h:

$209,798,866,754

Jun 06 Liquidations:

$0

24H Long/Short:

Coming soon

Hashed Timelock Contracts (HTLCs)

What does Hashed Timelock Contracts (HTLCs) mean in crypto terms?

Hashed Timelock Contracts (HTLCs) are smart contracts that enforce conditional payments in cryptocurrency transactions.

ID: 283
Hero Image

What is Hashed Timelock Contracts (HTLCs)?

Hashed Timelock Contracts (HTLCs) are smart contract agreements where money moves only if a secret is revealed before a set deadline. If the timer runs out, the funds bounce back to the sender. Picture a locker that opens with a code and auto closes after a countdown.


Myth

“HTLCs are only for the Lightning Network.” Not true. Hashed Timelock Contracts (HTLCs) also power atomic swaps and other payment channel flows on multiple chains.


How Hashed Timelock Contracts (HTLCs) works

Think of two people setting up a timed treasure reveal, but with receipts. Here’s the play:

  1. Step 1: Two users agree to trade funds in a peer-to-peer setup. The receiver creates a random secret, then shares only its fingerprint with the sender.
  2. Step 2: The sender locks funds in a contract that will pay out if the receiver reveals the secret that matches the shared fingerprint, which is made with a cryptographic hash.
  3. Step 3: The receiver spends the funds by revealing the secret before the timer ends. The contract checks the match and releases payment.
  4. Step 4: If the clock expires first, the money snaps back to the sender automatically.
  5. Step 5: For routing through multiple hops, everyone uses the same secret fingerprint. When the final receiver reveals it, every hop gets paid in sequence. Clean.

Yes, that really is the entire trick.


Why Hashed Timelock Contracts (HTLCs) Matters

You care because this is how crypto moves value without blind trust.

  • Benefit: All or nothing settlement that feels trustless for both sides.
  • Perspective: It unlocks instant routing, cross chain swaps, and internet grade payments without a help desk.
  • Relevance: You’ll bump into it in payment channels, DEX swaps, and channel based apps across Bitcoin and friends.

Tip

Set longer timeouts upstream than downstream, and do not reuse secrets. Treat these like programmable escrow-like arrangements, with timers that keep everyone honest.


Key Characteristics of Hashed Timelock Contracts (HTLCs)

Here’s what makes them special:

  • Hashlock: Funds unlock only when the right secret is revealed.
  • Timelock: If no reveal happens in time, funds return to the sender.
  • Atomicity: In multi hop routes, everything settles together or nothing moves.
  • Portability: Works across different chains that support basic scripting or contracts.

Variations

Same idea, different flavors:

  • Hash: Different algorithms like SHA 256 or Keccak can be used for the fingerprint.
  • Script: On Bitcoin it’s script based, on Ethereum it’s done with smart contracts.
  • Timeout: Relative time or absolute time, chosen to fit routing risk and fees.
  • Routing: Single hop payments or multi hop paths for longer routes.

Reminder

When a payment is claimed, the secret becomes public. Do not reuse it across different Hashed Timelock Contracts (HTLCs), and always stagger your timeouts.


Example

At a cafe, a routed payment settles with Hashed Timelock Contracts (HTLCs) the moment the shop reveals the secret, and every intermediary node settles automatically.


Fun Fact

The concept was sketched in early Bitcoin payment channel ideas and later popularized by the Lightning whitepaper; the first public atomic swaps using similar tricks showed up between Decred and Litecoin in 2017. Nerdy, but historic.


Wrap-Up

Short take: programmable timers plus a secret code let money move with confidence, no middleman needed.

Explore Other Crypto Terms

Did you find this term clearly defined?

Did we forget anything?

Your input helps us keep things correct. Contact us if anything is incorrect or missing.

Contact