What are Cross-chain Swaps? (2024)

12 January 2021

Medium min reading

What are Cross-chain Swaps? (1)

Cross-chain Swaps or Inter-Chain Exchanges are a type of P2P exchange that allows us to safely transform our cryptocurrencies or others, without intermediaries of any kind.

Lcross-chain swaps or atomic cross-chain swaps, are a type of currency exchange that takes place between two different cryptocurrencies that run on their own blockchain. That is, it is a mechanism that allows users to exchange different cryptocurrencies directly between two pairs.

The easiest way to see this type of change is to change the fiat currencies lifelong. In such exchanges, two people (one with euros and the other with dollars) want to exchange their currencies for each other at a certain rate. For this, in fiat, simply knowing the rate and doing the accounts, each of the parties can give the other the amount of coins equivalent to the change. For example, € 100 would be equivalent to about $ 121,55, using an exchange rate of $ 1,2155 per euro. Suffice it to say that this change has been direct and without any intermediary.

However, in this example we are talking about tangible things, it is money that is in the real world. The question here is: How to make such an exchange possible using cryptocurrencies whose systems work on different platforms? Well, the answer to this is cross-chain swaps and you will learn much more about them below.

Digital Certificate Ethereum 101 Course Medium levelIn this Ethereum 101 Course you will deepen your crypto knowledge by entering the Ethereum ecosystem and knowing everything about its characteristics, evolution and tools. Free 15 lessons Start now

Do you want to start enjoying the world of cryptocurrencies? Then it is time to open your Bit2Me user account. It is very easy to do and, in addition, following this link You will get € 5 totally free on your first purchase at Bit2Me.

Beginnings of Cross-Chain Swaps

In the last ten years, being whitepaper that broadly explains the nature of cross-chain swaps is "Atomic Cross-Chain Swaps"by Maurice Herlihy of the Department of Computer Science at Brown University Providence. This document, presented during the 2018 ACM Symposium, clearly explains how an atomic cross-chain swap works, its possibilities and main challenges in creating this type of tool.

Basically, what a cross-chain swap does is; take the money from the parties and deposit it under a special schedule that guarantees that the operation can only be completed with the approval of both parties. And in the event that any party acts maliciously, it cannot take control of our funds.

Now, the programming part has surely caught your attention at this point. Well, first of all, remember that every cryptocurrency transaction occurs thanks to the fact that said currencies respond to a programming or smart contracts that allows to send, take and deliver the control of said currencies. In Bitcoin, for example, we call this programming is possible thanks to Bitcoin script, And in Ethereum, thanks to Solidity. In general, all cryptocurrencies use this management model for their operations. By the way, if you want to know how to start programming smart contracts for Ethereum, you can check our article How to start programming in Solidity?

Now, taking into account that cryptocurrencies are programmable currencies, we can make a special programming that allows us to exchange them cross-chain with total security. This is what makes this type of exchange possible, and we will talk more about this in the next section.

Programming currencies, the key to cross-chain swaps

Now, let's go a bit to the practical side of cross-chain swaps and for this we will take, for example, Bitcoin. As we already mentioned, in Bitcoin we have the Bitcoin Script programming language. This scripting language allows us to send and receive coins in a fully programmed way. In fact, every transaction in Bitcoin is only possible using such programming.

But there is something very interesting with the capabilities of this language, more specifically with the functions OP_CHECKSEQUENCESSEVERIFY (CSV) y OP_CHECKLOCKTIMEVERIFY(CLTV). The first is a very useful operation code or OP_CODE, since it allows us to block the execution of a certain script or transaction until certain conditions are met. Thanks to this, things like Lightning Network are possible, as well as decentralized exchanges and secure P2P exchanges. These last two are precisely those that enter the field of cross-chain swap operations. The second code, for its part, allows us to place time locks on our transactions, something that we can use to create security mechanisms for our exchanges.

Thus, if we use a wallet capable of giving us the ability to perform cross-chain swap operations, we can make use of the OP_CHECKSEQUENCEVERIFY and OP_CHECKLOCKTIMEVERIFY functions, and perform cross-chain swap operations with people who have the same capacity. And all, because our wallet will program the coins so that they can only be exchanged under a series of conditions that both parties have decided in advance and without any intermediary.

Of course, this is a very simple explanation of how everything actually happens, so below we will explain how all this actually happens.

How does a cross-chain swap work?

Now let's assume the following scenario. On the one hand, we have Laura who wants to exchange her Bitcoin (BTC) for Monero (XMR). And on the other hand, we have Juan who wants to exchange his Monero for Bitcoin. Both have a need for exchange, and both parties have the currency they need.

