CBO at token.store trustless exchange
An intro to the world of trustless exchanges, where funds are not safe-guarded by centralised entities. Their architecture, a market overview and comparison with centralised exchanges.
Disclaimer to disclose vested interests: although this article aims to provide an impartial overview, the author is affiliated to token.store decentralised exchange
Decentralised exchanges are an intriguing and promising part of the cryptocurrency ecosystem. Over $1.5 billion of crypto has been stolen from centralised cryptocurrency exchanges. The Mt Gox exchange hack alone lost 6% of all bitcoins in circulation at the time. Leading voices in cryptocurrency have clamoured against centralised exchanges, with Vitalik Buterin stating that he hopes “centralised exchanges go burn in hell as much as possible” and cryptocurrency pioneer Nick Szabo calling trusted third parties “security holes”. In fact, the will to move away from the “trust-based model” is a founding principle of Bitcoin according to Satoshi’s whitepaper. A solution which makes exchanges as secure as their underlying blockchain has been made available not so recently (in crypto terms). This solution is decentralised exchanges (DEXs)– exchanges which offer a trustless process for digital asset deposits. Nonetheless, almost three years since their initial proliferation, the volume of cryptocurrencies traded on decentralised exchanges is currently less than 1% of that reported to be traded on centralised exchanges.
This article provides a brief overview of the current state of decentralised cryptocurrency exchanges on the Ethereum network. It 1) explains what decentralised exchanges are, 2) provides some historical context, 3) summarises the types of DEXs on the market, 4) demonstrates a market overview of DEXs and discusses how they can be ranked. Subsequently, 5) the case for decentralised exchanges is presented and 6) some brief reasons for their current modest market position in comparison to centralised exchanges are stated.
The exact definition of a ‘decentralised exchange’ is not entirely agreed-upon by cryptocurrency enthusiasts and industry leaders. The much-discussed concept of decentralisation is best regarded as a spectrum: there are many exchanges which call themselves ‘decentralised’, which are in fact decentralised in different ways and to different extents.
If we consider the core functions of exchanges to be capital deposits, order books, order matching and asset exchange, then few exchanges which are commonly deemed ‘decentralised’ decentralise all four aspects. However, the majority of ‘DEXs’ decentralise capital deposits.
The most commonly accepted definition of a ‘decentralized exchange’ is “a protocol which facilitates the exchange of assets, while not holding its users’ assets directly”: the exchange does not hold the keys to the assets deposited and is therefore ‘trustless’. This may involve the depositing of assets into a smart contract, from which only users making the trade can withdraw them. Trustless custody of funds is essentially what gives an exchange the right to call itself decentralised.
The first instances of cryptocurrencies being exchanged through a non-custodial marketplace were trades executed through the so-called atomic swap model (the first full account of an atomic swap was provided in 2013). Atomic swap technology is followed by the rise of DEXs with orderbooks, such as the fully on-chain Oasis and the 0x and EtherDelta off-chain protocol models, such as token.store (off-chain orderbooks, on-chain order-matching and on-chain settlement) in 2016 and 2017. By 2018, semi-decentralised models with off-chain order-matching occupied the majority of the DEX market share. These DEXs with orderbooks are currency-centric and are non-interoperable with other blockchains. Most DEXs are currently built on the Ethereum blockchain (allowing trade between ERC20 tokens — a type of token which is built on Ethereum). There are also DEXs implemented on Waves, and the second half of 2018 has seen a great increase of volume traded on EOS and Tron-based DEXs. User-friendly cross-chain DEXs may be developed in the not-so-distant future.
There are at least four dozen different protocols currently in use by operating decentralised exchanges (of all blockchains) and approximately one hundred protocols, if those in development or earlier stages are included.
To compare the architecture of decentralised exchanges it is worth understanding the below terminology:
Decentralised exchanges on the Ethereum network can be divided into the following categories:
2. Fully on-chain: On-chain settlement, on-chain order-matching and on-chain orderbooks
3. Semi-decentralised/hybrid exchanges: on-chain settlement, off-chain order-matching and off-chain orderbooks
4. Liquidity pools: on-chain settlement, but trades are not peer to peer, but between traders and a liquidity pool
The below table is compiled using open-source resources on the internet. It provides an overview of the ETH DEXs currently on the market, indicating which DEX category each exchange can be attributed to and which protocol each DEX runs on. While all of the DEXs mentioned are trustless, and thus do not control their users’ private keys, they are decentralised to varying extents. All of the DEXs offer on-chain settlement, but ‘semi-decentralised’ or ‘hybrid’ exchanges and liquidity networks (which can also be considered as ‘semi-decentralised’) have off-chain order-matching. Only liquidity networks do not have peer to peer transactions (transactions occur between users and a liquidity pool instead). ‘Fully decentralised’ Oasis DEX is the only exchange featured which has an on-chain orderbook. ‘Relayers’ are exchanges which host their own off-chain orderbook and are part of the 0x network. ‘On-chain protocol’ exchanges are one of the earliest models of DEXs, which have similar smart contracts to EtherDelta. They are as decentralised as relayers on the 0x network.
Three DEXs currently block users from the USA from accessing their website through IP address blocking due to regulatory uncertainty in said country (see SEC v Zachary Coburn case). The ‘KYC required’ columns shows the varying know-your-customer requirements of DEXs, with most DEXs not requiring users to register and allowing them to stay anonymous.
There are a few parameters by which DEX market share can be judged by. It is worth noting that the below measures are indicative of trades made on one smart contract: trades made on different websites, but on one smart contract (e.g. etherdelta.com and forkdelta.app) count towards the measures of one smart contract. The below measures can be used to estimate the share various exchanges occupy in the market of ETH-based DEXs. Closer inspection is needed to determine the different niches of tokens each exchange serves.
Volume is a factor which many users look at first to rank exchanges. CoinMarketCap — one of the most visited websites in crypto uses volume to rank exchanges. However, volume can easily be faked by bots trading with themselves. This is especially prevalent and easy to do for centralised exchanges, as gas fees are not paid to settle trades on CEXs (unlike on DEXs). A study by the Blockchain Transparency Institute claims that the non-artificial volume of the top 25 Bitcoin trading pairs is less than 1% of the volume shown on CoinMarketCap for the vast majority of the top 25 centralised exchanges. While gas fees must be paid to create artificial volume on DEXs, it is a common practice for tokens to inflate their volume on all exchanges. There is little that DEX operators can do to stymie this, since more often than not they have no control over what trades happen on their smart contracts.
The above diagram shows the trading volumes of each DEX on CoinMarketCap. CoinmarketCap volume does not fully reflect the volume of smaller exchanges, since it does not include the volume of tokens which are not listed on CoinMarketCap. Other exchanges depicted in Etherscan’s chart below are not included, since they are not listed on CMC.
Number of transactions is another measure which can be used to compare the popularity of DEXs. It is featured most prominently by Etherscan’s DEX tracker to compare DEXs. Artificial volume impacts number of transactions to a certain extent, although trades by bots seem to be mid-to-high-sized to limit the amount of gas paid. Exchanges which have more users trading small volumes (such as exchanges which list small airdrop tokens) may be slightly over-represented in comparison to exchanges which have less users trading greater volumes (such as exchanges with prevalent professional market makers).
A less-known measure to rank exchanges is ‘number of active users’. This refers to the number of unique Ethereum addresses which have made trades on the exchange in the time fram of 24 hours. This is perhaps most indicative of the popularity of an exchange, since most bots creating artificial volume use a limited amount of addresses to trade between each other to make management simple. Again, exchanges which have a greater proportion of users trading smaller volumes are overrepresented by this measure in comparison to genuine volume.
Traffic is a metric which measures the popularity of an exchange relatively well, although it cannot be accurately estimated for less popular websites (which are not shown in the above table). It is unlikely that traffic is manipulated, unlike the other metrics. The traffic metric over-represents exchanges with more human users trading smaller volumes in comparison to exchanges which have a large amount of trading bots trading large volumes (such bots trade through the API and not through an exchange’s website/front-end).
SimilarWeb estimates organic traffic particularly accurately for larger websites — studies have shown that it estimates organic traffic with an accuracy of 1% and overestimates total visit numbers for websites with over 100,000 monthly visits by approximately 17%. SimilarWeb does not show the traffic of websites with significantly less than 100,000 monthly visits: this is why so many exchanges tested through Similar Web in this article do not have available traffic figures.
The amount of ETH deposited in the smart contract can be considered. It does not fluctuate as much as volume and shows to an extent the caliber of the users on the exchange. It represents inactive or dormant users, unlike the other three measures. Funds can be held in smart contracts safely, so a few inactive ‘whales’ are likely to disproportionately inflate the ranking of certain exchanges by deciding to keep their assets in the smart contract.
The most important raison d’être and advantage of decentralised exchanges (DEXs) over centralised ones is the security that trustless custody of customer funds offers. This is important, since theft of funds from centralised exchanges is a major risk-factor for customers. Over $1 billion has been stolen from centralised cryptocurrency exchanges in 2018, with losses reaching $927 million by the end of Q3.
By entrusting funds to a smart contract or protocol, instead of to a centralised corporation, human error and greed are largely eradicated as risk-factors; if the smart contract is designed in a fully trustless way. So far, there has been at least one case where funds have been stolen from the smart contract of an exchange which calls itself ‘decentralised’: this is largely due to semi-decentralised exchange Bancor’s smart contract being significantly malleable.
It can be argued that semi-decentralised exchanges such as Bancor and IDEX do not deserve to be labelled as ‘DEXs’, as they are not entirely trustless. While funds are kept in smart contracts, IDEX and Bancor can freeze customers’ funds.
Fully decentralised exchanges (such as EtherDelta and token.store), however, do not have the ability to freeze funds and their smart contracts have never been hacked. Nevertheless, these DEXs still have some vulnerabilities. EtherDelta was subject to a phishing hack, where its website was compromised (funds remained safe in the smart contract, but some users were tricked into inputting their private keys into the hacked website)
The vast majority of decentralised exchanges do not require Know Your Customer (KYC) sign-up or registration: users can trade anonymously by simply attaching their cryptocurrency wallets through browser plug-ins such as MetaMask or importing or creating local wallets. Most centralised exchanges require a relatively lengthy sign-up process, in which they ask for users’ emails and other personal details. This is due to the design of the smart contracts of a significant proportion of DEXs and to an extent the lower regulatory risk DEXs face.
The regulatory status of decentralised exchanges is still largely uncertain. However, users can be certain that certain DEXs will not be shut down, as the smart contracts of some DEXs cannot be taken offline. While founders of DEXs may be pressured into taking down websites, anyone can create a new website, which interacts with an existing smart contract (this applies to the fully decentralised category of DEXs — DEXs whose smart contracts cannot be fundamentally changed or paused). An example of a website not affiliated to the owners of a DEX interacting with a DEX’s smart contract is ForkDelta.
While exchanges such as IDEX, DDEX, DEx.top and token.store have geo-blocked some states or the entire United States of America from their websites due to regulatory pressures, Americans can continue to interact with the smart contract using tools such as Etherscan’s ‘Write Contract’.
The fees and general functioning of most decentralised exchanges are more transparent and predictable, as they function according to what is written in the smart contract. Nevertheless, certain smart contracts can be predictably unpredictable, if the possibility for major changes are coded into them. Furthermore, the DAO debacle has demonstrated the need for better security auditing of smart contracts.
There is a reason why only a small fraction of cryptocurrency volume is traded on DEXs, despite them offering a higher degree of security. The most obvious reason is that simple-to-use DEXs only offer trade on one blockchain: most of the top 10 cryptocurrencies are on different blockchains, therefore cryptocurrency pairs such as BTC/ETH cannot be traded on user-friendly DEXs.
However, centralised exchanges such as Binance also trump DEXs in terms of the trading volume of ERC20 tokens. This is ultimately due to traders currently preferring the simplicity and speed of off-chain trading to security.
DEXs are generally difficult to use for beginners: some DEXs lack automatic order-matching and have relatively complicated ways of depositing to the smart contract (e.g. wrapping ETH).
DEXs have liquidity issues partly due to DEXs with on-chain order-matching requiring users to pay gas fees to cancel limit orders. Semi-decentralised DEXs such as Bancor and IDEX have off-chain order-matching and offer novel liquidity solutions, but nevertheless have relatively low volume for the above reasons.
On-chain protocol DEXs are also faced by the problem of order collisions: when a market taker (A) attempts to take a limit order, another user (B) may attempt to take it as well, while A’s instant order is being confirmed on the blockchain (due to on-chain order-matching). B may be able to take the order A is trying to take before A, if he pays a higher gas fee. In this case, A’s transaction will fail and he will have to pay gas fees (miner fees) for the failed transaction.
Semi-decentralised exchanges are not faced by such a problem. However, gas fees paid by users on exchanges such as IDEX are higher than on off-chain protocol DEXs. This may push users (especially market makers who receive rebates on trading fees) to trade on CEXs.
DEXs have far less trading features than top centralised exchanges. While DEXs such as Expo/dYdX offer the trading of margin/short tokens (Leveraged ETH and Short ETH), mainstream decentralised exchanges do not offer margin trading or a slick interface for in-exchange technical analysis. Volume traded through the dYdX protocol is also very low (below $40k at press time); it is a more complex product to use than centralised leverage trading platforms.
Decentralised/trustless exchanges are much needed for the secure trading of digital currencies: centralised exchanges are by their very nature highly vulnerable to human error, greed and hacking risks. The Ethereum network has a variety of DEXs built on it, with differing architectures. However, fully trustless exchanges on the Ethereum network lose out to centralised exchanges in functionality. This is not so for decentralised exchanges on the EOS network, where trading is smoother than on traditional CEXs. However, trustless exchanges are yet to facilitate cross-chain exchanges in a user-friendly fashion.
If you liked the article, please hold down the ‘clap’ button up to 50 times— this helps me gain exposure :)
I am the CBDO of token.store and a student on a dual degree with UCL and Sciences Po Paris. Interested in everything blockchain and history.
Blockchain Transparency Institute (December 2018). Exchanges Volumes Report December 2018. Available at: https://www.blockchaintransparency.org/december-2018-rankings. Accessed 31-Mar-19
Blockgeeks. What are Atomic Swaps? Available at: https://blockgeeks.com/guides/atomic-swaps/. Accessed 31-Mar-19
CipherTrace Cryptocurrency Intelligence (2018 Q3). Cryptocurrency Anti-Money Laundering Report. Available at: https://ciphertrace.com/wp-content/uploads/2018/10/crypto_aml_report_2018q3.pdf. Accessed 31-Mar-19
Cuen, L. (26th July 2018). Waves’ Decentralized Exchange Had a $6 Million Debut. Then it Got Hacked. Available at: https://www.coindesk.com/waves-crypto-exchange-bitcoin. Accessed 31-Mar-19
Distribuyed and al. Available at: https://github.com/distribuyed/index. Accessed 1-Apr-19
Langridge, P. (2016) How Accurate Are Website Traffic Estimators?. Available at: https://www.screamingfrog.co.uk/how-accurate-are-website-traffic-estimators/. Accessed 1-Apr-19
Larcheveque, Eric (29th December 2018). 2018: A Record-Breaking Year for Crypto Exchange Hacks. In Coindesk. Available at: https://www.coindesk.com/2018-a-record-breaking-year-for-crypto-exchange-hacks. Accessed 31-Mar-19
Luu, Loi (last updated 14th August 2017). Solving the Liquidity Challenge of Decentralized Exchanges. In Coindesk. Available at: https://www.coindesk.com/solving-liquidity-challenge-decentralized-exchanges. Accessed 30-Mar-19
Janus, E. (17th December 2018). Out of Top 10 Exchanges, only Binance, Bitfinex do not Fake Volume. Available at: https://bitcoinist.com/binance-bitfinex-not-fake-volume. 31-Mar-19
Khatwani, S. (13th October 2018). Decentralized Crypto Exchanges vs Centralized Exchanges Like Binance, Bittrex. Available at: https://coinsutra.com/decentralized-vs-centralized-crypto-exchange/. Accessed 31-Mar-19
Lupec, I. (22nd November 2017). We analyzed 1787 eCommerce websites with SimilarWeb and Google Analytics and that’s what we learned. Available at: https://www.omniconvert.com/blog/we-analyzed-1787-ecommerce-websites-similarweb-google-analytics-thats-we-learned.html. Accessed 2-Apr-19
Madeira, Antonio (23rd November 2016). What is a Decentralized Exchange? In CryptoCompare. Available at: https://www.cryptocompare.com/exchanges/guides/what-is-a-decentralized-exchange/. Accessed 31-Mar-19
Nakamoto, S. (31st October 2008). Bitcoin: A Peer-to-Peer Electronic Cash System. Available at: https://nakamotoinstitute.org/bitcoin/. Accessed 31-Mar-19
Norry, Andrew (19th November 2018). The History of the Mt Gox Hack: Bitcoin’s Biggest Heist. In Blockonomi. Available at: https://blockonomi.com/mt-gox-hack/. Accessed 31-Mar-19
Siegel, D. (2016). Understanding The DAO Attack. In CoinDesk. Available at: https://www.coindesk.com/understanding-dao-hack-journalists. Accessed 1-Apr-19
Szabo, Nick (2001). Trusted Third Parties are Security Holes. Available at: https://nakamotoinstitute.org/trusted-third-parties/. Accessed 31-Mar-19
Wilmoth, J. (21st December 2017). Cryptocurrency Exchange EtherDelta Hacked in DNS Hijacking Scheme. Available at: https://www.ccn.com/cryptocurrency-exchange-etherdelta-hacked-in-dns-hijacking-scheme. Accessed 31-Mar-19
Create your free account to unlock your custom reading experience.