How Do Hash Time-Locked Contracts (HTLCs) Ensure Trustlessness in an Atomic Swap?
HTLCs require both parties to create a cryptographic hashlock and a timelock. Party A sends funds locked by a secret key's hash.
Party B sends funds locked by the same hash. To claim Party A's funds, Party B must reveal the secret key.
Once revealed, Party A can use that same key to claim Party B's funds. The timelock ensures funds are returned if the swap is not completed within a set time.
This eliminates counterparty risk.