Hashed Time-Lock Contract Mechanism
A Hashed Time-Lock Contract is a type of smart contract that uses cryptographic hash functions and time locks to enable trustless, conditional transactions. The mechanism requires the recipient of a payment to acknowledge the receipt by generating a cryptographic proof within a specified timeframe.
If the proof is not provided before the deadline, the contract automatically reverts the funds to the sender. This eliminates the need for a trusted third party in cross-chain exchanges.
The hash function acts as a lock, and the preimage of that hash acts as the key. This ensures that a transaction on one chain only completes if the corresponding transaction on the other chain is also prepared.
It is the fundamental building block for atomic swaps. The mechanism is inherently secure because it relies on the deterministic nature of blockchain state transitions.
It prevents funds from being trapped in limbo during failed swap attempts.