---
title: "HTLC (Hash Time-Locked Contract) — definition | Nuri Glossary"
description: "A payment locked by a hash and a timeout, the primitive that makes Lightning and cross-chain swaps atomic."
lang: "en"
type: "glossary-term"
canonical: "https://nuri.com/glossary/htlc"
---

# HTLC (Hash Time-Locked Contract)

A payment locked by a hash and a timeout, the primitive that makes Lightning and cross-chain swaps atomic.

## Basically

A payment with two locks: a secret code that opens it, and a deadline. If the code does not show up in time, the money goes back on its own.

## Key Takeaways

- An HTLC is a conditional payment locked by a hash and a deadline. It is the basic building block that makes multi-hop Lightning payments atomic.
- Each hop either receives the secret and forwards the payment, or times out and returns the funds.
- The hash lock and time lock together remove the need to trust intermediate nodes.

## How one works

A hash time-locked contract pays whoever reveals a secret that hashes to a given value. The hash lock requires the secret, while the time lock sets the deadline. The money returns to the sender if the secret is not revealed in time.
The Lightning recipient generates the secret and its hash. Every hop along the route holds an HTLC with a timeout slightly earlier than the one it received, so each node always has time to act on what it learns from the next hop.

## Why this is enough

No intermediary needs to be trusted. A hop that forwards the secret but does not get paid can settle on-chain; if a hop refuses to forward, the payments unwind automatically when the timeouts hit. The payment either reaches the destination or every party is made whole.

## Where it appears elsewhere

The same construction powers atomic swaps and cross-chain exchanges. Improvements like point time-locked contracts replace the shared hash with per-hop points, so intermediate nodes can no longer tell which payment they are carrying.
Part of the [Nuri glossary](https://nuri.com/glossary), which defines 1876 Bitcoin, Lightning, wallet, stablecoin and payment terms.
