Introduction to Binance DEX: Part I, Atomic Swaps explained Thomas Follow Mar 26 · 4 min read

By F.

In this series of articles, we summarize various relevant information about the Binance DEX decentralized cryptocurrency exchange, how it works, and the process of applying. In doing so, we hope to help the community with issuing and swapping tokens and make the process even smoother. This first article describes how atomic swaps work. The next will dwelve into more technical details of how atomic swaps are done on Binance DEX.

Blockchains are all about decentralization. Bitcoin was the first decentralized digital currency, i.e. controlled by no central entity: decision power was distributed proportionally to miners which meant, initially anyone with a laptop.

Besides the concentration of mining due to specialized hardware, cryptocurrency exchanges have been a major factor in the centralization of the ecosystem. Much like nowadays most email addresses are hosted at Google and Microsoft, it seems a large fraction of cryptocurrency users are giving up ownership of their coins to a few exchanges. This has made the numerous hacks of such websites extremely damaging, the most egregious example to this day remaining Mt Gox in 2014.

In the case of exchanging cryptocurrency against fiat currency, it is difficult to improve on the centralized model. However, swapping between two cryptocurrencies is elementary — as it should! — thanks to a cryptographic setup called the atomic swap.

Intro

Why the name? Atomic etymologically means “that which can not be divided in smaller parts”, and the concept comes from concurrent programming and database systems where it designates a series of operations of which either all occur, or none. In our case, suppose we wish to trade BTC for DUN: the operation will consist in two transactions, one transferring BTC, the other transferring DUN, but we never wish for one to occur without the other, in other terms we wish for the swap to be atomic.

Protocol