Atomic Swaps: What it is and how OmniBOLT is advancing this process

OmniBOLT
4 min readAug 14, 2022

Why take a detour when you can take a shortcut?

You may have heard of the Suez Canal. Before the artificial waterway was created, European ships bringing fabric and spices from India had to sail the infamous Cape Raut, a 40-day journey covering more than 10,000 sea miles. The canal's opening shortened the distance by more than 5,000 miles, reduced the time to 10–12 days, and ushered in a new seafaring era. Less time at sea, fewer deaths from scurvy, fewer pirates, and devastating storms. Progress.

And the year 2022 has arrived. The global capitalization of the crypto market is around $1.2 trillion (it was almost $2 trillion at its peak). A remarkable thing has happened this year and last, Crypto is mainstream. But even today, gaining certain crypto assets can be something of an epic journey.

First, you will have to register with one of the centralized exchanges. There, you will most likely have to go through a boring KYC procedure. Not only is this quite a lengthy process, but it also involves a discomfitingly high level of trust. As well as having to hand over your identity documents and other sensitive (potentially anonymous) information to a third party, you’ll also have to temporarily give them full control of your crypto assets. And just as the precious cargo of ships sailing the seaway from India made them a huge temptation for pirates, so too does the large concentration of crypto-assets on exchanges make them attractive to hackers.

So using a centralized exchange can be a slow and costly process, requiring you to hand over your money and documents to a third party. It works, but it’s not perfect. And at the dawn of the new decentralized era, which promises individual financial sovereignty, such a solution looks like a somewhat outdated way of doing business. It would be nice to be able to choose a more direct route and thus use a faster and safer form of exchange.

What are Atomic Swaps?

An atomic swap is a transaction to exchange one cryptocurrency for another, which can be executed instantly without the need to rely on a trusted third party (intermediary) such as an exchange or exchange platform. As a result, the parties involved have sole control over the transaction.

Atomic swaps can be executed both on-chain, i.e. directly between the blockchains of different cryptocurrencies, and off-chain, outside of the blockchain. The first such exchange took place on 19 September 2017 between the cryptocurrencies Decred and Litecoin.

How does it work from a technical point of view?

The atomic swap mechanism is based on the so-called HTLC (Hash-Time Locked Contract). This contract can be conventionally translated into human language as follows:

If the time has passed less than T, then transfer N coins to address A, provided a secret hash equal to H is provided. If more than T has elapsed and the hash is not provided, then transfer (return) the money to address B.

In other words, the output of the transaction, specified as HTLC, can only be spent by the recipient if the sender gives him the secret, and only within a certain time fixed in the transaction (e.g., 24 hours). If this does not happen within the specified time period, the money will be withdrawn to the sender’s return address.

Whoever creates this contract invents the secret, but does not disclose it, and the contract itself only specifies the addresses A, B, hash H of the secret, and the time period during which the contract can be “opened” with the secret.

What is the difference between on-chain and off-chain swaps?

On-chain atomic swaps take place directly on the exchanged cryptocurrency’s blockchain, which, in addition to supporting HTLC, must also use the same hashing algorithm for a successful exchange.

Off-chain atomic swaps allow the exchange of coins outside the blockchain, an extension of the Lightning Network.

So what does OmniBOLT offer us?

Lightning Network technology can make the swap process simpler, faster, and more efficient.

Like atomic swaps, Lightning Network uses time-locked hashing contracts, the difference being that while atomic swaps bind blockchains, Lightning Network binds payment channels.

In general, atomic swaps take place between different blockchains, for exchanging tokens with no trust in each other. Channels defined in OmniBOLT can be funded by any token issued on OmniLayer. OmniBOLT enables the use of Atomic Swaps between OmniLayer tokens and chains. For example, USDT and BTC have to be exchanged within a specified timeframe. To ensure neither party is able to cheat the other using a cryptographic hash function tied to a time deadline.

Outlook for the future

The source code of atomic swaps technology is in the public domain, allowing any developer to improve the technology and apply it to any project.

Based on atomic swaps, it is possible to create fully decentralized exchanges that are not controlled by the government or even the owners, which will significantly secure cryptocurrency users during trading operations.

With regular hacks and hacking attacks on cryptocurrency trading platforms, the introduction of this technology could revolutionize the trading industry. Many users are eagerly awaiting the successful completion of testing, at the end of which only decentralized exchanges with atomic swaps and those dealing in fiat currency may remain on the market. While the relevance of the others will be in question.

Conclusion

Atomic swaps are a revolutionary technology that can make cryptocurrencies and cryptocurrency trading truly decentralized and secure. They do not require an intermediary to be involved in the transaction and therefore allow trading to take place outside of centralized exchanges that are vulnerable to attack and somehow subject to government laws.

In addition, atomic transactions will remove or significantly minimize transaction fees, and allow users to remain as anonymous as possible within the network of a particular cryptocurrency.

Join OmniBOLT Community

Twitter: https://twitter.com/omni_bolt

Discord: https://discord.gg/cJXb8WMCDD

--

--

OmniBOLT

OmniBOLT (Omni Basis of Lightning Technology) is the world’s first stable coin circulation specification on Omnilayer for Lightning Network.