Centralized Vs Decentralized Exchanges

HC

Sid Gandhi

Dec 26, 2022

centralized-vs-decentralized-exchanges
centralized-vs-decentralized-exchanges
centralized-vs-decentralized-exchanges

We'll be talking about centralized and decentralized exchanges, but this blog will be going more toward centralization and decentralization in general. These topics are super interesting and at the core of web3, and we'll kind of get into the technology and stuff as well. So kind of stepping back for a second before we go into the differences here. Why do you need an exchange?

Back in 2012, you had to send, a money transfer at a Walmart to buy Bitcoin. You send it to someone, and you send them your address, and you hoped that once they got the money transfer, they would put money into your wallet. Obviously, these are super inefficient and there are a lot of risks that the person could just take your money and not send you the Bitcoin. Hence what people started to do was set up exchanges.

An exchange was where you deposited your money, your fiat, into an account and then you could submit buy or sell orders to change that fiat into Bitcoin or Ethereum or whatever other tokens. And other people on the platform that had matching orders, like if you were trying to sell Bitcoin and someone wanted to buy Bitcoin, they could match that order, and then that order would be fulfilled, but you never had to interact with that other person.

The exchange platform itself would handle the whole conversion and exchange process. Now, the challenge with that was that it worked well and a lot of people transferred a lot of money through that. But you had to give these exchange platforms control of your funds and control of your wallet so they could add and remove those tokens as you submitted orders. So people started thinking about a way to solve that.

Around 2017-2018, a couple of smart people said, why don't we use smart contract code as the intermediary for these trades and exchanges? They wrote what we now call decentralized exchanges, where you submit orders to a smart contract, and then you're able to convert tokens into other tokens or buy and sell tokens. There was no person on the other side in this case that was buying what you were selling or vice versa. So they created this concept called liquidity pools. In a liquidity pool, there's a pair of two different assets.

So let's take the example of ETH and BTC. When you have these two assets and you want to trade or swap between these two assets, you trade or swap into this pool. This pool is just a bunch of tokens for both types of assets that other people have deposited into the pool. So that lets you easily buy and sell without having another person needing to pick up your particular order.

Now it's pretty interesting because this can be totally automated and as like, let's say Bitcoin in the pool is going down, the pool automatically incentivizes more people to put Bitcoin into the pool to rebalance its ratio against Ethereum. Rebalancing is automated by increasing the interest that you get when you deposit tokens into that pool. You may have heard of the concept of yield farming.

So you can put tokens into a pool that other people can use to trade and you get yield or interest on this. So that's kind of like a brief history of how we got from centralized exchanges to decentralized exchanges. The interesting story about how it all began and where we are today is that we need to make a distinction between an exchange and an on-ramp off-ramp into crypto because these are two separate things.

In general, when people think of exchange now, they think of it as, okay, I'm going to take my Fiat, my dollars, or my pounds, and I'm going to move it into crypto. When they do that, they are thinking less about exchanging other coins. And that's what an exchange should be for. So it's important to see the distinction between those two things because if you're trading crypto to crypto, you should be using a decentralized exchange.

There's no reason not to be. But if you're getting money from Fiat into crypto, then you have to use some kind of on-ramp or off-ramp, and to date, the existing centralized exchanges have been the only place to do that with any kind of usability. How do you get money into your wallet without using one of these centralized exchanges? We believe the way you should do it is to use a centralized exchange to do the on-ramping and then immediately transfer that into a wallet that you own custody over and then use a decentralized exchange to then do further conversions.

But just from an ease of user perspective, people just end up keeping all of their funds in that first exchange because that's easy, that's where you start out and that's where the power comes from on these platforms. People don't realize, obviously until FTX happened, they probably didn't realize that there was any risk to that. But since FTX has happened, the space will need to move forward and kind of think about, okay, if we have a decentralized exchange, why don't we have an on-ramp into our decentralized exchange so that we make it easy for people to deposit their fiat, but then have it go to a wallet that you control and then be able to trade with that wallet.

The main challenge with that is right now the decentralized exchanges are way too slow because they're running on, for example, Ethereum and we know the challenges around running transactions on something like Ethereum. It's just going to be slow and expensive and that's why the centralized exchanges have had so much success while we don't have the user experience to create a good experience on decentralized exchanges, no one's going to use them.

