This post outlines major development updates during the month of October 2017.

Changes to 0x.js

Subscription methods refactored. Subscription methods involving logs and events have been rewritten to use ethereumjs-blockstream under the hood, properly handling block and log removals, on-chain reorgs and block/log backfills on skipped blocks (e.g. when on a bad connection). In addition, the logic for retrieving historical logs has been separated from subscribing to future events. Look at the subscribeAsync() and the getLogsAsync() functions for more details.

Subscription methods involving logs and events have been rewritten to use ethereumjs-blockstream under the hood, properly handling block and log removals, on-chain reorgs and block/log backfills on skipped blocks (e.g. when on a bad connection). In addition, the logic for retrieving historical logs has been separated from subscribing to future events. Look at the subscribeAsync() and the getLogsAsync() functions for more details. Implemented proper batch fill validation. In order to properly validate batch fills, we implemented a “poor mans VM” that executes a batch fill and keeps track of all the intermediate state changes (i.e balance/allowance changes) that might affect subsequent fills. This allows us to properly emulate exactly what will happen when the batch fill is executed on-chain, letting the caller know if the batch fill is likely to fail without wasting any gas.

In order to properly validate batch fills, we implemented a “poor mans VM” that executes a batch fill and keeps track of all the intermediate state changes (i.e balance/allowance changes) that might affect subsequent fills. This allows us to properly emulate exactly what will happen when the batch fill is executed on-chain, letting the caller know if the batch fill is likely to fail without wasting any gas. Mempool watching for relevant events and state changes. With ~12 second block times, it is critical for relayers and market makers building on 0x to watch the mempool for transactions that could impact the validity of outstanding 0x orders. Watching the mempool will enable them to have a more accurate representation of the orderbook and will limit the number of users attempting to fill the same order. We are currently implementing an order watcher that will make it trivial for people to efficiently react to blockchain state changes at any number of block confirmations (including zero). This functionality can be expected sometime in November.

Last month, we introduced a draft of the standard relayer API, which is now officially released as the initial version of the standard. Briefly, the standard relayer API is a set of clearly defined methods of communication between a program and a 0x relayer. The interface is comprised of a set of HTTP and WebSocket endpoints. Relayers can opt-in to implementing this standard API, allowing programs to easily access and trade across multiple sources of liquidity at the same time. Programs that are written to communicate with the standard relayer API are also immediately compatible with all new relayers entering the 0x ecosystem. You can read more about the 0x Standard Relayer API announcement in this recent blog post.

In order to complement our extensive 0x.js documentation, we released similar documentation for our smart contracts. This documentation is intended for dApps and protocols that want to integrate 0x protocol directly into their own smart contracts. Any smart contracts can then conditionally exchange tokens depending on their own smart contract logic. In addition, we’ve also published a wiki article on 0x protocol smart contract architecture and another delving into the contract interactions. Be sure to check those out for a better understanding of how the 0x protocol works.

Website Redesign

As some might have noticed already, we have completely redesigned our website’s landing page, making it more elegant and informative. Other parts of our website and documentation are currently undergoing further redesigns so stay tuned for more changes!

Tutorial Series

We released the first 0x.js tutorial a few days before the ETHWaterloo hackathon to help hackers get started with building decentralized applications on top of 0x (event recap here). This tutorial shows you how to create, validate and fill orders with our javascript library. While this first tutorial is a good place to start, we understand that more advanced and flavored tutorials will be good for the ecosystem. We are therefore working on a series of tutorial which will hopefully allow more people to jump on board and start building on top of 0x.

0x Protocol v2

We have started preparing for v2 of the 0x protocol. We hope to release v2 sometime around Q2 2018. Some upgrades we are considering include:

Atomic order matching

Enabling smart contracts to generate orders

Support for non-fungible tokens

Gas-saving optimizations

We would love more community feedback on what should be included in the next release of the protocol. If you are interested in contributing, please take a look at the 0x improvement proposals (ZEIPs) and join the conversation about how to best accomplish the suggested changes. If you have a new improvement in mind, create a new issue outlining your proposal.