STARKs over Mainnet
DeversiFi’s DEX powered by StarkEx is now live on Mainnet
Today we are launching StarkEx, StarkWare’s scalability engine, on Ethereum Mainnet. StarkEx now powers DeversiFi’s decentralized exchange. It’s our first commercial release and the first Mainnet deployment of STARKs. This launch is the result of over two years of development that took us from an exciting mathematical theory to a robust product.
We were fortunate to receive the support of the ecosystem along the way in the form of equity investments, grants, fruitful dialog, and quality competition. We are excited to take this first step alongside the DeversiFi team, who share our vision of scalable self-custodial trading as the natural evolution of the blockchain space. As announced a few weeks ago, we are already taking our second step, this time with the Immutable team, makers of Gods Unchained, to power Immutable X, the exchange they’re building for trading and minting NFTs.
StarkEx removes Ethereum’s current native scale ceiling of 4 trades/sec. StarkEx processes batches of trades off-chain, produces a STARK proof attesting to the validity of each batch, and submits these proofs to be verified on-chain.
Back in January, we demonstrated a rate of over 9,000 self-custodial trades/second, or over 18,000 self-custodial payments/sec. The exciting thing about this demo wasn’t merely the throughput figures — it was the removal of Ethereum resources as the limiting factor on StarkEx’s capacity. We are currently limited strictly by cloud resources, specifically by the power and cost of the proof machines StarkEx operates.
We are releasing StarkEx after months of thorough testing and settling over 50 million trades on Ethereum testnets and 1.3M transfers on Mainnet. In parallel to this post we’re publishing the Self-Custody Series, detailing the effort we’ve put into ensuring the security of our system, and its self-custodial nature.
Self-custody, or non-custody as it is often called, is a guiding principle of StarkEx. In every design decision we took, we made sure to uphold our commitment to self-custodial trading, to ensure that the user never has to relinquish custody of their funds. To enable this, we developed some novel mechanisms in multiple areas: from wallet integrations, through a data availability solution, to contract upgradability.
In this post we will give an overview of StarkEx, and explain basic flows such as withdrawal and deposit (see StarkEx documentation for a deeper dive).
StarkEx System Overview
The StarkEx engine has on-chain and off-chain components. Generally speaking, off-chain is for heavy-duty computation and storage, while on-chain is for the computationally-lean verification and state commitment.
The Exchange sends trades to StarkEx Cloud, which verifies them, and updates the off-chain state accordingly. When enough transactions have accumulated, or enough time has passed, it batches the trades and creates a proof of their validity. This proof is sent on-chain along with the new state root.
On-chain, the STARK Verifier verifies the proof, and the Data Availability Committee’s (see below) Verifier verifies the committee members signatures. The verifier contracts send their approval to the main StarkEx Application Smart Contract (ASC). The ASC updates the state only if it received both these approvals.
Let us describe the common user actions on StarkEx. It’s important to note that any meaningful transfer of user funds into, within, or out of StarkEx cannot take place without the user’s explicit signature — this goes to the core of our self-custodial approach.
To start trading on StarkEx, the user deposits funds to their on-chain account in the StarkEx ASC. Once StarkEx transfers these funds to the user’s off-chain account, they can start trading. Note that in contrast to centralized exchanges, deposited funds are still fully controlled by the users, and cannot be moved around without their explicit signature.
Users send signed orders to the Exchange, as they would normally do, and the Exchange matches these orders. When an order gets matched, a trade is sent to StarkEx Cloud. Once a batch size is reached, or enough time has passed, StarkEx generates a proof of a valid state transition, and posts a new state root to the blockchain.
To withdraw their funds, users initiate a withdrawal request. The user’s funds are then moved from the off-chain account to the on-chain account in the StarkEx ASC under that user’s name, and a proof containing this transaction is submitted to the blockchain. Once the proof is accepted (~10 minutes), the users can immediately withdraw their funds from the Exchange. We will implement fast withdrawals capabilities in the near future.
The Data Availability Committee
This first deployment of StarkEx serving DeversiFi has off-chain data availability: past trades are not published on the blockchain, but rather off-chain. This offers both better privacy (no trade data is in the public domain), and much greater scalability. It does mean that users rely on their off-chain data being available.
As part of our commitment to self-custodial trading, and to eliminate the need to trust the Operators (DeversiFi & StarkWare), we formed a Data Availability Committee (DAC) tasked with ensuring the security and availability of the off-chain data.
The DAC is made up of reputable entities, trusted by the community and the market, and they are compensated for their service. Users’ trust in the DAC is limited: users trust its members to publish the off-chain data they store in case the Operators deny service to withdrawal requests. Importantly, users need not trust DAC members not to steal their funds; even a malicious DAC member cannot steal user funds directly. The risks of freezing funds or of some crypto economic attacks still exist. (Note that such attacks, like blackmail, are a much more complicated task for a hacker. )
The founding members of the StarkEx DAC are ConsenSys, Infura, Nethermind, Iqlusion and Cephalopod (if you are interested in becoming a member, please reach out to us). Read about the principles and operations of the DAC here.
Member | Ethereum Address
ConsenSys | 0xFBD7599fe0C3735b94c369aDF0F0045D8D4f6cB9
Infura | 0x2b6593FcFbfdeD663D7a6448d45b12C16DF6B648
Nethermind | 0xf872Cf881873029B8955b582c29b66347f3f1326
Iqlusion | 0x51AbdE72a4542500a7b1Cb32B18b13fbe1F9ff2E
Cephalopod | 0x70EEAA8b7CbF7124e349e94EaDE6188DDd2d6178
StarkWare | 0x6A8EA587133c1aA4b3bA0417b6d8AE38E61fd1E4
DeversiFI | 0x3Bf2562178eA0CeF6B3F66D971494d65561EFD36
DeversiFi’s StarkEx-powered exchange is the first in what we expect to be a long list of StarkWare-powered services and products. More partnerships and products, which apply our scalability engine to applications other than exchanges, are in the works. Stay tuned — big things are coming!