Introducing 0x Protocol V2

The protocol for trading everything

New smart contract architecture; seamlessly support new token standards. Support for ERC-721 at launch

More efficient order matching and cross-relayer arbitrage

Support for new signature types and custom verification logic

Open source framework for “forwarding contracts.” Easy user on-boarding, abstraction of WETH, and trade widget support.

Ability to create “filter contracts” for permissioned liquidity pools

Bulk order cancellations with a fixed sized transaction

Projected launch: late July, 2018

Ecosystem Development To Date

The first versions of the smart contracts that implement the 0x protocol were deployed to the Ethereum mainnet in August 2017. Since then, the 0x core team has been shocked by the positive response from the community. There are currently fifteen 0x relayers facilitating ERC-20 token trades on mainnet, with more in beta, as well as teams like dY/dX and Set building their own complementary protocols for exchanging new kinds of assets like financial derivatives and token baskets.

What’s equally important is that the ecosystem has seen incredible user adoption. A few highlights:

The huge growth in trade volume is even easier to see in this time series of trades per day.

Up and to the right 📈

We’ve also built strong relationships with our community of developers, and have used their feedback to build great open source tools, both for teams using 0x and the broader Ethereum ecosystem.

As an organization, we’ve grown the team to 14 members and plan to continue to grow this year. Join us!

The power of the 0x protocol has also been magnified by contributions from our developer community, such as awesome projects like 0xtracker.com by Craig Bovis and Massive by Austin Roberts from OpenRelay. We wouldn’t be where we are without passionate builders like them and many others.

What’s New in V2

The tokenization of assets has already begun and continues to happen at an accelerating pace. When we launched V1, the first ERC-20 tokens were just beginning to emerge. Since then, we’ve seen the ERC-20 token ecosystem explode and new assets like ERC-721 non-fungible tokens, tokenized securities, derivatives, and many more start to take form. Our core thesis is that the world’s value is becoming tokenized, and we need to build the tools that allow this value to flow freely.

We believe in an approach to building that is flexible, modular, and easily upgradeable. We value feedback and continue to implement many suggestions from our community via ZeroEx Improvement Proposals (ZEIPs) in V2 of the protocol. Some of the highlights from the latest version include:

A New Contract Architecture with Support For ERC-721 and Other Token Standards

V1 of 0x used primarily two smart contracts; our Exchange contract handled the logic of filling or cancelling trades, while our Proxy contract interfaced with ERC-20 contracts to modify token balances when trades were executed. This works well, but doesn’t scale as we add support for more types of assets beyond ERC-20 — we would need to constantly re-deploy the Proxy contract to support new standards, forcing everyone to set their allowance on the new Proxy contract to adjust their token balances.

V1 Architecture

In V2, instead of this single Proxy contract interfacing directly with other asset contracts to adjust balances, we deploy new Asset Proxies for each unique asset type. This way, we can add support for new token standards as they come out without having to redeploy a single Proxy — we just need to deploy a new AssetProxy for a particular standard.

V2 Architecture

To start, we’re launching with support for ERC-20 as well as ERC-721, the standard for Non-Fungible Tokens. This means you can trade your Ethmoji, Fan Bits, CryptoKitties, LAND, or any other unique, collectible assets using 0x. This new, modular architecture will also allow us to add support for new token standards without having to modify our smart contracts and force developers and users to upgrade. You can look forward to trading your ENS names, ERC-777 tokens, and R-Tokens using 0x in the future!

Support for EIP-712

Hate it when you’re about to sign a message, but you’re unable to read the message you’re signing? So do we! That’s why 0x’s very own Leonid Logvinov and Remco Bloemen wrote EIP-712, a standard for hashing structured data, and why we’re adding support for it in V2. You can see in the screenshot below how much more usable signing becomes with EIP-712.

V1 without EIP-712 (left) vs V2 with EIP-712 (right)

Taker Abstraction

In V1 of 0x, the Taker of an order has always been msg.sender, the address that is directly calling the fillOrder function. In V2, the Taker will default to msg.sender, but can optionally be from another Ethereum address if a signature from that address is provided. This opens up a number of new use cases and makes existing uses of 0x much easier to implement such as:

Relayers using the Order Matching model

Creating orders that can only be filled by whitelisted addresses or that require a multisig to fill

Building Trade Execution Coordinators to prevent front-running and griefing

Support for New Signature Types

In V1 of 0x, orders are created by signing a message using ECDSA, the standard encryption scheme for Ethereum. However, this is inherently limiting and restricts certain use cases.

In V2, we’re supporting new signature schemes like EIP-712 and Trezor, as well as allowing users to define their own verification functions within smart contracts. This allows orders to be created using multi-sig, BLS signatures, ring signatures, or any other encryption scheme and doesn’t require the 0x smart contracts to be re-deployed in the future to support these new use cases. Smart contracts can now generate 0x orders using a custom signature verification function!

Atomic Order Matching and Batch Settlement

In V1 of 0x, users could atomically batch fill transactions, but under the condition that they had upfront capital to fill the transactions in the first place. This enabled developers to build order matching relayers and arbitrage bots after passing this initial capital barrier.

In V2, orders can be atomically matched and filled together without needing capital other than ETH to cover gas costs. This greatly lowers the barrier to arbitrage trading and order matching.

Forwarding Contract

We know that ‘wrapping’ ETH into ERC-20-compliant WETH has been a big hurdle towards broader user adoption of 0x that’s not likely to go away anytime soon. We’ve been looking for solutions to make it easier for the long-tail of users to start tapping into the 0x networked liquidity pool, and we’re excited by the potential of the 0x forwarding contract and trade widget. With the forwarding contract, users can simply send ETH and the orders they want to fill, and the forwarding contract will wrap the ETH and fill the orders in one single transaction, eliminating the need for WETH for takers.

With V2, we will deploy our own version of a forwarding contract that anyone can use, with or without the 0x trade widget. It will of course be open source so that other teams can modify and deploy it as they see fit.

Example of how the forward contract can be used

Launch Timeline

May 21st: Publish Finalized Interface for V2 and Conduct Internal Testing

June 9th: Deploy on Kovan and Start Testing Integration with Existing Relayers and dApps

July 2: Start of Audits by Diligence and Quantstamp

~July 30: Deploy on Mainnet

We’re so excited for the launch of V2 and we hope you are too. 0x V2 will usher in the next wave of tokenization and help this tokenized value flow freely.