Given this, Laura and Juan begin the exchange process having their purses trained for it. First, Laura creates a transaction using the opcode OP_CHECKSEQUENCEVERIFY and blocks the amount of Bitcoin to be exchanged with Juan. Said script can only be unlocked once Juan complies with the exchange conditions, issuing his equivalent transaction in Monero, and knows the secret that protects Laura's transaction. In case something goes wrong, Laura's transaction has a security measure that would allow her to recover the money after a while, using OP_CHECKLOCKTIMEVERIFY for this.

For his part, Juan also issues a transaction in Monero using the corresponding programming. In this case, Monero doesn't support OP_CHECKSEQUENCEVERIFY, but instead uses an operation called DLTC or Discrete-log Timelock Contract, a system that allows conditional payments in this currency. This operation allows Juan to issue a payment in Monero, which will only be effective if Laura meets the conditions. Like Laura, Juan has included conditions that will allow him to recover the funds in case something goes very wrong.

At this point, both parties have issued the payments, but no one has the money. At this point, it is time to check the unlocking conditions, which will allow Laura and Juan to take the money from the exchange effectively. Thus, both Laura and Juan reveal the secrets that protect their transactions. It is when you both know these secrets, when you can use them to unlock the script that holds payments. In the event that one of the parties has acted maliciously, one of the parties can use security measures for their transactions.

These security measures are time locks, and their function is to ensure that the funds are inaccessible to both parties for a certain and prudent period of time. Thus, if after a while, one of the parties does not comply with the conditions, the other can simply withdraw their money from the exchange and get it back, remaining as at the beginning.

Cross-chain swaps with other cryptocurrencies

The example we have given here we have done with Bitcoin and Monero. And, although it is a fictional example, it is close to the reality of this system. In fact, the Monero team is currently working on a cross-chain protocol to allow Bitcoin users to convert their BTC to Monero using this approach.

Of course this is not only limited to cryptocurrencies such as Bitcoin or Monero, all cryptocurrencies have this possibility, as long as they meet these two requirements:

  1. They must allow blocking at the script level.
  2. They must allow blocking at the time level.

Both transaction execution locks are intended to add the security necessary for these exchanges to be secure. Thus, for example, Ethereum could implement this system to allow cross-chain with other cryptocurrencies, and the same with the rest of crypto. The only limitation in all this is the one that developers can interpose by not supporting certain functions or equivalents in the blockchain and cryptocurrency.

other alternatives

Other alternatives to cross-chain swaps are Succinct Atomic Swaps (SAS), whose operation would also allow cross-chain currency exchange. However, this system has barely been defined and at the moment there is no complete and revised theorized operating model.

Pros and cons of cross-chain swaps

First of all, among the pros of cross-chain swaps we can mention:

  1. It allows a new decentralized, secure and private functionality to exchange our currencies for others without depending on centralized or decentralized exchanges.
  2. It helps us to generate a much greater dynamics of currency use. The currency exchange, for example, would allow us to expand our use of currencies at any time, and without major complications. So we could change our BTC quickly for EOS, in case a business or establishment only accepts EOS as a form of payment.

For its cons we can mention:

  1. If we use wallets that have a poor implementation of this type of protocol, we risk losing our money. The security of this system lies in the programming of very clear and safe conditions that protect us at all times.
  2. They can be somewhat complex to use, especially for those who are starting out in the world of cryptocurrencies.

Do you want to start enjoying the world of cryptocurrencies? Then it is time to open your Bit2Me user account. It is very easy to do and, in addition, following this link You will get € 5 totally free on your first purchase at Bit2Me.

Basic mining guide Free What better way to get bitcoins than creating them yourself. In this simple guide we show you how to do it. Do not lose this chance! Download

Download the basic guide on Mining for free

Receive in your email the PDF with the basic information.

  • What are Cross-chain Swaps? (5)

Share this article!

What are Cross-chain Swaps? (6)

What are Cross-chain Swaps? (7) Author

José Maldonado

Crypto Content Writer at Bit2Me Academy

José Maldonado is an expert in handling Linux, BSD and Windows systems. He also has experience in server monitoring and administration, systems hardening and service deployments. He began to be interested in blockchain technology early on and is currently an expert in Blockchain and Defi.

Read more

What are Cross-chain Swaps? (2024)

FAQs

What are Cross-chain Swaps? ›

Cross-chain swaps is a mechanism that allows global users to trade a token issued on one blockchain with another token issued on another blockchain in a hassle-free manner. Leveraging smart contracts and cryptographic techniques, these swaps allow users to exchange tokens easily without a centralized intermediary.

What is an example of a cross-chain? ›

Real-Life Examples of Cross-Chain Technology

Polkadot, for instance, uses its “relay chain” to allow different blockchains to communicate. Cosmos, on the other hand, utilizes its “Inter-Blockchain Communication” protocol to allow diverse blockchains to interact.

How do cross-chain transfers work? ›

