Atomic Swaps and HTLCs

13 min readarticleIncludes quiz · 1 questions

Understand the cryptographic magic that makes Lightning payments atomic and trustless.

Hash Time-Locked Contracts (HTLCs):

  • Hash Lock: Payment requires a secret preimage
  • Time Lock: Refund after timeout
  • Atomic: All-or-nothing execution
  • Trustless: No intermediary can steal funds

HTLCs enable multi-hop payments where either everyone gets paid or no one does.

HTLC Mechanics
HTLC Mechanics

Test Your Knowledge

This lesson includes a 1-question quiz (passing score: 80%).

Quiz functionality available in the mobile app.