Atomic Swaps

CrossFi_Official
CrossFi_Official
Published in
3 min readAug 27, 2022

If you have been an ardent follower of the cryptocurrency trend since its inception, you must have heard about atomic swap. It’s often considered the latest technological game-changer that has the tendency to change, in years to come, the way financial systems operate, influencing how the money barters work in our modern day. Its major fulchrum is to allow people to transact and trade with one another on blockchain or off blockchain without the interference of third-party souvenirs, thereby making the trade faster and less complex for individuals.

Understanding Atomic Swaps

Simply put, atomic swap, otherwise known as cross-chain atomic swap, is a smart contract technology that allows the exchange of cryptocurrencies from separate blockchains without the involvement of any centralized exchanges, or intermediaries. The big idea behind this technology is to get rid of third parties and give participants total custodial ownership of their tokens. This swap can be done either on blockchain or off blockchain.

Most atomic swap-oriented wallets and blockchains make use of smart contracts. They are a set of programs within the blockchain technology that function when certain conditions are met. Each party, in this case, has to agree to the transaction before the stipulated time goes off. An important backdrop of smart contracts in every trade is the height of security it offers which curbs off cases of theft and other fraudulent acts.

For instance, each cryptocurrency such as BTC (Bitcoin) and Ethereum (Ether) runs on a blockchain technology designed to allow transactions in specific tokens. This means you cannot exchange BTC for Ether without first converting to fiat currency and then buying the other. Atomic swap allows you to transact and trade tokens existing in different blockchains.

History of Atomic Swaps

The concept of peer-to-peer cryptocurrency exchange has always been the main focus of developers since the advent of cryptocurrency and blockchain. Although the first draft of a trustless exchange protocol was the brainchild of Sergio Damian Lerner in 2012, the creation of the concept is attributed to Tier Nolah who had a tremendous breakthrough in 2013 and created the first full account of atomic swaps and its work process, and even popularized it.

The birth of the concept, however, was shortly after cryptocurrencies different from Bitcoin mushroomed all over the market. The creation of the coins, often referred to as altcoins, made some cryptocurrency owners become interested in moving capitals between coins. The first atomic swap was first conducted in 2012 between Decred and Litecoin. Since then, most decentralized exchanges and startups have implemented the same facility.

How Does Atomic Swaps Work?

The first stage of an atomic swap is mutual agreement. Two token owners will first have to agree to exchange their tokens for any amount they agree. The smart contract confirms the agreement and then executes the trade. The transaction is then added to the blockchain and validated by network nodes, allowing a new block to be opened for another transaction.

Atomic swaps use Hash Timelock Contracts (HTLC), a type of smart contracts technology, to automate tokens swap. It’s a time-bound smart contract between two parties used to generate one cryptographic hash on both ends. It requires both parties to confirm receipt of funds within a stipulated time. If both parties do not confirm the transaction within the stipulated time, the transaction is automatically canceled and funds returned to the owner, thereby burning off any risk of counterparty risk.

For clarity’s sake, let’s say Ken wants to convert 10 Filecoins for the equivalent number of CRFIs with a friend. Let’s call this friend Emmanuel. Both Ken and Emmanuel will submit the transaction through an atomic swap-capable wallet in order to allow the cryptographic hash to generate a hex number to encrypt the number during the transaction, and then unlock their individual funds using their encrypted number. This must be done within a stipulated time frame, or the transaction is canceled. The HTLC takes over and executes the trade within the blockchain.

CrossFi is a cross-chain protocol that provides liquidity for Filecoin staking and rewards.

CrossFi Official Website: https://crossfimain.com

CrossFi DApp Address: dapp.crossfimain.com

CrossFi Official Twitter Account: https://twitter.com/globalcrossfi

CrossFi Official Discord Group: https://discord.gg/UKGSX3VBY3

CrossFi Official Global Telegram Group: https://t.me/crossfimain_en

--

--