0x Protocol Analysis

in #cryptocurrency7 years ago (edited)

Purpose


I've been looking into the 0x project for a couple days now, and although it isn't the most exciting thing at first, it really has the power to reshape the Ethereum ecosystem into something much more secure. The first time I wrote this, it ended up just being a huge wall of text that wasn't very appetizing. Hopefully this format is quicker to digest at a glance but detailed enough to really understand things if you're interested.

What is 0x?


  • Open standard protocol for dApps to use for handling trustless exchange of ERC20 tokens.
  • Built using Ethereum smart contracts for trustless, secure operation and interoperability.
  • Unopinionated and does not impose costs on users or arbitrarily extract value from one group to another.

Why do we want 0x?


Centralized exchanges sort of suck

Mt. Gox, Shapeshift, and Bitfinex have all experienced security failures, some of which lost billions of users funds. Coinbase, Poloniex, GDAX, etc. - all suffering downtime from DDOS attacks and high traffic spikes. Don't even get me started on the fees..

0x protocol enables transactions of ERC20 tokens between users in a secure, trustless, feeless, and quick manner through the use of Ethereum smart contracts. The only cost is the standard gas fees for processing on the network.
*Relayer fees are supported by 0x, but more about this later.

Decentralized exchanges sort of suck

Have you ever used EtherDelta or Maker Market? If you're one of the few, you may have noticed how slow and clunky these decentralized exchanges (DEXs) are. This is largely because the order book is stored on the blockchain. That means every order you place, remove, or fill is subject to gas fees, and the entire process is limited by the block times on the network.

Best of both worlds?

What if all the security benefits of DEXs were implemented in a way so that the problems with slow order books and gas fees for every modified or canceled order were eliminated? Faster, cheaper transactions without any centralized point of critical failure? That's 0x.

How does 0x work?


0x is implemented with Ethereum smart contracts, which I won't be digging into too much. The message format and other technical information is available in the whitepaper.

The main idea for 0x is to be used by other projects as a back-end transaction protocol. Thus, the 0x protocol itself is application-agnostic, and helps decouple the transaction protocol layer from the application layer.

To understand why 0x works the way it does, it's important to first know about a couple existing models.

Current decentralized exchanges (DEX)

Existing DEXs like EtherDelta and Maker Market are not very popular because they end up being expensive and slow. This is because the order book is stored on the blockchain, so every time you post, modify, or cancel an order you have to pay the gas fees associated with changing the blockchain state. Additionally, since everything is limited to the generation time of blocks, the exchange performs extremely slowly compared to other centralized exchanges.

Automated market maker (AMM)

AMM smart contracts get away from on-chain order books by having an automatic price-adjustment based on the asset's market force on either side of the trade. This has the benefit of always being available since there's only ever one price, but AMMs generally have a worse price than traditional exchanges. AMMs also impose an artificial constraint to the supply curve, and if the price-adjustment model is too sensitive, small trades will effect the price more than they should. If it's not sensitive enough, arbitrage will take over and the AMM bankroll will run out.

State channels

State channels move transactions off the main blockchain by having participants send cryptographically signed messages between each other. Once the "micro transaction" is complete, the result is published the the main blockchain and gas fees are applied. This method is one way of scaling the Ethereum blockchain and reducing costs. There are drawbacks such as the need for participants to be online for the entire state channel transaction, security deposits, and numerous on-chain transactions required to set up the state channel. This makes it inefficient for one-time transactions.

0x hybrid implementation

0x refers to their model as a "off-chain order relay with on-chain settlement". It combines the efficiency of state channels with the fast settlement of on-chain order books. The steps of a transaction using 0x are as follows:

  1. Makers cryptographically sign orders
  2. Makers off-chain broadcast orders themselves or through a relay
  3. Counterparty accepts the order and injects it into a smart contract to execute trustlessly
  4. The DEX processes the exchange on the blockchain

Relayers & the ZRX token

For the 0x protocol to be easy enough for liquid markets to emerge, there needs to be public locations where buyers and sellers can post their orders, i.e. an exchange. Since the actual transaction protocol is handled by 0x, building an exchange becomes much easier, but there are still costs associated with running it and hosting a live order book. This is where the ZRK tokens come in.

While the 0x protocol does not require transaction fees, they are supported. This allows large relay services to collect fees on the liquidity they are enabling by charging ZRX for broadcasting a maker's order to many potential takers.

Governance

The ZRX tokens serve a two-fold purpose. In addition to being used for the transaction fees, ZRX tokens are used for decentralized governance over the 0x protocol. This allows for a smooth update mechanism to the underlying smart contracts.

Integration

