The word ‘Atomic’ has been used in crypto when referring to databases. In essence, there many database operations that may or may not occur. The operations many be brought back to where they started in case of an interruption in any of the transactions. Things can always go wrong during the operations.
This is where atomic transactions start from. Atomicity comes from ACID transactions as part of the characteristics. Acid transactions are also characterized by consistency, isolation, and durability. It is necessary for these features to appear in order to have a transaction in the database.
The word Swap is literally like swapping. It is when cryptocurrency exchanges for another. An atomic swap is therefore two blockchain operations that achieve successful exchange of two cryptocurrencies.
Is essence, every condition of the transaction must be met. If not, the swap will not be confirmed, unless where only two participants receive the cryptos. The atomic swap wallet is therefore used to keep these transactions possible.
There are different technologies involved in the atomic swaps. These principles include all sorts of DEXax and Cross chain exchanges. They all have different functions at different decentralization levels. However, they all meet at solving the issues in decentralization vs. speed balance.
In the recent past, the user cases for Atomic Swap are becoming more popular. It is a technology that goes beyond the normal cryptocurrency wallet. Cross Chain exchanges based on HTLC technologies are showcasing the greatest adoption rate.
What is HTLC?
We know what smart contract are, right? Well, HTLC a smart contract that is taken for a specific amount of cryptocurrencies agreed. This amount cannot go anywhere else but to a predetermined wallet. But before that, the secret to the hash junction within a stipulated period of time has to be provided.
In other words, you only need the hash function of the secret. This means the secret itself does not appear to the public. This completely hands the issues of pseudo-anonymity in crypto transactions.
Since a contract involves more than two parties, it does not really matter who knows it. But the parties that know it have to create a contract that comes with a more extended time frame.
In the HTLC working principle, the contracts are symmetric. Let’s say Lucy is the holder of a secret. She will need to pass it to another smart contract she is dealing with, say from John – on Ethereum platform. The smart contract calculates the hash function of the secret to determine if it matches the one in the contract. Then Lucy’s Ethereum will be sent to her atomic swap wallet or normal wallet.
This is where true anonymity and security get in action. The Ethereum will go back to John incase Lucy refuse to reveal the secret.
Stages of Atomic Swap
Atomic Swap is all about instant exchange. It follow two stages where the first one if ‘order matching’. This is simply when the two participants reach an agreement for the Swap. The participants are described as Market Makers and Market Takers.
The second stage is confirmation where the Market Taker sends a message of confirmation when they decides on one of the orders. The two parties must them create a HTLC contract. That is how the transaction is finalized.