Atomic Swaps Revolutionizing Cryptocurrency

Currently, the global economy is undergoing the largest technological transformation in history, and new ‘‘disruptive innovation’’ is transforming economic activity by creating simplicity and accessibility. According to ARK’s research following technology breakthroughs will advance significantly over the coming year. The top 3 “Big Ideas” for 2019 are (1) Deep Learning (2) Digital Wallets (3) Cryptocurrencies.

Digital wallets are an important step in the evolution of value transfers, making transactions simple in a user’s everyday life. They are becoming gateways for financial services such as wealth management, banking, and personal finance.

Some recent success stories:

  1. By the end of 2018, Venmo (digital wallet) became the 4th largest manager of customer accounts, trailing only Bank of America, Chase, and Wells Fargo.
  2. As Seen in China, digital wallets like Alipay and WeChat Pay have revolutionized the delivery of banking products. Their ease of use and accessibility have caused mobile payments to soar 12-fold to $24 trillion in 2018.

It is believed that digital wallets can upend traditional banks within 7-10 years, however, to make it happen, it needs to reduce the friction from beginning to end with a minimum transaction fee.

Interoperability between different assets:

Currently, interoperability is a huge problem in cryptocurrencies due to the fact that individual blockchains employ different protocols, algorithms, and security procedures to conduct transactions. Each blockchain project has its own unique value proposition and used for a specific purpose. Therefore, an individual using crypto-assets for its business needs requires multiple assets which makes the management of his/her funds difficult.

More about the Interoperability in the following example:

Let’s say a retail store uses crypto-assets for its operation. His/her supplier offers a discount if paid in VeChain tokens for logistic services however storekeeper only owns Bitcoin and Stellar because it is the only payment option they offer to their customers.

The ideal solution for the store owner is to use a frictionless transaction. Store owner using his/her wallet sends BTC to the supplier’s wallet and automatically supplier receives equivalent VeChain(VET) tokens in his/her wallet. However, due to the use of different ledger technology, different blockchains are unable to communicate(or share information) with one another. Therefore, in such a case, the store owner has to rely on centralized exchanges to manage the transfer.

Today for assets exchange, users rely on centralized cryptocurrency exchanges. Just think of the process and fee structures that go into asset conversion in cryptocurrency exchanges (maker/taker fee, withdraw fee, transfer to exchange wallet fee). This is time-consuming and expensive. Hence the free movement of digital currencies from peer-to-peer is becoming a key industry goal. Removing dependency on centralized exchanges will allow crypto assets to be exchanged independently.

Atomic swaps solve the interoperability problem

With Atomic Swaps, you convert directly with a minimum fee and reduce friction from beginning to end.

Since 2012, the concept of a trustless, peer-to-peer cryptocurrency has been a key industry goal. In July 2012, a developer by the name of Sergio Demian Lerner created the first draft of a trustless exchange protocol. Although the concept was appealing, it wasn’t sufficiently developed to garner mass adoption.

The breakthrough in Atomic Swap research occurred around May 2013, when Tier Nolan provided the first full account of a procedure for the Atomic Swap protocol.

As a result of this breakthrough, Nolan is widely credited for Atomic Swaps. However, any practical implementations came much later in September 2017.

How Atomic Swaps Work:

Hash-Time-Locked-Contracts (HTLC) is used for implementing Atomic swaps between cryptocurrencies. Bitcoin’s lightning network also uses HTLC. HTLCs is essentially a smart contract enabled technology that gives the ability to exchange digital assets seamlessly and securely without any counterparty involvement.

The participants interact with each other by signing transactions with a secret-key. However, they never submit any data to the miners themselves. Once the swap is complete, the transaction gets added to the blockchain. This is done by locking a segment of the blockchain state via multi-signature agreed upon by a set of participants. This means that recipients of a transaction have to acknowledge payment within a certain timeframe. If not met, the transaction does not take place.

There are two key elements in HTLC that enable digital assets cross-chain exchange:

  • The first element is ‘hash-lock’. A hash-lock is like 2-factor authentication. In HTLC, the originating party generates a key and hashes it. Hash-locks require the intended recipients of a fund to provide the correct key in order to claim them.
  • The second important element of HTLC is a ‘time-lock’. There are two types of time locks.
    • CheckLockTimeVerify (CLTV). It uses a time base to lock and release cryptocurrency. Only at a specific block size or at a specific time and date, the execution takes place.
    • The second one is CheckSequenceVerify (CSV). It uses the number of blocks generated instead of time as a measure to keep track of when to finalize a transaction.

To conduct a transaction using HTLC, interested parties need to open channels with each other. For example, the participants can agree to open a state channel and close it after two hours or close the chain after $100 worth of transactions have taken place.

How hash time-locked contracts (HTLC) work:

Suppose Alice wants to exchange her Mainframe for Litecoin from Bob. A typical HTLC transaction between them takes place as follows:

Atomic Swaps
Success scenario
  1. Alice first opens a payment channel and posts a trade order on the exchange.
  2. Bob sees the offer and accepts it, both agree that 100 LTC = 100,000 MFT.
  3. Alice picks a random number ‘R’, calculates its hash ‘H’. Note: there is no way to calculate R from H since computing H is a one-way function.
  4. Alice makes a transaction to send 100,000 MFT to Bob and attaches ‘H’ to it with a condition that R should be revealed when Bob makes the transfer of 100 LTC from his end.
  5. Bob makes a transaction to send 100 LTC to Alice and attaches the same H to it with a condition to reveal ‘R’. Therefore, for Alice to claim the payment, she has to provide Bob number ‘R’ used to produce the hash.
  6. Once Alice reveals ‘R’, the conditions are satisfied and the swap is performed.

Next disruptive innovation in the cryptocurrency

Atomic Swaps have the potential to completely revolutionize the way crypto-assets are exchanged between peers and are already used to create financial products such as WBTC. In WBTC, atomic swaps are used between merchants and users to perform a trustless-fast method of exchange between WBTC and BTC.

  • May 5, 2019