visit
Currently, most centralized exchanges compel traders to transfer crypto assets via a wallet that is hosted and controlled by the exchange. These funds are stored in a “hot wallet”But traders don’t control their private key for hot wallets. Therefore, this places their investment at the mercy of exchanges. Centralized exchanges, therefore, expose users to loss of their funds through hacks of those platforms or straight-up scams where owners disappear with the funds. This emphasizes a pearl of common wisdom in this cryptocurrency ecosystem: “not your keys, not your funds.” If we don’t control the private key of the account with the assets, then we don’t own the funds.Furthermore, exchanges are known to charge fees that hit customers’ portfolios. Several exchanges also require KYC, a requirement that crypto-anarchists see as harmful to their privacy.
Atomic swaps connect users directly without an intermediary and allow for a virtually infinite number of trading markets to be created on the fly. Any crypto-asset becomes interchangeable with any other offering on the market at that time. Everything can be performed on one smooth motion, which is what users actively seek in this era.Moreover, atomic swaps leave crypto holders in complete control of their crypto at all times, thus eliminating the hacking risk. When using centralized trading platforms, there are always some fees you’ll pay. Whether it’s on the withdrawal or deposit side, you will pay either way.But through atomic swaps, deposits and withdrawals fees are non-existent. Users will only pay on-chain transaction fees for sending money to other users, which is normal. Such trades take place across their individual networks or blockchains.
Such atomic swap wallets are designed in a manner that prevents any of the involved parties from cheating. Hashed Time Lock Contract (HTLC) is the technique that enables trading tokens in an atomic swap.Now let’s understand how such protocols work,. For example, Alice would like to trade her Litecoin for Bitcoin.
Step 0
Alice (the Maker), therefore, posts a trade order on the decentralized exchange wallets mentioned above. This step is listed as 0 because it occurs before the atomic swap starts.Step 1: DEX Fee Payment
The Taker (i.e., in our case is Bob) sees the Maker’s offer and accepts it. Bob commits to the trade by paying the DEX fee that is only 0.15% of the total trade amount. The DEX fee plays a crucial purpose as it ensures that the Taker doesn’t spam the network with rapid requests. However, the Maker doesn’t pay any trading fees on the DEX wallets.Once the Taker has paid the DEX fee, the atomic swap has started officially. The Maker receives the fee payment and generates the second step.Step 2: Maker Payment Is Sent
The Maker deposits her Litecoin into the HTLC contract and specifies Bob as the beneficiary. The funds are locked with the hash. Alice then generates a key to access the hash and shares it with Bob.Step 3: Taker Payment Is Sent
Bob uses the hash and key sent by Alice to deposit his Bitcoin into the HTLC contract. He then specifies Alice as the beneficiary.Step 4: Claim Process
Alice has the original key, which was used to produce the hash. She then uses the key to initiate the claim button on the HTLC contract so that to claim the trade payment and receive the Bitcoins from Bob. As soon as Alice claims the Bitcoin, Bob also is able to claim the Litecoin, and the swap is now complete.That’s all how atomic swaps work.The process ensures a trustless, secure, peer-to-peer exchange. There are no intermediaries. Only a cleverly designed protocol leverages cryptographic techniques to ensure neither party can cheat in the trade. It is an atomic process that implies either (a) the swap happens exactly as Alice and Bob agree, or (b) nothing takes place, and both Alice’s and Bob’s funds are returned to them.
The HTLC contract has timeout features, which allow the parties to get their money back from the contract’s lockbox in case the deal fell apart.