ZEIP-23: trade bundles of assets

Vote on ZEIP23 with ZRX on February 18, 2019

Update: ZEIP-23 has been approved and implemented on mainnet!

Key Points

MultiAssetProxy (MAP) is a smart contract that adds the ability to trade arbitrary bundles of ERC20 and ERC721 tokens via 0x protocol.

MAP development is complete, the code has passed a security audit, but integration requires a “hot upgrade” to 0x smart contracts, which needs community oversight.

As the final step in the ZEIP process, ZRX token holders will approve or reject the MAP integration via a token vote to begin February 18, 2019. If approved, the 0x version number will be bumped from v2.0 to v2.1.

A centralized upgrade mechanism will be used to trigger these types of integrations until it is safe to transition to a more advanced binding on-chain governance system.

ZEIP23 will be our first exercise in community governance; while the process is naive, the stakes are high. We encourage the community to take the process seriously and to commit to improving it with us over time. First, we need help establishing communication norms that ensure the community is fully informed before voting on a proposal.

Preface

The 0x Improvement Proposal (ZEIP) process is a work in progress and will need to improve in practically every way. However, our first goal is to establish ZEIP communication guidelines that will lead to a well informed community. Describing interactions between complex systems of contracts leaves plenty of room for misunderstanding and miscommunication.



It’s easy to view Ethereum contracts as toys and, often, they are. Every week within the Ethereum community there is another wave of whimsical hackathon projects, flashy NFT items, and overt Ponzi schemes. These projects are genuinely fun to tinker with and inspire a great deal of creative innovation. 0x is also an exciting tool and catalyst for creative innovation, but 0x is not a toy. Modifying 0x protocol’s live system of contracts — which has access to large sums of digital assets — is a safety-critical process and we must take the same amount of precaution as we would when writing software that controls a nuclear power plant or commercial aircraft.



The first ZEIP we are putting to the community is not complex: it introduces a new Ethereum contract that consists of a few hundred lines of code and that provides one highly requested capability. The purpose of this post isn’t just to call on the community to inspect the code/audit/bug bounty, it’s to provide a clear and comprehensive explanation for the proposal both technically and from the standpoint of practical implications for users. At a bare minimum, readers with different levels of familiarity with Ethereum smart contracts should be able to come away with the ability to ask logical questions and productively engage in conversation with other members of the community. The following is our first and best effort, but I hope the community will identify methods of communication that are most helpful so future ZEIPs can be communicated more clearly.

What is the motivation behind ZEIP23?

The non-fungible token (NFT) space quickly expanded after ERC721 was formally adopted by the Ethereum community, leading to a vibrant ecosystem of blockchain-based games, collectibles, and marketplaces. While 0x protocol v2.0 supports the exchange of ERC721 tokens, one of the most commonly requested features is the ability to trade bundles of assets in a single atomic transaction. ZEIP23 provides 0x with native support for trading any arbitrary bundle of ERC20/ERC721 tokens. The feature supports a variety of use cases:

Sell 20-card booster packs for your ERC721 trading card game.

Buy a cluster of neighboring LAND parcels in Decentraland to grow your virtual estate.

Open a short position within a categorical prediction market. For example, use Augur or Veil to bet against a specific political party winning the 2020 US presidential election by going long all of the other political parties.

Figure 1: trading a bundle of CryptoKitties for a bundle containing an Axie and some Dai. Image courtesy of Boxswap.

Background and work completed

ZEIP23 was developed following a conversation with the team behind OpenSea, the largest Ethereum NFT marketplace by volume at the time of writing. They pointed out that NFT projects and enthusiasts require the ability to trade bundles of assets, and that a settlement layer such as 0x must natively support bundles to provide a smooth user experience. The core team explored a number of ways to add support for bundle trades to 0x protocol and collected feedback from Ethereum devs with subject matter expertise, including Philippe from HorizonGames.



Ultimately, Amir proposed a solution that is extensible and allows bundles of assets to be described in an intuitive way within the 0x order schema. Amir’s proposal became ZEIP23 and was implemented and internally audited over the following two weeks. The ConsenSys Diligence team completed an independent security audit in early December 2018. The code is now in a state where the core team is comfortable moving forward with integration.



The core team sponsors an ongoing bug bounty program for 0x smart contracts. The MultiAssetProxy (MAP) contract associated with ZEIP23 is now included in the bug bounty program, which pays up to $100,000 for critical bugs. Instructions may be found here.

Next steps

The final step before the MAP contract can be integrated into the 0x pipeline is a confirmation vote by ZRX token holders. A confirmation vote is necessary because ZEIP23 would be the first “hot upgrade” to the 0x pipeline; it requires us to modify access controls for 0x’s existing smart contracts, which have access to live digital assets. Stakeholders must have veto power over ZEIP23 and all subsequent proposals that require a hot upgrade. Typically, disagreement with respect to a proposal’s merit or implementation details should be sussed out early on in the ZEIP process, before a security audit has taken place. The token vote is a final backstop that gives stakeholders the power to block proposals that haven’t been adequately vetted or that cut corners with respect to security.



The vote for ZEIP23 will begin on February 18, 2019, run for one week, and be determined by a simple majority of ZRX token-weighted votes. Individual members of the 0x core team may participate in the vote, but ZRX tokens held by the organization are ineligible. If ZEIP23 is approved, the integration will immediately be initiated on-chain. Following a two-week grace period that is enforced via smart contract, the MAP integration will be completed. If ZEIP23 is rejected, a post-mortem will take place in the 0x forum for voters to discuss the misalignment, figure out if a more favorable version of the proposal can be created, and/or if additional security measures are needed.