What Is 0x (ZRX) and How Does It Work?
0x is a protocol that facilitates the peer-to-peer (P2P) exchange of Ethereum-based assets. Built by 0x Labs, the protocol serves as an open standard and core DeFi building block for any developer needing exchange functionality.
By Will Warren
Updated January 2, 2021 • 6 min read
0x is a protocol that facilitates the peer-to-peer (P2P) exchange of Ethereum-based assets. Built by 0x Labs, the protocol serves as an open standard and core DeFi building block for any developer needing exchange functionality. 0x offers secure, audited smart contracts; developer tools tailored to the 0x ecosystem; a decentralized global P2P order book (0x Mesh); and an API that provides easy access to aggregated liquidity sourced from a growing number of exchange networks
ZRX is 0x’s native governance and staking token. Owning ZRX gives you a say in how the protocol evolves, and token holders can also stake their tokens to earn ETH liquidity rewards.
Launched in 2017 with the mission to “create a tokenized world where all value can flow freely,” 0x envisions a world where all forms of value are tokenized on public blockchains. This includes fiat currencies, stocks, commodities, bonds, debt instruments, real estate, video game items, software licenses, digital collectibles, personal tokens and much more.
Combined with other freely-composable DeFi building blocks, 0x Labs seeks to build a global financial system that is more efficient, transparent, and equitable than any system that has existed in the past. This new infrastructure is intended to be free to use and run on open source code, stripping away layers of middlemen and providing individuals with greater financial sovereignty.
Some examples of the types of things that can be built on 0x include:
A decentralized exchange for X asset on Y market
An ebay-style marketplace for digital goods
A market making or arbitrage trading bot
A DeFi protocol that needs liquidity and exchange to function (e.g., a derivatives, lending, or options protocol)
In addition, 0x can also be integrated into any existing application where exchange is a feature, not the core purpose of the application. These applications may include:
Games with in-game currencies or items
Digital wallets whose users want to exchange tokens
Portfolio management platforms
As of this writing, the 0x protocol has been integrated into numerous cryptocurrency projects and generated billions of dollars in trading volume. . In June 2020, 0x Labs released Matcha, a DEX aggregator, with a focus on simplicity and an intuitive user experience. Similar to Expedia and Kayak for travel, Matcha uses the 0x API to source the best prices across a growing number of exchange networks.
To further understand 0x protocol, it is useful first to review the fundamentals of a decentralized exchange, or DEX. Centralized exchanges act as trusted intermediaries that facilitate the trading of different crypto assets and often act as custodians by storing and protecting your funds. In contrast, DEXs eliminate the custodial middleman and instead facilitate the P2P exchange of crypto assets, often offering unique assets that may not be available on centralized exchanges. DEXs utilize secure smart contracts to match and complete trades between peers and do not act as custodians.
DEXs often face challenges concerning usage and liquidity. 0x addresses these issues by offering a flexible DEX architecture, comprehensive developer documentation and tools, an easy to integrate 0x API, and networked crypto liquidity pools (both from native 0x sources, as well as from other exchange networks) accessible via 0x Mesh, a fully decentralized P2P global order book that functions independently from the Ethereum blockchain.
Some platforms that utilize the 0x protocol include Matcha, Tokenlon, MetaMask, Augur, DeFi Saver, Radar Relay, and more.
A flexible off-chain relay, on-chain settlement architecture
What sets 0x protocol apart from other DEX protocols is its hybrid off-chain relay, on-chain settlement architecture. Unlike other decentralized exchanges that solely operate on-chain, 0x does not store orders on the blockchain. Instead, orders are stored off-chain, and only trade settlement occurs on-chain. This unique feature makes 0x a flexible and gas-efficient DEX protocol for developers to build on.
Users who create 0x orders are called “makers” and users who fill those orders are called “takers.” When creating an order, makers will indicate the details of that order, including the tokens they wish to exchange and the price at which they are willing to exchange them.
If the maker of a 0x order already knows their desired counterparty, they can send the order directly to them (e.g., via any messaging system such as email, chat, or over-the-counter). If the maker doesn't know a counterparty willing to take the other side of the trade, the order can be submitted via 0x Mesh to a 0x relayer, such as Matcha or MetaMask. A "relayer" is any entity that helps traders create, find, and fill 0x orders. It is important to note that relayers do not act as trusted middlemen and do not execute trades — they merely maintain an off-chain 0x order book and may collect fees for their trade facilitation services.
Once someone finds and wishes to fill the 0x order created by the maker, they can fill it by submitting the order, along with the amount they want to fill it for, to the blockchain. The 0x protocol's settlement logic will verify the maker's digital signature and that all the conditions of the trade are satisfied. Once satisfied, the tokens are atomically swapped between the maker and taker directly into their wallets.
The ZRX token offers both governance and staking utility.
ZRX token holders are able to vote on 0x Improvement Proposals (ZEIPs) which are public proposals to change the behavior of the 0x pipeline of smart contracts, including their parameters. This could also extend to off-chain tooling proposals if it relates to how the contracts are interacted with. Each token equals one vote, so the amount of tokens an individual holds determines how much voting power they have. At the moment, voting occurs off-chain on the 0x website and does not incur gas fees. A snapshot of the Ethereum block whose verification coincides as closely as possible with the full vote timeframe (typically seven days) will lock in all of the votes cast. If a voter moves their tokens out of their wallet before this snapshot, their votes will not be registered. This “lock-up” ensures that voters are exposed to the financial consequences of their actions.
Market makers, staking, and liquidity rewards
In 2019, 0x revamped its token economics to encourage more ownership of the protocol among market makers by introducing a financial incentive tied to the amount of liquidity a market maker injects into the ecosystem. Market makers that stake ZRX tokens receive a liquidity reward funded through a protocol fee applied to every 0x trade. The fee is denominated in ETH and deposited into a staking contract. Fees are pooled within the staking contract over a fixed window of time, which is referred to as an epoch. At the end of each epoch, market makers that stake ZRX tokens collect a portion of the accumulated pool.
Market makers can contribute stake on their own behalf or establish a 0x staking pool that allows ZRX token holders to delegate stake to them. Staking also takes place on the 0x website. Each staking pool specifies a fixed percentage of future liquidity rewards to be shared with the pool’s stakers. Establishing a 0x staking pool allows market makers to participate in the liquidity reward program without locking up funds that may otherwise serve as working capital. Half of the voting power associated with the delegated ZRX tokens will be under the market maker’s control. For this reason, potential stakers will need to evaluate their options carefully before joining a pool.
In return for delegating their tokens to a market maker, stakers will receive a proportional share of the liquidity rewards from the pool (based on the number of tokens they’ve delegated and the fixed percentage of rewards the market maker is sharing).
It’s important to note that staking on 0x works differently than other proof-of-stake (POS) systems. Staking on other POS systems typically involves validating blockchain transactions, based on the number of tokens held, for a fixed percentage of return, often referred to as the "inflation” rate. As explained above, staking on 0x is built around incentivizing market makers who bring the liquidity necessary for markets to function efficiently, which is crucial in growing the overall network and giving better prices to all traders. Unlike the fixed return percentage associated with other POS systems, 0x staking returns are dynamic. As more volume flows into the 0x network, the protocol fees, and therefore the staking rewards grow proportionally.
The ZRX token’s utility in 0x’s governance and liquidity structure is an essential aspect of its decentralization. Not only is the core exchange function non-custodial, but the protocol fees earned from trades are also distributed to all ZRX token holders.
0x protocol is an open and community-oriented product that has contributed to Ethereum’s rapidly growing DeFi ecosystem, and pioneered new business models that prioritize community usage over short-term profits.
Additionally, 0x Labs seeks to expand beyond Ethereum to further solidify the 0x protocol as a core DeFi building block in a multi-blockchain future.
Cryptopedia does not guarantee the reliability of the Site content and shall not be held liable for any errors, omissions, or inaccuracies. The opinions and views expressed in any Cryptopedia article are solely those of the author(s) and do not reflect the opinions of Gemini or its management. The information provided on the Site is for informational purposes only, and it does not constitute an endorsement of any of the products and services discussed or investment, financial, or trading advice. A qualified professional should be consulted prior to making financial decisions. Please visit our Cryptopedia Site Policy to learn more.
Co-Founder & CEO, 0x Labs
Will Warren is co-founder and CEO at 0x Labs, where he is developing public infrastructure for peer-to-peer exchange on the Ethereum blockchain. After receiving a B.S. in Mechanical Engineering from UC San Diego, Will worked as a graduate research assistant at Los Alamos National Laboratory and conducted applied physics research. Will spent two years in UC San Diego's Structural Engineering doctoral program before dropping out to pursue an interest in Ethereum full time.
Is this article helpful?