Rollups : The new backbone of the DeFi ecosystem


 

As the development of the Ethereum ecosystem increased exponentially during these past two years to enable new use case and develop brand new sectors such as the DeFi space new challenges came up to light related to the capacity of the network and its viability for the foreseeable future.


Indeed, during these past two years the emergence of new agents such as the Automated Market Makers (AMM) and the increasing adoption of smart contract based solutions by more and more network users put in light the limit of the current Ethereum network relying on a proof of work mechanism which become totally unreliable for most daily usage when the limit of 15 transactions per second (tps) is approached given that fees become increasingly expensive and transaction time increase to non-efficient durations.  However, before the unveiling of the new Ethereum network infrastructure promised by Ethereum 2.0 we need to find a solution to solve the scaling  issue of the current network on which rely the whole DeFi space and the potential mainstream adoption of the smart contract technology.


To this date, despite different solutions proposal like Plasma, the use of  L1 chain that are Ethereum Virtual Machine (EVM) compatible (Polkadot,  Cosmos … ),  the solution that is gaining the most traction and seem to even have gained the support of the Ethereum foundation is the Rollups.

 

What is a Rollup ?  

A rollup is an off-chain aggregation of transactions inside an Ethereum smart contract which reduces fees and congestion while increasing drastically the throughput of the chain. More specifically, rollups build on the shadow chain idea by taking execution of the state off-chain and only posting state updates for data availability onto the Ethereum blockchain.  That way Rollups are improving throughput and overcoming the major hurdle of data withholding attacks.
Another benefit is that each Rollup chain can be thought of as a shard where each shard can permit experimentation with different execution and data models with no hard forks.


Currently the 2 broad approaches to Rollups are :

  •  ZK-Rollups
  • Optimistic Rollups

Those two types of rollups differ in the way they ensure validity of the sidechain blocks. Indeed,  while Optimistic Rollups validity is ensured by a fraud-proof and the synchronycity assumption, ZK-Rollups validity is ensured by zero-knowledge proofs. However, given that the Optimistic Rollups can support both simple payments and complex smart contracts due to its 80% compatibility with the EVM tooling, Optimistic rollups are currently seen as an immediate solution to this pressing scaling problem while ZK-Rollup which have less compatibility but better features are viewed as a mid to long term solution.

 

ZK-Rollup


As presented briefly before, ZK-Rollups are a new type of L2 scaling solution performing safely all the computations and storage of data off-chain thanks to the use of the zero-knowledge proof algorithm while storing on the Ethereum main net a smart contract containing two Merkle trees representing respectively the accounts and the balances states in order to ensure the validity of the sidechain and a public access to its current state.   More precisely, transactions are aggregated together, then signed for and committed to the main chain with just the header in order to reduce the amount of data stored on the Ethereum chain.


Also, all signatures are replaced by a zero-knowledge proof known as ZK-SNARK in order to enable further compression of the aggregated transactions while making it impossible to submit an invalid or incorrect state. This way, once a block proof is submitted to the main chain and verified by the smart contract, all transactions in the block are finalized and comes with the same guarantees of security as any transaction on Ethereum L1. So as we can see using ZK-Rollups as our underlying L1 enables us to drastically improve our throughputs to around 2000 tps and enables us to produce block under a minute without any need for challenges meaning that funds can be withdrawn from the sidechain as soon as the proof is completed ( ~20 mn for a 1000 tx block). 

 

Optimistic Rollup


Optimistic rollups are another type of L2 scaling solution compatible at 80% with the current EVM and providing a transaction speed around 100 tps with the existing ECDSA signatures and up to 500 tps with BLS through the simultaneous use of fraud proofs and on-chain data availability. Indeed, here we don’t have any algorithm ensuring the validity of the sidechain. Instead users willing to collect the network fees play the role of aggregators by aggregating states updates into block before registering it on the Rollup contract against the staking of a bond of a certain monetary value up for grabs by anyone able to produce a valid fraud proof. Then, as blocks are added to the rollup chain,  their transactions summaries are posted on the main chain allowing other participants to apply these summaries in sync with their local state and challenge the validity of any fraudulent block in order to get the bond staked by the aggregator and invalidate it as well as all its descendants in case of an attempted fraud. So, in contrast with the ZK-Rollup solution we can see that here in the case of the Optimistic rollups every new block issued is assumed to be correct until proven otherwise. However, as in the ZK-Rollups once a certain period is elapsed and the block has been validated onto the main net, the level of security reached is the same as the one for any transaction on Ethereum L1.


To conclude, as presented the Rollups have the potential to support the development of the Ethereum ecosystem while Ethereum 2.0 is still under development both on the short term with the Optimistic Rollups and in the mid/long term with the ZK-Rollups once all the dev teams from the major Dapps of the current DeFi space will have successfully ported the current existing Dapps towards a new structure incorporating the ZK-Rollups requirements.