The ones that do exist that kind of don't use Ethereum, you have to kind of still create a wallet and a smart contract on Ethereum, which when I last looked, was costing upwards of a couple of even just to create an account on those decentralized exchanges. Vitalik posted a blog recently on safe CEX and that's like CEX stands for centralized exchanges. So he's trying to make a joke there. But how do you build a centralized exchange that's safe?

His kind of takeaway was that you need to have something called proof of funds. So when you deposit money into a centralized exchange, they can do anything they want with that money. They're not supposed to, they're supposed to leave it in your account so that you can trade with it and do whatever you want. But like in the case of FTX, they were using that money to invest on their own.

So they were taking all their customer's money and making risky investments and bets with them. That's obviously a no-no. But the problem was like, no one knew they were doing this outside of the top, I think like five or six people that SBF had in his inner circle.

So what Vitalik was trying to say is you can use cryptographic methodologies to prove that funds exist in a certain place at a certain time. It felt super interesting and he talks about using zero-knowledge proofs, which are a new type of cryptography that we use in Polybase, but he was saying how you could use those to do something called proof of funds.

There are still some good reasons to use centralized exchanges as they're faster, they're more efficient, and they often have better UX than decentralized exchanges. So the question becomes, like, can we make them safer? The challenge is still like there's a disconnect, obviously, between the crypto world and what we would call the offline world, which is everything that's not crypto, because how do you have proof of funds unless a bank?

What we need is for the big banks to get on board with using a database, because every bank that exists in the world is effectively just a database. They don't have gold backing up the numbers that you see in that database and they just don't have the cash to back up all that money in the database. That number just exists in the database, but they do promise to give you that money if you need it. The key thing is we need one of the banks to move their database away from kind of a centralized system or to even just create a ZK-Proof with their centralized system.

Because if you have a ZK proof from a bank that says, we do have an account with this person and they have X amount of money in that account, then they can create a proof. As long as you trust the bank is doing the right thing, then you can trust that the proof is also valid that's been submitted. That is definitely a stop-gap. Fundamentally, the more people using crypto and the less we have to move from one world to the other, the better we're going to be. So in the future, if you're buying all of your groceries in crypto, you're getting paid by your job in crypto, you're paying for your train fare in crypto, then you don't need to go between the two worlds.

And then you're going to stop seeing the situation where you get a Fiat run, right? Like where people all of a sudden want to exit into Fiat. That's a challenging situation. That's challenging as well for banks today, right? Like banks today, if everyone at the same time run in and ask for cash, the banks wouldn't be able to provide that. It's funny like you mentioned, you could ask banks to back up the fact that a centralized exchange had their funds in there, and then the banks are backed by the government in this weird way.

We're trying to build this decentralized trustless world, but at the end of the day, we still want those guarantees that a large institution like a government provides us because you can't trust necessarily every intermediary. But if it's, for example, cryptographically signed all the way back to a government that can attest that this particular company is a real company, they have real money in a real bank account and that bank account is backed by the US. Government.

That would make us feel much better about depositing money into a centralized exchange. So there's this funny full circle in crypto where it comes back to, but at the end of the day, the government is the one that's like keeping things sane and keeping things safe. Even in the case of FTX, it's the legal process and governmental process that's going to hopefully get people some of their money back. The point here is, a government is just a system of trust, right?

Those governments may be dowels that are on a chain, right, they may be different types of political systems that move onto the chain that enable kind of more direct participation in the democratic process. We need them right now because crypto isn't big enough right now. For example, during COVID the only reason why we can trust the government primarily is that everyone trusts the government, whereas crypto isn't mainstream enough yet that everyone trusts crypto.

Therefore the value of crypto could never go to zero because everyone trusts it. I mean this happens with countries. For example, Venezuela wasn't able to save its currency, right, they had hyperinflation because everyone lost trust in it. Just because you're a government doesn't mean that you automatically get something for free, it's just that people trust it, and generally countries are quite big so they don't tend to suffer from some of the things that crypto suffers from because crypto, relatively speaking is still not as big as a country.