# 0x: an open protocol for trustless, low friction exchange of ERC20 tokens

- Channel: [Devcon](https://streameth.org/devcon)
- Date: 2018-10-09
- Duration: 21:01
- Topics: Science & Technology
- Watch: https://streameth.org/watch/yt-9d019RycObk
- YouTube: https://www.youtube.com/watch?v=9d019RycObk

## Description

Visit the https://archive.devcon.org/ to gain access to the entire library of Devcon talks with the ease of filtering, playlists, personalized suggestions, decentralized access on IPFS and more.
https://archive.devcon.org/archive/watch/3/0x-an-open-protocol-for-trustless-low-friction-exchange-of-erc20-tokens

In the two years that have passed since the Ethereum blockchain’s genesis block, numerous decentralized applications (dApps) have created Ethereum smart contracts for peer-to-peer exchange. Rapid iteration and a lack of best practices have left the blockchain scattered with proprietary and application-specific implementations. As a result, end users are exposed to numerous smart contracts of varying quality and security, with unique configuration processes and learning curves, all of which implement the same functionality. This approach imposes unnecessary costs on the network by fragmenting end users according to the particular dApp each user happens to be using, destroying valuable network effects around liquidity. We present 0x: an open protocol and shared settlement layer for trustless, low friction exchange of ERC20 tokens.

Speaker(s): Will Warren
Skill level: Intermediate
Track: Developer Infrastructure


Follow us: https://twitter.com/efdevcon, https://twitter.com/ethereum
Learn more about devcon: https://www.devcon.org/
Learn more about ethereum: https://ethereum.org/ 

Devcon is the Ethereum conference for developers, researchers, thinkers, and makers. 
Devcon 3 was held in Cancún, Mexico on Nov 1 - 4, 2017
Devcon is organized and presented by the Ethereum Foundation, with the support of our sponsors. To find out more, please visit https://ethereum.foundation/

## Transcript

so I'm going to get started uh I'm very excited to be here today to talk to you about zerox uh this project has been a long time in the coming um and uh I hope that uh we can get some people excited about it today w uh so just to outline this presentation uh going to quickly give a little bit of background and timeline on zerx protocol uh motivate the problem we are trying to solve uh talk a little bit about the existing work uh then we'll go into zerx protocol we'll talk about the benefits of an open standard uh we'll cover the developer ecosystem that we see developing today uh and we'll quickly discuss the need for governance for open protocols uh then we'll go into dap Integrations and something that we like to call token abstraction uh so my co-founder Amir and I started working on zerox just over a year ago um we released our white paper in February of this year and since then have put together a really talented and awesome team uh all eight of us are here at at the conference we love chatting with people so feel free to come up and say Hello uh and we're happy to answer any questions uh so really the motivation behind creating zerox protocol was this long-term theme that we see um coming into existence where where anything that can be assigned to value in the world is going to eventually be tokenized and moved onto an open Financial Network like the ethereum blockchain uh so this can be things like traditional assets like Fiat currencies stocks and bonds debt assets all the way to scarce digital Goods like video game items and loyalty points and airline miles uh and even things that are more abstract like attention uh so naturally with all of these different tokens that are going to eventually find their way onto the ethereum blockchain there needs to be a very low friction way to exchange these tokens uh so uh just taking a quick look at the exchange ecosystem on the ethereum blockchain uh kind of this this is kind of the state of the etherium blockchain back when we started there's been quite a few developments uh recently as well but there's there's a handful of existing decentralized exchanges uh and there's a lot of decentralized applications that require exchange functionality in order to operate so things like prediction markets or stable coins or decentralized fund management platforms all of these things require exchange functionality uh so the problem that we identified in the ecosystem was that every single one of these exchanges and daps was creating their own proprietary and custom Smart contracts from scratch uh and what this meant is that not only would each exchange have to bootstrap liquidity from stretch but it would also expose end users to a bunch of different smart contracts that have varying levels of security and efficiency um and they all do the exact same thing uh so that's not a very efficient approach another issue with having a bunch of different implementations of exchange smart contracts is that there's no interoperability between any of them uh so it fractures the ecosystem and it kind of results in less liquidity for everyone so in in our view smart contracts should really behave like uh modular building blocks that can be assembled and reconfigured uh and we also believe that Open Standards tend to win out in the long run uh so I'm just going to briefly talk about the different approaches to decentralized exchange uh that exist and uh give like a high level view of the pros and cons uh so the very first decentralized exchanges that were created on the ethereum blockchain kind of took the same functionality of a centralized exchange and pulled it into an ethereum smart contract uh so the the ethereum smart contract would store an order book uh within the contract uh so what this means is that every time someone wants to post modify or cancel an order they must pay gas costs and create an ethereum transaction uh and this becomes completely unrealistically expensive expensive for any sort of Market maker to create liquidity uh using an onchain order book uh not only is it really expensive but you also bloat the blockchain with tons of unnecessary transactions that aren't necessarily moving any value uh they're also High latency a second class of decentralized exchanges are automated market makers and automated market makers uh instead of having two parties on either side of either side of a market trading directly uh both parties trade with a smart contract and the exchange rate that is offered by that smart contract uh is is modified deterministically according to how strong the market forces are on either side of the market um augur uh spent a long time working on these working on finding working implementations of automated market makers and found that they're really subject to front running they can be gameable and they're really low throughput uh so if you have one party with a large pot of some kind of token and another counterparty that would like to trade with them uh instead of just doing one big trade directly they must chop up that trade into little tiny pieces and trade with the smart contract back and forth so it's really inefficient uh the third approach to decentralized exchange and we haven't seen any uh examples in production yet but we will soon I'm sure are State channels uh and so State channels are amazing in for reducing latency and increasing throughput because with State channels uh transactions occur off of the blockchain uh and you can sort of accumulate uh a series of intermediate State changes aggregate them and settle them all on the blockchain in a single transaction uh the issue with State channels is that you know they're great if you want to do day trading but if you want to just do one block trade you just want to buy a big chunk of tokens in a medely use them uh it's there's a lot of friction around using a state Channel you have to move your funds into the channel you have to place down a security deposit to ensure that everyone is behaving honestly within that channel and then when you want to move your funds out of the state Channel there's a there's a challenge period which is required also to ensure people are behaving honestly uh another downside to State channels is that when you move into a state Channel off of the blockchain you isolate yourself from all of the cool and interesting smart contracts that exist on the ethereum blockchain um yeah so Zach pioneered the offchain order book with onchain settlement approach uh around a little a little while after uh we came up with a similar approach but it's really a protocol instead of an nonchain order book uh so zerox protocol uh really is comprised of a standard order schema that represents uh the different par parameters associated with a given uh a given order so the two assets that are being exchanged the exchange rate the expiration time for this order um and a cryptographic signature of the above parameters uh and that is coupled with a smart contract system that is responsible for settling these trades directly on the blockchain um what's really makes zerox a protocol is that there really aren't any rules about how you choose to pass these cryptographically signed chunks of data around off of the blockchain uh so the transport layer is arbitrary you can generate one of these cryptographically signed orders and you can send it to a counterparty in an email or over Facebook or you can write it down on a piece of paper and send it to them using a carrier pigeon it doesn't matter the cryptographic signature just needs to be valid um another thing that is different is that the message passing semantics are arbitrary and you can choose to use a variety of different strategies um so if I wanted to trade directly with a counter party in a peer-to-peer fashion uh like an over-the-counter trade uh I can just create this order that specifies the parameters I'm interested in uh trading at and I can cryptographically sign it and I can send it to my counterparty and we can settle that trade directly on the blockchain completely free um there's no fees involved other than the gas costs uh but naturally people need to go to a location where a bunch of different parties are interested in trading and where these orders are aggregated in a single location uh and we call these Rel layers or they're very similar to decentralized exchanges uh what's really cool about ZX is that anyone can be a relayer anyone can create a decentralized exchange and charge trading fees on all the volume that they create uh they keep 100% of the fees that they charge um there's also a variety of different relayer strategies that a relayer can decide to use so you can use an open orderbook strategy kind of like ether Delta where there's a public Post-it board and people can put their orders up and anyone can take them down you can also do a centralized matching strategy where a delayer will only accept orders onto their order book if they are specified as the only entity able to fill those orders and when they find two orders on either side of the market they can batch fill them simultaneously and synchronously on the blockchain uh and you can eliminate things like front running uh a third option is a shapeshift type exchange where someone essentially acts as a reserve manager and they just post a bid in an ask for a single trading pair so why create an open standard why uh well one of the reasons is because if you have an open stand you can create really robust developer tools uh so things like Zer xjs our JavaScript library and things like our standard relayer API and with these tools you massively lower the barrier to entry for new people and developers that want to create decentralized exchanges um and so what you end up getting are a variety of different decentralized exchanges that are highly competitive on fees as well as user experience they also find in Target different Market niches uh and you end up with a diversity of different decentralized exchanges uh a second reason to create an open standard is that if every single decentralized exchange is speaking the exact same language it creates these Network effects around liquidity where each relayer isn't necessarily competing with the others they could actually benefit from a new relayer ENT entering the ecosystem uh as arbitrages are are taken advantage of across different exchanges risk-free and a ically uh decentralized applications can also be a source of customers for these decentralized exchanges or relays so since deploying zerox protocol on the ethereum mainnet uh in August 15th um we've seen just a crazy explosion of development activity um there are upwards of 10 different completely independent developer teams creating Rel layers on top of zerx protocol um so I'm just going to give you a closer look at a few of these so the first relayer to go live on the ethereum mainnet is kin Alpha uh and this was created by a single developer in their spare time over the course of a few weeks um you can see that it leaves a little bit to be desired in terms of the user experience um but we just thought it was pretty amazing that someone could go and create this uh on their own in a matter of weeks uh another really cool relayer that's worth checking out is radar relay uh they're live on the main net today uh you can go to radar relay.com and check them out uh they're doing uh a little bit of volume but their API should be up soon uh and third is paradex uh paradex has created this beautiful user interface uh and they're expecting to Launch uh their beta on the main net uh this month uh and they're using a centralized matching strategy so we're really excited to see all this development activity going on and uh I think that we will see a dent put into the centralized exchange industry uh some other interesting development that we've seen uh are just independent developers out there creating trade explorers that allow you to view and explore the various trading activity going on on top of zerox protocol um and you can sort of sort trades by different Rel layers and by different trading pairs Etc uh it's been really exciting for us to see people building things completely independently on top of the protocol and just finding out about it on Reddit uh so now I want to talk about something that is a little bit different uh that zerox protocol enables and I think this is something that's pretty unique compared to the other uh approaches and implementations that are out there today uh so zerox protocol allows smart contracts to natively execute trades in a single line of smart contract code uh and this is really powerful uh because this essentially allows ZX protocol to act as an exchange module that exist natively within the evm uh and this allows ZX to be treated as a sort of fundamental building block that can be combined and built upon by other developers creating their own protocols uh and to date we've seen two examples of completely independent uh protocols being created on top of zerx uh dydx and Dharma I would encourage you to go check them out there are also a variety of other centralized applications that have um you know decided to uh either right now or some point in the future uh integrate zerox protocol uh because it will allow them to get the functionality they need without having to write any code from scratch uh so now I want to talk a little bit about governance so zerox is an open system and there are a variety of stakeholders and they each have their own motives and their own desires that they need out of the protocol um but they all benefit from the network effects of building on top of the same shared standard uh and at the same time zerox protocol is a system of ethereum smart contracts that are immutable but they must remain future proof over time uh so how do you decide on protocol upgrades uh you can either allow a small group of developers to make all the decisions about the future Direction of the protocol or you can allow all of the stakeholders in the system to have a fair say um so what we decided to do is to create a decentralized governance mechanism that uses token voting uh for future upgrades to the protocol so uh I understand that everyone here is probably a little bit sick of all the tokens that are out there today uh and they might not want to deal with another token so I'm going to just briefly talk about something called token abstraction that ZX enables and I think is really exciting um but we're going to have to think about five or 10 years out from now uh so when we think about decentralized applications um you know we used to think of them as sort of these vertically integrated uh mono lists that might have been built on the Bitcoin blockchain or the ethereum blockchain but I think what we're starting to is an unbundling uh where there's many layers in the decentralized application stack and they all have they're all specialized networks with distinct incentives and tokens so you might imagine that a decentralized application requires a consensus layer it might require some file storage and some computation and it might require an external some Oracle to inject external data into that D so if we we have all of these different layers in the decentralized application stack and you're the end user of this stap it's going to require it's going to require you to have a bunch of these different tokens for each layer of the stack and that's something that I don't think very many people are excited about uh so in this example you can see um there's some sort of decentralized application and what it wants to do is it wants to take a data set from say ipfs it wants to run some computation on that data set using something like truebit and the result of that computation is going to be injected into a smart contract which makes some sort of decision depending upon the result something that just would not be feasible within the evm uh in order to power some sort of sophisticated decentralized application like this you might be required to have a handful of different tokens and that's not a very good user experience so something that we're really excited about that we think ZX will play a role in in the future is something called token abstraction so as the end user of a decentralized application instead of having to hold a variety of different tokens that you may not know or care about or really have any vested interest in you can just hold on to some tokenized Fiat uh and you can pass in this Fiat along with a thick stack of ZX orders into the decentralized application that you want to to use into the smart contract it will forward those Fiat tokens and the 0x orders onto the ZX smart contracts and the smart contract will synchronously and immediately receive the variety of tokens that it needs to power that decentralized application uh the smart contract will immediately go on its merry way using them as it needs to uh so you can imagine that the takeaway from this is that instead of having to have a bunch of different tokens as an end user in the future you might just go to a decentralized application and see that it's going to cost you $33.50 in Fiat tokens in order to access some of its functionality uh so lastly uh we're working on version two of zerox protocol today and we would love to get some Community involvement and feedback um some of the things that we're really excited about including uh in our zerx Improvement Pro proposals are things like support for non-fungible tokens uh Atomic order matching order Generation by smart contracts and a variety of other things as well so uh we welcome you to come and contribute to the protocol and shape its future so thank you very much I appreciate the attention [Music]