A cross-chain token transfer is when an asset on one blockchain network is sent to another chain, such as ETH being sent from Ethereum to Avalanche. This makes a token accessible across the onchain financial ecosystem, where it can be used as DeFi collateral, for payments, and more.

What does cross-chain mean? ›

Cross-chain technology refers to the ability to transfer data and tokens between different blockchains. The Web3 landscape is increasingly becoming multi-chain, with the dApp ecosystem existing across hundreds of blockchains, layer-2 networks, and appchains.

How to make cross-chain swap? ›

Cross-chain swap
  1. selecting the tokens and chains. Now enter the number of tokens you want to swap cross-chain in the input field (green). ...
  2. entering the amount of tokens you want to move. ...
  3. send tokens to a different recepient address. ...
  4. arrive already fuelled up. ...
  5. monitor the progress of your swap.
Jan 27, 2024

What is the difference between cross-chain and blockchain? ›

Even though these terms are frequently used interchangeably, they actually refer to two different concepts. While multi-chain technology allows the use of many blockchains inside a single ecosystem, cross-chain technology allows the assets to move between different blockchain networks.

What is cross-chain risk? ›

Cross-chain crime is the action of moving crypto between assets and blockchains anonymously to obfuscate their illicit financial flows. With at least $7 billion worth of illicit crypto already laundered via these means, the need to tackle the cross-chain problem grows on a daily basis.

What are the benefits of cross-chain? ›

Cross-chain bridges allow assets to flow freely between blockchains, creating a more unified and liquid cryptocurrency market. This benefits both users (easier access to assets) and projects (deeper liquidity pools). Eigen Layer facilitates interoperability and secure asset transfers across various blockchain networks.

Can I send an USDC cross-chain? ›

Cross-Chain Transfer Protocol (CCTP) enables USDC to flow securely between blockchains – unifying liquidity and simplifying user experience.

Is USDC cross-chain? ›

Circle, the issuer of popular stablecoin USDC, has partnered with Solana to bring its cross-chain transfer protocol (CCTP) to its blockchain ecosystem. CCTP is designed by Circle to enable the secure transfer of USDC between different blockchain ecosystems using the native mint and burn process.

How do you know if you're cross-chaining? ›

Cross-chaining is when you're in your big chainring and the biggest cog on your back cassette, or on your small chainring and your smallest cog. The problem is that this stretches your chain diagonally to its limits, and needlessly so, since you could just shift to your other chainring and find a similar gear ratio.

Is it okay to cross-chain? ›

Shimano and Campagnolo both said that cross-chaining can add wear and tear to chainrings and cassettes.

What are cross-chain capabilities? ›

Cross-chain interoperability in blockchain refers to the ability of different blockchain networks to communicate, share data, and execute transactions with one another. It enables assets to be transferred across disparate blockchains without the need for intermediaries or centralized exchanges.

What is the difference between swap and cross chain transfer? ›

While atomic swaps enable the peer-to-peer exchange of native assets, cross-chain bridges provide a connection between blockchains. Bridges can facilitate the transfer of wrapped assets via locking/unlocking or minting/burning mechanisms.

What is the cross chain protocol? ›

Cross-Chain Transfer Protocol (CCTP) is a permissionless on-chain utility that facilitates USDC transfers securely between blockchains networks via native burning and minting. Circle created it to improve capital efficiency and minimize trust requirements when using USDC across blockchain networks.

How to buy chain swap? ›

Where & How to Buy ChainSwap (CSWAP) Guide
  1. Download a Trust Wallet Wallet. ...
  2. Set up your Trust Wallet. ...
  3. Buy ETH as Your Base Currency. ...
  4. Send ETH From Binance to Your Crypto Wallet. ...
  5. Choose a Decentralized Exchange (DEX) ...
  6. Connect Your Wallet. ...
  7. Trade Your ETH With the Coin You Want to Get.

What is an example of a chain? ›

a series of things connected or following in succession: a chain of events. a range of mountains. a number of similar establishments, as banks, theaters, or hotels, under one ownership or management.

What gears are cross chaining? ›

Cross-chaining is when you're in your big chainring and the biggest cog on your back cassette, or on your small chainring and your smallest cog. The problem is that this stretches your chain diagonally to its limits, and needlessly so, since you could just shift to your other chainring and find a similar gear ratio.

What are cross chain applications? ›

Cross-chain functionality enables developers to build natively cross-chain applications, where a single instance of a decentralized application (dApp) can function across multiple smart contracts deployed across multiple blockchains, as opposed to deploying multiple individual instances across distinct networks.

What are the three main types of cross? ›

There are four basic types of iconographic representations of the cross: the crux quadrata, or Greek cross, with four equal arms; the crux immissa, or Latin cross, whose base stem is longer than the other three arms; the crux commissa, in the form of the Greek letter tau, sometimes called St.

Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 6043

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.