0x intends to integrate with the ENS system so that makers, takers, and relayers are easily identifiable with their human-readable .eth names.

A Token Registry containing information about the ERC20 tokens will also be accessible so that participants have an easy way to verify token addresses and exchange rates. 0x stakeholders will provide oversight to what goes in to this official registry.

The development roadmap mentions possible integration with Aragon or Boardroom in the future for stakeholders to generate, inspect, and vote on proposed updates to the protocol.

Current development & team


0x has an over-the-counter (OTC) dApp running on the Kovan test network that facilitates transactions using 0x protocol with no transaction fees. Right now, makers have to manually broadcast their order (email, social media) since there are no big relay services.

As you can see, many common ERC20 tokens are listed and custom tokens can be added (similarly to how MEW does it). You simply have to choose which tokens you want to buy & sell, the exchange rate, and the expiration date. Once you've got the signed transaction, you use a relay service to broadcast it - in this case, yourself.

oxotcscreenshot.gifsource

0x protocol is also partnered with several large crypto companies like Augur and Aragon.

Joey Krug, the founder of Augur, is one of their lead advisors. Also, Fred Ehrsam and Linda Xie, co-founder and product manager at Coinbase, have their names on the project. Needless to say, 0x has the support required to integrate into the Ethereum the ecosystem.

ICO and ZRX tokens


The crowd sale for ZRX tokens is currently scheduled for late Q3 / early Q4. It will fund the development of the 0x open source software and infrastructure required.

The approximate distribution of tokens is:

  • 70% to crowd sale investors
  • 18% to the foundation (since it's a nonprofit)
  • 10% to the founding team
  • 2% to advisors

The ZRX tokens have a fixed amount of 100,000,000 and there is no continuous issuance model (no mining). The lockup period for founders, advisors, and staff is over 3 years with a schedule to release 25% after the crowd sale, 25% after each subsequent year in monthly installments. New staff has a 4 year vesting schedule with a one year cliff.

The ZRX tokens sold in the crowd sale to investors are not locked up and are immediately liquid. It is unknown if US citizens will be allowed to participate as they are still investigating legal and regulatory implications. The only cryptocurrency accepted during the crowd sale with be ETH.

Version 1.0 of 0x will be deployed to the canonical Ethereum blockchain after security audits, but prior to the public crowd sale.

Links


Leave a like or even resteem if you found this helpful. You can also support me by sending ERC20 tokens to 0x93cB484e1130358EaBE927a46c094889D9f15E2B. Leave your thoughts below about what content you'd like to see in the future!

Sort:  

This is well done. 0x is a major part of the future Ethereum ecosystem backbone and is a top team. Very well thought of project. Hopefully they can deliver.

Decentralised exchanges would really solve a few issues. I would also like to point out the matter of centralised exchanges serving as a single point of attack for regulation. Does this project have any relation to projects like BitSquare?.

No relation to BitSquare afaik, it's just an ERC20 token exchange. Something like BitSquare could be made that uses 0x for ERC20 trades though, and that could basically be the endgame

I do want to mention, this post is a result of somebody suggesting I look into 0x protocol and giving them my thoughts. I can't remember who it was or where they asked me, but hopefully it reaches them.

If you have a suggestion for something I should look into, let me know in the comments! Thanks for all the support, I broke 100 followers yesterday!

I would look into Funfair.io -- apparently blew people's socks off at a London Ethereum Dev meeting.

Also, Aragon is in that same vein, a major piece of connective tissue for the Ethereum ecosystem. One of its principals was also just made a Thiel Fellow.

https://twitter.com/AragonProject/status/875820390693703681

AragonProject Aragon tweeted @ 16 Jun 2017 - 21:00 UTC

Our very own @izqui9 was selected as one of this year's @thielfellowship recipients! Congratulations Jorge! twitter.com/thielfellowshi…

Disclaimer: I am just a bot trying to be helpful.

Another wicked post man thanks! May not end up being your most popular one :) but it's much appreciated.

0x sounds great. Every exchange currently is getting complaints about security breaches, DDos attacks, and transactions delayed for weeks. However I think a DEX is need for a wide range of currencies beyond the ERC20.

I believe the total supply is 1 BILLION, not 100 MILLION.

Yep, this is correct.

Nice work, just researching now. Missed this ICO, but it's still early

After looking under the hood-as well as watching their presentation on Epicenter- I too am impressed with this project. I have added it to my portfolio :-)

Great info, thanks!

Very good analysis--thanks for posting. I appreciate this work.

Coin Marketplace

STEEM 0.35
TRX 0.12
JST 0.039
BTC 70310.43
ETH 3568.34
USDT 1.00
SBD 4.73