Anyone who bought (or tried to buy) cryptocurrencies on exchanges (e.g. Coinbase, Kraken) has experienced issues: when engaging with the UI, service downtimes, high fees, and so on. Especially in the last months, where prices grew and dropped rapidly, there was so much traffic on their websites that some exchanges had to stop the sign up functionality.
Today’s article is not about criticising exchanges. So far, it’s still one of the few existing means for acquiring cryptocurrencies that is accessible for mainstream audience. However, this does not mean that they should be the only way of acquiring crypto. I did not know much about decentralised exchanges (DEX) before the Web3 Foundation’s event, “A deep dive into Decentralized Exchanges”, where some projects came and explained what they were up to and the challenges they were facing. Not going much into details, I would like to share a quick snorkeling session among some decentralised exchanges.
What Are Centralised Exchanges (CEXs)? (And what is wrong with them?)
Most exchanges you have interacted so far or are planning to interact with are CEXs (you can find a list yourself, there are so many out there). In the middle of this bullish rain of the word “decentralisation”, it should not come as a surprise if someone got the misconception of exchanges being part of these decentralise-everything movement. But they are not, and here are two characteristics that will illustrate why:
- Custodial Wallets: whenever you (finally manage to) create an account at a CEX, you will also be able to create wallets that contain one or more addresses for coin X. The purpose of them is mostly to hold your coins on their platform, e.g. to receive what you bought from them. Now, it is important to remember that these wallets are custodial, it means that the CEX has the private key to those addresses and you probably can’t even find anywhere the private key to them. Do not panic, it doesn’t mean that you got tricked or anything, if you wished to withdraw your funds, they will probably make it happen after you click the button. It just doesn’t happen in the way you think it does.
- Off-Chain Bookkeeping: except for when you send crypto that you stored in an external address into a custodial wallet of an exchange, which is a transaction that is actually processed on the respective blockchain, all the other movements of coins that you make within an exchange are records that are kept in the internal books of the CEX, but not actual transactions on the network.
Similar to banks’ websites, which you can use to transfer money, most of the actions you see when you interact with a CEX’s platform are just UI tricks. Because of the internal bookkeeping system, CEXs can also “reverse” transactions, since most of those movements don’t really happen, they just update records in their books.
In my opinion, there is nothing wrong about CEXs. It’s understandable that they have bookkeeping to avoid the fees that it involves making micro movements. I’d like them to be more transparent and educate their customers about what actually happens and what is just a digit in their databases or a UI trick.
Nonetheless, I constantly recommend people to withdraw the crypto (if you’re not going to trade anytime soon) from the custodial wallets into a cold wallet (a hardware wallet) or any other non-custodial hot wallets (make sure that the keys were generated actually with your “randomised” input or in a randomised way and you store the private key safely). Not only for security reasons, but also because it will give you actually more control over your funds at times when CEXs are slow or stop transacting.
Then, Why Should We Care About Decentralised Exchanges (DEXs)?
Just like in any other industry, it’s important to have competition. No competition, no incentive to improve the services. As mentioned above, there are not that many accessible ways to acquire cryptocurrencies besides CEXs or peer-to-peer marketplaces such as Local Bitcoin. Decentralised exchanges might* become a third option to the question: Where do I buy my crypto?
Before looking into some proposals, here’s a small taxonomy of exchanges that Alan Curtis (Radar Relay) presented during his speech, followed by a simple diagram I made visualising at what point a user loses the custody of the funds when interacting with different services:
The main difference between DEXs and Relayers is that in a typical DEX funds must be deposited into a smart contract. In the case of Relayers, the transactions are directly requested to be processed on the respective Blockchain.
*Note that none of the projects mentioned below are production-ready yet (that I know).
Here Are Some DEXs
They are in the order they presented at the event. Just a reminder: if you’re thinking of investing in any way in them, make sure you do your proper research.
Radar Relay (and the 0x Protocol)
As a relayer, their proposal aims to remove any intermediation that current CEXs or DEXs have, and focus on facilitating a direct transaction request to the network, being frequent traders their target users. Radar Relay relies on the 0x protocol, so users can cryptographically sign transactions directly from their own wallets. Naturally, the audience was in doubt of the suitability of the platform for high frequency trading, due to the decentralised nature of the platform, latency of which relies on throughput of the Blockchain itself (Ethereum in this case).
Decentralisation comes with trade-offs: on one hand you will keep your control over your funds and avoid fees that CEXs impose; on the other hand, it might take some time for the transaction to go through. Nonetheless, Alan mentioned that scalability is one of the challenges that the project is facing and the team is currently exploring Cøsmos (Tendermint) as a solution to this obstacle.
In a simplified way, Airswap is a DEX, where a seller deposits funds into a smart contract. Smart contracts are indexed by an off-chain service to facilitate their discovery by buyers. An oracle, also an off-chain service, will make pricing suggestions for the seller before he/she submits the contract.
White paper**: https://www.airswap.io/#whitepaper-section
** if you read it you’ll see the word private and privacy coming up quite often. Just as a reminder: transactions on Ethereum are as private as the network, unless there is an additional layer that obfuscates the transaction.
Have you ever heard of Dutch auctions? Gnosis’ auction are similar, but not exactly the same. In contrast to the other DEXs, where the price is set by either the seller, influenced by oracles or chosen by the DEXs based on criteria; in the case of Gnosis’ DEX the price is not preset: the final price is actually the outcome of the auction.
In this auction, sellers deposit their tokens. The auction starts with the highest price (determined by the previous auction) being announced and starts lowering. During this process, the buyers place their bids, assumably, at the time the price is the maximum that every particular buyer is willing to pay for the tokens. The auction finishes when the lowest price among all the bids is reached or when the auction’s time limit is reached.
Now, the fairness of this system relies on the assumptions of a significant number of participants in the auction and on the ability of every bidder in making their call on time (consider Ethereum’s latency or risk of being clogged). Nonetheless, Gnosis’ system is a pretty different approach to token trading, hence I thought it was worth for people to learn about it in the hopes of raising interest in different systems to solve a problem. For every reader, I encourage you to think if this system is fair and to think of ways in which you could game it.
(This is the first time I learn about Dutch auctions and their auctioning system. Got me really interested, I will publish a visualisation of both when I have some free time!)
In Kyber’s proposal, CEXs are regarded as possible customers. As a DEX, everything is ran on chain and every interaction is done by smart contracts. What I found really interesting about Kyber is that their target audience are high volume token holders and their reserve system. A reserve is a large net worth fund. Simply put, here’s how trading works: A user offers token a in exchange of token b. Kyber chooses the reserve that offers token b at the best price, withdraw a contract with the corresponding token b.
Whenever high volume transactions are included, it is only natural that people raise questions regarding regulations and compliance. Without much detail to it, Tn Lee explained that Kyber is working closely with local regulators to make sure that KYC and risk assessment is properly done with all the participants. Finally, how do CEXs fit in Kyber’s picture? As most CEXs are large funds, they could participate as a reserve, and have an additional revenue stream.
Kyber’s FAQ: https://kyber.network/#faqs
It’s an asset management system, interesting, but does not really fall within the scope.
Matt Di Ferrante
This talk can be summarised by: ¯\_(ツ)_/¯ (yup, literally). I’m just kidding, even if unexpected, it was the talk I enjoyed the most and it was kind of refreshing among product-focused speeches. I will post a link with his slides for the ones who want to review them.
Even though Matt is working on a privacy focused DEX project, he did not even mention it (I decided to not publish the link to the project, if you want to get involved, you’ll have to ask him directly!), and rather used up the time to give a refreshing session on how cryptography can help with increasing privacy on decentralised applications. He explained a bunch of zero-knowledge protocols including ring signatures, zk-SNARKs, which are lately pretty trendy due to certain privacy coins using them.
Matt’s LinkedIn Profile: https://www.linkedin.com/in/matthewdiferrante/ (he loooooves to be spammed :P).
Basically, Plasma. Omise does have a proposal for a DEX, however the speaker did not talk about it. David was really excited and fun, though.
Keep in mind that these are not the only existing DEX projects. I’ve heard of other DEX names but I did not spend the time to learn about them yet, so I limited to these ones. According to a tweet, the event was livestreamed, but I can’t find the link to the recorded file (will post if found).
I hope you enjoyed this snorkeling session!