0x is a base level, open protocol for decentralized exchange on the Ethereum blockchain.
0x is an open protocol for partially decentralized exchange on the Ethereum blockchain. Acting as a base level protocol upon which developers can build exchange functionality into their decentralized applications 0x represents an attempt to improve upon today’s fragmented landscape of proprietary and application-specific decentralized exchange implementations, as they currently limit the ability to realize the full potential impact of network effects. While centralized exchanges offer more seamless user experiences, they generally suffer from a single point of failure as they can be mismanaged internally and/or targeted by hackers. On the opposite end of the spectrum, completely decentralized exchanges (DEX’s) are trustless, non-custodial systems facilitating the exchange of tokens, but come at the cost of being slow, illiquid, and generally offer poor customer experiences. In its simplest form, the 0x protocol is a hybrid implementation of the two approaches that utilizes off-chain order management, which is typically administered in some degree of aggregation by parties called “relayers”, with on-chain settlement. This approach allows traders to remain in control of their funds while eliminating the friction of managing order books on the blockchain. This approach does, however, introduce alternative challenges.
The process works by allowing market makers to signal their intent to trade a specific Ethereum asset at a certain price for a certain period of time off-chain where market takers may see and accept it. The transaction is only settled on-chain and value is transferred between accounts as a final step. The 0x team are of the conviction that open codebases have an inherent competitive advantage (over those which are proprietary) in the long run, all other things being equal, and encourage relayers to share their order books with one another via APIs, to increase liquidity across the network 0x expects and therein hopefully enable the network to become more usable as relayers draw from larger pools of liquidity. 0x raised $24 million in an August 2017 token sale. 0x’s native token, ZRX, was the first ERC20 token to be hosted on the Coinbase Pro exchange.
For a comprehensive explanation and commentary, read the 0x Cryptoasset Report.
The 0x Cryptosystem
0x allows for transactions to be executed point-to-point or through Relayer-maintained order books. The point-to-point schema allows two parties to exchange tokens directly using their preferred medium of communication and without the need for an order book. This bilateral approach allows the maker to specify a specific taker address that renders the order useless to outside parties (a more detailed explanation can be found here). While this method is secure and elegantly simple, it likely does not provide adequate incentives for market makers to absorb the expense associated with building and maintaining an exchange operation.
To foster a liquid market 0x enables anyone to join the network as a relayer, by maintaining an off-chain order book where makers and takers can discover one another. The 0x order schema allows relayers to broadcast orders so that anyone may intercept the order as a taker by cryptographically signing and submitting it, and added a field where arbitrary fees in ZRX can be collected and paid out to relayer owned addresses. Specifically, the taker address in an order can be left blank, which allows orders to be filled by anyone who ‘intercepts’ the order. The broadcast order process can be summarized as follows:
- Relayer cites a fee schedule and specifies an address used to collect transaction fees
- Maker creates an order (that meets the minimum fee criteria specified by the Relayer)
- Maker transmits a cryptographically signed order to Relayer
- Relayer receives the order, verifies that it is valid, that sufficient assets exist in the corresponding address, that fees are adequate, and accepts or rejects the order. If the order is accepted, the Relayer posts the order to their order book
- Takers receive an updated version of the order book that includes the new order
- Taker intercepts the order by completing it, cryptographically signing it, and submitting it to the relayer or directly to the 0x exchange smart contract on the Ethereum Virtual Machine.
- The 0x exchange smart contract along with relevant 0x proxy smart contracts moves funds and settles the trade.
General Mechanism / Point-to-Point Broadcast Orders
ZRX tokens can be used by market participants to pay Relayer fees according to the fee schedule imposed by individual relayers, and will eventually be used to effectuate decentralized governance that will presumably aim to facilitate the secure integration of protocol updates.
The Cryptoeconomics of 0x
The ZRX token has two intended functions, in addition to being an expedient fundraising mechanism, it will offer both fee payment to relayers who opt to use it, and decentralized governance through voting. It is intended that 0x will be used as a payment token via which relayers extract fees for their order matching services offered to end-users who thereby avoid grappling with the protocol directly and avoid sourcing counterparties to fill their orders. The extent to which the payment function will come to be realized in actual usage of the protocol is unclear since the payment can be implemented by relayers in other ways, such as taking a portion of the spread, if they so choose due to the inherently arbitrary nature of the off-chain order matching. Additionally, Coinbase has acquired one of the more prolific 0x relayers – Paradex – as a means of positioning themselves within the non-custodial DEX space. In a decision that proved controversial in the 0x community, Paradex opted not to monetize their role as relayer by charging fees in ZRX. Half of the total 1 billion token supply was made available for the token sale event and purchased by some 13,000 participants. 15% of tokens were retained by the 0x organization, 15% went to an external fund to incentivize development on the protocol, 10% to the founding team, 10% to advisors and early investors. As a result, half of the tokens are held by the company, founders and extended team, whose token compensation is subject to vesting schedules. The extent and form of 0x usage and contribution towards governance will become clear over time as the roadmap progresses.
The 0x protocol is made up of a set of Ethereum smart contracts, which by nature are immutable, meaning once their logic has been deployed to the blockchain it cannot be changed. 0x intends to implement decentralized governance by way of ZRX holder votes, so that network participants can weigh in on upgrades to the core smart contract code over time. Decentralized governance is a key part of the 0x value proposition, and with that, they hope to inspire trust and usage across a wide variety of actors including relayers, market makers, takers, and dApps. Simultaneously, they need their protocol to be flexible enough to handle inevitable updates as the network grows and evolves. Lastly, they must ensure that the security of the network is maintained despite changes to the smart contracts upon which the network is built. This will involve ensuring that the implementation of updates is as frictionless as possible for all the participants building and trading with the protocol. To summarize, 0x governance needs are:
- Flexible enough to upgrade core smart contracts over time to remain relevant
- Ensure the network is secure throughout the upgrade process
- Make governance a completely decentralized process so as to preserve network value proposition
- Ensure execution of upgrades are as frictionless for participants as possible
0x v. Key Benchmarks
- Liquidity available to 0x enabled relayers compared to existing (centralized) exchanges and DEXs: to observe that centralized exchanges account for the majority of digital asset exchange volume would be an understatement. This is mostly due to the high-performance functionality of centralized exchanges, whereby users can add orders to the books or take them off almost instantaneously.
- In the absence of privately identifying a trading partner (which is difficult but advantageous) a trusted third party, of some form, seems the only other viable option.
- It is possible that 0x will proliferate via a myriad of off-chain order matching services, in addition to other projects, adopting the 0x protocol. Should many relayers opt to not collect fees in ZRX then there exists some analogy between the 0x protocol and TCP/IP.
- Compared to other protocol level initiatives relating to the exchangeability and interoperability of a diverse blockchain-based landscape, 0x focuses on dApp and relayer side innovation. Polkadot plans to generate their genesis block in Q3 2019 and will effectively comprise a parallelized system of many chains – where 0x focuses on Ethereum. Cosmos, in addition to their own blockchain and consensus mechanism, have announced their intention to introduce a second token as a means of payment on their network. This serves to illustrate the diverse routes aimed at achieving smooth user experiences across a presently disparate technology landscape.
- Oct. 2016: 0x project began
- Feb. 2017: 0x whitepaper released
- Mar. 2017: Contracts deployed on Ethereum’s Kovan testnet
- May 2017: 0x OTC launched on Kovan
- June 2017: Open-sourced and security audits complete
- August 15, 2017: 0x deployed on Ethereum mainnet
- August 2017: Raised $24 Million via ZRX token
- July 2018: 0x Version 2 launched
0x v3 Upgrade
In December 2019, 0x implemented a significant protocol upgrade to v3, which involved a number of key changes to how 0x operates. At a high level, these include:
- Protocol Fee Introduction – All trades incur a small protocol fee for use of the 0x network, scaling with gas cost and payable in ETH or WETH.
- Staking Contracts and Rewards – This aspect incentivizes 0x market makers to facilitate trading activity and provide liquidity by providing a reward of the per-trade ETH protocol fee in proportion to ZRX stake. Market makers can stake ZRX tokens to a staking pool, which collects the protocol fees described above and distributes them periodically according to stake weight. Market makers must register all addresses associated with their trading activity in order for their pool to accumulate rewards. ZRX staking and rewards can be delegated, thus involving ZRX holders who are not themselves market makers. Further detail on this process is found here.
- DeFi Liquidity Bridging – v3 allows 0x relayers to directly access sources of liquidity from other DEXs and DeFi protocols including Kyber, Oasis, and Uniswap. These liquidity sources can be combined with 0x-native orders filled by a taker. This represents a significant step for the 0x model of ‘off-chain order books with on-chain matching’, as many of the linked DEXs utilize on-chain order books, which are effectively pooled with the off-chain order books maintained by relayers in order to offer traders a singular source of trading activity.
- Maker/Taker Fees Payable with Any Token – v3 allows payment in ETH, ERC20 tokens, or even ERC721 tokens.
Utilizing the governance functionality of the ZRX token, the core team engaged the community in a vote in November 2019 on deploying the v3 smart contracts. Approximately 1% of the total ZRX supply participated, overwhelming voting in favor.