Atomic Swaps in cryptocurrency refer to a type of peer-to-peer exchange that allows users to trade one cryptocurrency for another without the need for an intermediary
1. Smart Contract: Atomic swaps use hash time-locked contracts that ensures the swap happens only if both parties fulfill their obligations within a specified time frame.
How Atomic Swaps Work:
2. Hash Function: The process begins when Party A generates a cryptographic hash and shares it with Party B. This hash will serve as a "key" to unlock the funds in the swap.
3. Locking the Funds: Party A locks their cryptocurrency in a smart contract using the hash, & Party B does the same with their own crypto
4. Validation: To unlock the funds, Party B must use the cryptographic key generated by Party A. If Party B successfully provides the key, Party A can then use the same key to unlock Party B's funds, completing the swap.
5. Automatic Reversal: If the transaction isn’t completed within the agreed time, the smart contract automatically reverses the transaction, & both parties get their original cryptos back.