Decentralized Cryptocurrency Exchange Most Comprehensive Tutorialin Cryptocurrency
Bitcoin, the first decentralized blockchain-based cryptocurrency initially was created to bypass third parties during the transaction process. With Bitcoin miners, such currency problems like fraud and censorship are also seemed to stay behind. The mining itself means that there is no more any control over the money producing and no economic crisis can ever happen.
However, it seems that the decentralization idea is forgotten: people created cryptocurrency exchanges with centralized servers to operate with decentralized tokens. Sounds ridiculous, doesn’t it?
But how else do we exchange our cryptocurrencies, you may ask. On a decentralized cryptocurrency exchange!
- What is a Decentralized Exchange?
- Cryptocurrency Market Overview
- Decentralized Exchanges Criteria
- Decentralized Exchanges Benefits
- Decentralized Exchanges Downsides
- Decentralized Exchanges Projects
- Funds Management
- Trading Logic
- Why are the decentralized crypto exchanges not adopted?
- List of decentralized crypto exchanges
A decentralized exchange (DEX) is a cryptocurrency exchange market run on a distributed ledgerю It creates p2p (peer-to-peer) marketplaces on the blockchain and allows traders to control their own funds.
This aim is reached with the help of proxy tokens (which represent fiats or crypto coins), assets (represent companies’ shares) or a multi-signature escrow system (like in peer-to-peer cryptocurrency exchanges).
However, the majority of currently-existing cryptocurrency exchanges are semi-decentralized. They have a centralized server that holds order books, but anyway it doesn’t hold IDs or private keys, unlike the centralized crypto exchanges.
According to the Coinmarketcap website, the total market capitalization level in April 2013, was $1 599 410 000. Nowadays it can be estimated at $277 071 833 878 which is 173 times more:
It also means that the cryptocurrency market has grown up to 17323 percent.
In the same way, a 24-hour volume has grown from $0 to $12 885 900 000.
The number of live crypto exchanges has enlarged 170 times. The majority of them are centralized ones.
A Decentralized Exchange should comply with the following parameters:
- Traders own their capital, not a server or any other middleman
- Order books are compiled by the traders and the orders are transmitted between them directly through blockchain.
- Orders match from trader to trader in a direct way as well and
- Their apps produce the crypto money exchange, not a third party.
In order to be a decentralized an exchange should meet the following criteria:
- No ID inquiry (no e-mail, Facebook, Google, etc.)
- No third parties
- No replacement, IOU ("I owe you") / intermediate token/coin or a coloured coin approach
- Noone runs the exchange
- No profit from the transactions
- No withdrawal limits
- No centralized order books
- None centralized crypto exchange functions
- No cost lists
- No certain coin pairs to trade.
Works like the Internet. Fast & Cheap.
I mean, the decentralized crypto exchanges work globally, all the transactions are produced fast and efficient. Moreover, they are cheap - the cost can be hundreds or thousands times less than the centralized’ ones.
Clear like water
All the transactions and codes processing in the network is open and accessible to everyone.
A middleman can be hacked, corrupted, robbed or coerced while with decentralized crypto exchanges all you private keys are under your control. A hacker will have to compromise half of the world to get access to the steering control.
Hardware wallets integration
Yes, you can integrate a decentralized exchange with your hardware wallet like Trezor or Ledger Nano to send and get funds directly to your wallet.
No identity documents (ID) / Funds control
Your private key is your ID. If you keep it, it is yours.
When Wikipedia appeared an information revolution happened. everyone can now click and get the necessary information about almost everything he wants. With the decentralized crypto exchanges, the same happens in the financial sphere.
No banks or governments. Borderless Anonymity.
You own your private key. Noone knows that this string of letters and numbers belong to you if you don’t tell this someone. You don’t know who is behind the addresses in the blockchain network. So no one has to hide them. Or to store in a company like banks. And no government can demand your IDs and addresses. Brave new world!
Hard to understand
Centralized crypto exchanges have everything to get a lot of users - intuitive interfaces, understandable buttons, and tubs. As to the decentralized ones - well, you will need some time and patience to understand smart contracts and their working principle. However, the gamble worth taking.
No basic functions
Decentralized crypto exchanges don’t have the basic functionality such as margin trading, stop losses etc.
Low trade volume
Because of the previous items, the transaction volume here is low that’s why it may be hard to find a business partner to trade.
A decentralized crypto exchange runs on open protocols which provide liquidity common pools - enable to communicate with each other.
The basic open protocols are the following:
Ox protocol was created specifically for ERC20 tokens to merge off-chain orders with on-chain settlements. The division between the two is to provide low ether gas fees. The native token of the protocol is Ox (ZRX). The order protocols called “relayers” broadcast orders to the blockchain network. A buyer fulfills the order, the trade or exchange is taking place and the order broadcasts.
Here is how the founders describe Ox Protocol in the white paper:
“We describe a protocol that facilitates low friction peer-to-peer exchange of ERC20 tokens on the Ethereum blockchain. The protocol is intended to serve as an open standard and common building block, driving interoperability among decentralized applications (dApps) that incorporate exchange functionality. Trades are executed by a system of Ethereum smart contracts that are publicly accessible, free to use and that any dApp can hook into. DApps built on top of the protocol can access public liquidity pools or create their own liquidity pool and charge transaction fees on the resulting volume.”
Kyber Network is a platform for decentralized crypto exchanges to enable instant on-chain cryptocurrency exchange or trade. It has a lot of similarities with the Ox protocol such as the search of low-liquidity problem solution and the high-cost minimization. However, all the activities are implemented on-chain. The native token of the system is Kyber Network Crystal (KNC) (ERC20 token as well).
The liquidity is achieved with the help of the Dynamic Reserve Pool. Once the exchange request comes from a buyer, the protocol finds the best available exchange rate for him.
Here is how the founders describe Ox Protocol in the white paper:
“We design and build KyberNetwork, an on-chain protocol which allows instant exchange and conversion of digital assets (e.g. crypto tokens) and cryptocurrencies (e.g. Ether, Bitcoin, ZCash) with high liquidity.
KyberNetwork will be the first system that implements several ideal operating properties of an exchange including trustless, decentralized execution, instant trade and high liquidity. Besides serving as an exchange, KyberNetwork also provides payment APIs that will allow Ethereum accounts to easily receive payments from any crypto tokens. As an example, any merchant can now use KyberNetwork APIs to allow users to pay in any crypto tokens, but the merchant will receive payments in Ether (ETH) or other preferred tokens.
Although running on the Ethereum network, KyberNetwork’s roadmap includes supporting cross-chain trades between different cryptocurrencies using relays and future protocols like Polkadot and Cosmos. Ethereum accounts will be able to safely receive payment from Bitcoin, ZCash and other cryptocurrencies via our payment APIs, through this trustless payment service. Derivatives will be introduced to mitigate the exposure to the risk of volatilities for the users of KyberNetwork Crystals (KNC) and selected cryptocurrencies. This will allow users to participate.”
Airswap also reminds Ox protocol except for the off-chain trades negotiation, unlike the Ox’s relayers system.
As to the other moments, the founders told about them better:
“We present a peer-to-peer methodology for trading ERC20 tokens on the Ethereum blockchain. First, we outline the limitations of blockchain order books and offer a strong alternative in peer-to-peer token trading: off-chain negotiation and on-chain settlement. We then describe a protocol through which parties are able to signal to others their intent to trade tokens. Once connected, counterparties freely communicate prices and transmit orders among themselves. During this process, parties may request prices from an independent third party oracle to verify accuracy. Finally, we present an Ethereum smart contract to fill orders on the Ethereum blockchain.”
OmiseGO aims to build a decentralization crypto exchange system that accepts all possible crypto coins.
The founders describe their protocol in such a way:
“OmiseGO is building a decentralized exchange, liquidity provider mechanism, clearinghouse messaging network, and asset-backed blockchain gateway. OmiseGO is not owned by any single one party. Instead, it is an open distributed network of validators which enforce behavior of all participants. It uses the mechanism of a protocol token to create a proof-of-stake blockchain to enable enforcement of market activity amongst participants. This high-performant distributed network enforces exchange across asset classes, from fiat-backed issuers to fully decentralized blockchain tokens (ERC-20 style and native cryptocurrencies). Unlike nearly all other decentralized exchange platforms, this allows for decentralized exchange of other blockchains and between multiple blockchains directly without a trusted gateway token.”
Let’s try to understand the decentralized cryptocurrency exchange’s working principle in the EtherDelta example.
EtherDeltra is existing decentralized crypto exchange run by Ox protocol. The main aim of the crypto exchange is to guarantee open protocol for DEX. The native cryptocurrency there is - as you can guess yourself - ZRX which provides management tools in smart contracts and protocols.
The user interface of the crypto exchange is rather difficult:
Ethereum smart contracts are pieces of code which are written in Solidity language and compiled by Ethereum Virtual Machine. Everyone can read the code here .
Here we will look through the Funds Management and Trading Logic parts of the code.
As I already mentioned, the decentralized crypto exchanges allow users to control their funds. The funds are pooled in the smart contracts which are in a distributed ledger. The bottom line of the code underlines that a user can easily withdraw or deposit funds on his own.
Funds can be moved by two mechanisms:
- Ethereum (ETH) moving
- ERC20 tokens moving
The majority of ICOs are ERC20 tokens on the Ethereum blockchain.
On the screen of the code, only one of the methods is payable because the Solidity safety mechanism allows sending ETH. However, to move ERC20 token a client should implement one more step.
Newmarket orders are stored on-chain (in the smart contract) or off-chain (middleman). In fact, it’s expensive to store them on-chain, that’s why the following mechanism works:
A person (Maker) open a sell or buy order. Another person (Taker) browse the orders to make some actions with them. Elliptic Curve Digital Signature Algorithm (ECDSA) starts working.
How it looks from the inside:
- Maker creates ERC20 token order, specifies its amount, points out the amount of ETH in exchange, and the kind of the order (buy/sell).
- Then, using SHA3 he creates the order’s cryptographic hash
- Using the ECDSA the maker signs the order hash with the help of his Ethereum private key.
- He sends the order and the signature off-chain
- Taker trades against the order and the order data with his key comes to the trade function of the smart contract, where
- the smart contracts verify the signature and
- ensures that the order is not filled or expired.
- The operation happens - voila - funds are transferred and fees are taken.
Line 5 - a unique market order - hash with order amount, price, expiration.
Line 7 - on-chain order is checked and verified.
Then the validation is complete and fees are charged:
It seems the crypto exchanges grunts us new opportunities but a few people have heard about them and even fewer use them. Why? I suppose, there are two factors for that - lack of education and Technology difficulties. How ’s that?
Lack of education - people unaware that there is/are:
- Decentralized Crypto Exchanges
- Its advantages
- Its drawbacks
- How to manage private keys
- Usability: hard to use, not an intuitive interface
- Speed: long time to make a transaction
- Liquidity: Large adaptation ecosystem that needs time to join.
- Full decentralization: Not all the services are decentralized so far.
- Front-running risk: Market manipulation can take place as miners can preview transactions before the validation.
- Accessibility: the cryptocurrency market is volatile, so there is a need for stable crypto coins and fiat integration.
- AirSwap (Airswap blog)
- Altcoin.io (Altcoin.io Exchange)
- Barterdex (by Komodo Platform)
- Bancor Protocol (Bancor)
- Bisq (ex Bitsquare)
- Blocknet (TheBlocknet)
- Catalyst (by Enigma Project)
- Gnosis Dutch Exchange (by Gnosis)
- Hodl Hodl
- IDEX (by Aurora DAO)
- Oasis DEX
- Stellar Distributed Exchange
- Token Store
Graphene Decentralized Crypto Exchanges:
Decentralized cryptocurrency exchanges is a way to a new world that was suggested by Satoshi Nakamoto initially. The route is long and difficult, full of dangers and surprises.There are a lot of new innovations and implementation ahead.
I wrote this guide to underline that this world exists and which is more, it lives and operates. There is an alternative of centralized crypto exchanges, there is an absolute freedom. And there are us who stopped never making the last step. Let’s make this step together!
Follow us on Twitter!