Protocol /2020

Brecht Devos, Loopring’s Chief Architect, will lead the development of the Loopring protocol.

1. Learn from Production

Protocol v3 is live on mainnet and will be used in production environments in late December 2019 with the WeDEX beta, a strong partner in Shenzhen. Having real exchanges on top of v3 running on Ethereum mainnet gives us extremely valuable data. We’ll discover if there are any bottlenecks that can be avoided, and learn if there are any useful features that are missing. We’ll learn how the protocol behaves on Ethereum mainnet in realistic scenarios. All this data will ensure that the protocol (and the relayer) will be even better for future releases.

2. Improve Composability

Protocol v3 has brought a massive increase in scalability and a massive decrease in costs for non-custodial trading on Ethereum, to the tune of 700x improvements from v2. As explained in multiple articles, this is achieved by us using the zkRollup design, a layer 2 solution. However, layer 2 solutions necessarily make it more difficult to interact directly on-chain. The more operations you do off-chain, let alone in a zkSNARK, the harder it is to interact with other smart contracts on-chain. From a UX point of view, this is great (apparent immediate finality), but this can have less desirable consequences in that it limits the composability of Loopring exchanges with other smart contracts on Ethereum. Our aim is to improve this significantly by making it possible to do additional on-chain logic for user requests when needed.

Here are a few concrete examples of what this will make possible:

Allow exchanges to implement custom on-chain functionality for users (like tapping into on-chain liquidity pools, lending pools)

Allow exchanges to do faster withdrawals.

Allow exchanges to build exchange wallets that act similarly to a standard Ethereum wallet. Anything you can do on a normal Ethereum wallet you will be able to do on your exchange wallet.

Support general meta transactions so users need not interact with Ethereum themselves if they don’t want to.

3. Make Loopring Customizable and Upgradeable

All exchange functionality in v3 is currently bundled in a single contract. This contract can be upgraded, but this potentially modifies the complete exchange. Even if an exchange would only like to add a single feature or do a small modification, the complete exchange would be different. This limits code reusability and makes it difficult to maintain a single codebase for all exchanges built on Loopring.

Thus, we want to make the exchange contracts more modular. Exchanges will be able to choose which functionality they want to support and simply add those modules to the exchange. If an exchange wants to create some custom functionality, they can easily do so by creating a much simpler smart contract and adding it to the exchange, while keeping all the other exchange logic untouched. This not only simplifies the protocol design, but it also means more code can be reused which has numerous benefits.

4. Research and Development of Zero-Knowledge Proof Systems

In the last couple of months, there has been an immense amount of new developments in zero-knowledge proofs. ZKPs are of course the core of protocol v3. In protocol v3 we use the Groth16 proof system on the BN254 curve. This system provides the smallest proofs (just 256 bytes!), has cheap proof-verification on-chain, and has quite fast proving times. The proving times largely dictate the off-chain costs of the protocol so they are very important. The biggest drawback of Groth16 is the necessary circuit-specific trusted setup (for which we held a ceremony in November). Each time we modify the logic inside a circuit, no matter how small the change, we need to do a trusted setup for the circuit. This limits us in how fast we can take new exchange functionality into production. For each trusted setup we also need help from participants in the Ethereum community. So a trusted setup not only takes a significant amount of time to organize, but also requires external people willing to spend some of their time to help us.

In contrast to Groth16, new proving systems like PLONK or STARK do not need a trusted setup for each circuit independently. However, they also have different proof sizes, proving times and proof verification costs on-chain. The way the circuits are programmed also often differs from Groth16, which means that operations efficient in Groth16 are not necessarily efficient in a different proving system and vice versa. Strong progress is also being made with recursive ZKPs in proving systems like HALO which is certainly a very interesting and promising direction.

Picking a new proving system (which is production-ready) is no trivial task. New zero-knowledge proofs developments will no doubt keep coming in 2020 and we’ll continue to follow them closely. We hope to switch to a new proof system without circuit-specific trusted setup, faster prover times and increased scalability.

5. Smart Wallet Integration

We’ll develop, open-source, and deploy contracts for our smart wallet. Our priority is the integration with Loopring 3.0 so the app will make DEX user on-boarding much easier, especially for those in China lacking access to Chrome or MetaMask. Integration with other DeFi protocols will follow. The smart wallet integration will also entail making LRC more front of mind, and its staking mechanics much more user-friendly.