StarkDEX: Bringing STARKs to Ethereum

Scalable decentralized exchange infrastructure for the crypto economy.

Matt Taylor
4 min readJun 3, 2019

Notice: 0x and StarkWare ARE NOT offering tokens as part of our StarkDEX project. Anyone saying otherwise is scamming you! 🚨

We are thrilled to release a demo of StarkDEX, a proof-of-concept technology developed in collaboration with StarkWare. StarkDEX is decentralized exchange infrastructure that utilizes STARKs to remove the glass ceiling on non-custodial trading and allows crypto exchanges to offer their customers trading at scale, without counter-party risk. Today, the system at max capacity can batch 8,000 transactions per block, which is over 550 transactions per second and 200x cheaper in terms of gas costs. Ethereum at max capacity can only verify roughly 3 transactions per second.

To showcase our progress so far, we have developed an Alpha that simulates trades by feeding transactions through StarkDEX to be batched and verified on Ropsten, an Ethereum testnet. You can view the demo here to see the system in action! We are hoping to release an MVP with a 0x relayer(s) on Ethereum mainnet in several months (an exact date will be announced at a later stage).

What are STARKs

ZK-STARK is a zero-knowledge proof system that stands for Zero Knowledge Scalable Transparent Argument of Knowledge. Different proof systems are being used across the blockchain ecosystem for a range of use cases ranging from scalability to privacy. What distinguishes STARKs are several properties: scalability, transparency, lean cryptography, and no trusted setup.

To learn more about STARKs in-depth, check out StarkWare’s 5-part series that dives into the mathematical concepts (parts I, II, III, IV, and V)

StarkDEX’s current iteration proves the viability of using STARKs for Layer-2 scalability by demonstrating a significant increase in the number of transactions on the blockchain. STARK-based scaling is still in its infancy, but we are confident we can continue to increase the number of transactions per block and are excited to share our progress so far.

StarkDEX Under the Hood

StarkDEX utilizes STARKs to batch transactions into a single proof that is verified on Ethereum. The proof-of-concept utilizes both on-chain and off-chain components to settle trades.

  1. The DEX (or in the alpha, the simulator) sends a batch of 0x orders to the prover service, run by StarkWare.
  2. The prover service checks the signatures of each transaction in the batch, and the validity of the transactions. The prover service then stores the data off-chain and adds it to the execution trace it keeps.
  3. The prover creates a proof of the validity of the entire batch and sends it along with the most recent Merkle root to be verified by the on-chain verifier contract, which verifies the proof and sends the Merkle root to the DEX’s on-chain contract to be stored.
  4. The verifier contract connects to the 0x smart contract pipeline that moves the batch to be confirmed on the Ethereum blockchain.

To learn more, check out our FAQs and the Alpha demo.

StarkDEX in the Greater 0x Stack

Zero-knowledge proofs are powerful tools that are well-suited for scaling decentralized exchange and fit nicely with the evolving 0x tech stack being developed by the 0x Core Team. We are working on 0x Mesh, a peer-to-peer network transport layer that greatly increases order flow throughout the ecosystem. We are building it in a way where anyone can interact with the network directly in the browser so you can interact with orders without having to install a node! Read Alex’s recent post on 0x Mesh to learn more.

With networked liquidity improved, the next step is to coordinate trades. Coordinators are extension contracts relayers can opt into that provide a variety of benefits including protection against front-running, innovative marketplace mechanics, and unlimited soft cancels. We’ll have more updates on Coordinators in the coming months.

Once 0x orders have flowed through the p2p network and coordinator contracts, we plan to utilize StarkDEX infrastructure to collect trades into large batches, generate a small proof, and verify the proof on-chain. This tech stack essentially looks like a blockchain. There is a peer-to-peer network distributing orders (mempool), a mechanism for finalizing transactions (mining), and a system turning orders into batches (blocks). Ultimately, this infrastructure is all still built on top of the Ethereum blockchain. We call this stack the 0x Sidechain. Read Remco’s blog post to learn more about why we are utilizing zero-knowledge proofs to scale 0x.

Check out the StarkDEX Alpha demo to inspect this DEX infrastructure for yourself, and sign up here to receive future updates!

Learn more about 0x and join our community

Website | Blog | Twitter | Discord Chat | Facebook | Reddit | LinkedIn | Subscribe to our newsletter for updates in the 0x ecosystem

--

--