📝

Latency in Blockchains and Ethereum L2 Migration

Published
Jul 21, 2023
Type
post
Thanks to Alex Stokes and Al N for helpful discussions, Barnabé Monnot and Julian Ma for review and feedback.
Vitalik recently published a post called “The Three Transitions” envisioning a future for Ethereum where most user activity migrates to L2s. For some applications, such as onchain games and similar compute intensive apps, that have not seen much development/adoption at L1, migration will be easy and some of them will be L2-native. For others, such as DeFi apps, migrating to L2 will be more challenging. This post discusses some of the benefits and paths for such migration.
Note: this is not suggested as an alternative to improve DeFi on L1, it is an exploration of how a mature L2 ecosystem could help overcome the constraints induced by the L1 protocol.
Why low latency of execution is good for DeFi
One of the major challenges for DeFi applications on Ethereum L1 has been the relatively high latency. Take DEXs for example, such as Uniswap. A latency of 12s, the current slot time at L1, presents a few key problems:
  • Low market efficiency
  • High potential for market manipulation
Today most of the volume going through DEXs on Ethereum L1 is on token pairs that are also listed on one of the many CEXs. This sets a high bar for efficiency of DEXs. Some users will always prefer DEXs for ideological reasons, but if we want to drive major adoption and massively increase the value that flows through the ETHconomy we must offer an alternative that is competitive with CEXs. There is always going to be a trade-off between decentralization and efficiency, but if we can close the efficiency gap enough I believe the higher robustness of DEXs together with the redistribution of rents that are captured by CEXs operators will make DEXs the preferred option for the majority of users.
On the market manipulation side, a DEX that makes progress at 12s snapshots, while the CEX counterparts operate at much higher frequency (often sub-ms), allows many degrees of freedom for sophisticated players to take advantage of opportunities and exploit passive LPs and less informed users. The value of transaction reordering is high and market operators (including arbitrageurs) compete on amount of capital, private information, algorithms, and latency. Smaller players are at a disadvantage which only exaggerates as the block latency grows. Systems to prevent exploits such as OFAs and privacy solutions can be deployed to mitigate exploits, but only to some extent if latency remains high.
notion image
The Uniswap v3 ETH/USDC pool on Ethereum L1 and Arbitrum L2 (both 0.05 fee) — The trade volume on L1 is only 0.52x the TVL while on L2 is 1.43x the TVL, almost three times higher. This is likely due to both lower transaction fees on L2 and lower latency, the result is 3x more fees for LPs.
Why low latency is not feasible for Ethereum L1
The most fundamental resource that Ethereum L1 offers is its credibility. The ability to convince any potential user of the integrity of the protocol being executed. Ethereum makes an extreme design choice, similar to Bitcoin, which is trust minimization. I.e., the credibility does not rely on a third party but on direct verification of valid execution by the users of the protocol. This buys an important practical property which is the social scalability of the protocol, its ability to being safely adopted by the most numerous, diverse, and widespread group of users. As a concrete example, Bitcoin as high social scalability because the requirements to run Bitcoin Core are modest, a low-bandwidth internet connection and a personal computer with a few GB of storage (with pruning). This makes it a truly global digital gold (or money, depending on your perspective), a new kind of digital institution that has no limits of jurisdiction, ethnicity, belief, or birthright typical of traditional human institutions. Ethereum aims at providing similar guarantees for its native currency and a robust foundational layer for any other kind of digital institution that is built on top of it.
Social scalability comes at the cost of performance, as Nick Szabo summarizes it in his 2017 essay Money, Blockchains, and Social Scalability:
“That is what proof-of-work and broadcast-replication are about: greatly sacrificing computational scalability in order to improve social scalability.”
and
“Bitcoin offends the sensibilities of resource-conscious and performance-measure-maximizing engineers and businessmen alike.”
Bitcoin makes extreme design choices in terms of network redundancy and security, with very long block times of about 10 minutes. This is feasible because of its radical focus on optimizing for a “single app” and high resistance to change. Ethereum tries to make a more balanced trade-off that can enable applications without compromising the credibility of its base layer protocol and its native currency. The current block time of 12 seconds requires substantial computational resources to run the protocol (much higher than Bitcoin). This is already a compromise in its social scalability, and it will be difficult to justify eroding it further to increase the efficiency (via lower latency) of one, although very important, application such as DeFi.
notion image
The performance-social scalability trade-off — Ethereum currently has a higher bar then Bitcoin in terms of resource requirements and higher performance. High-throughput chains greatly sacrifice social scalability.
Why rollup centric roadmap is the solution for efficient DeFi and MEV mitigation
Fortunately, there are different ways of navigating the trade-off. Technological improvements at the base layer can sometimes increase both, but only to some extent. The direction that Ethereum is pursuing is to have a modular design where the base layer maintains high social scalability and achieves higher performance via L2 chains. Technological improvements at L1, such as DAS, are focused on this direction.
It seems thus that many applications, and in particular DeFi, could gain a lot by running on an L2. Lower transaction costs by few orders of magnitude and sub-second latency will greatly increase DeFi efficiency. Moreover, specialized L2 chains could make design choices that further optimize for the requirements of a DeFi protocol, increasing both efficiency and robustness to manipulations. For example, implementing a first-come-first-served transaction ordering policy or experimenting with hybrid solutions or designing the transaction ordering policy to be optimized for a single DeFi application. This would not only benefit DeFi users but potentially also reduce security risks on L1, if high frequency trading and related applications mostly happen at L2 then the variety and magnitude of MEV flows that the L1 needs to handle goes down. Most of the MEV flows can then be more efficiently managed by specific designs of application and sequencing mechanism.
Some specialized chains, could even make more trusted setups or more radical decisions about geographical distribution of the network to further optimize for efficiency and tailor to a more specific set of users. This is probably necessary for the type of applications that aim to compete with TradFi in terms of user experience. It can make these applications competitive by requiring some level of trust for some time, until transactions settle on L1, but still maintaining full credibility of L1 and a substantial advantage versus TradFi in terms of security.
What would it take for DeFi to migrate to L2?
Ethereum L2s are perhaps the most exciting and dynamic areas of the ecosystem, but today they are still a work-in-progress. Earlier projects, such as Arbitrum, are reaching maturity but many others, including most of the zk-rollups, are testing brand new technology.
Many DeFi applications already deployed on L2s and the migration has already started. However, for the majority of the activity to migrate to L2s and L1 become mostly a settlement/data availability layer, there are three main requirements
  • Lower costs
  • Higher security
  • Better user experience
Rollup costs are quickly going down via L2 improvements/optimizations and L1 improvements such as danksharding. One potential issue with liquidity moving to L2 is fragmentation, but can also be addressed with new protocols that aggregate liquidity across multiple L2s, the design space is large and new protocols are emerging in this area.
Security is a major friction to migrating, especially for large DeFi users, but it is quickly going down as projects mature. There will likely always be a delta between L1 security risks and L2 security risks, but L2 can make different design choices and prioritize performance and efficiency because they do not need to maintain the same social scalability bar as L1. If security risk is low enough it will still make sense for users to migrate on a risk-adjusted assessment, given the improvement in efficiency.
notion image
The L2BEAT dashboard — Up-to-date information on the fast-growing Ethereum L2 ecosystem: alongside financials/scale, it reports the state of the technology and a detailed breakdown of the major security risks.
We will also need better user experience on L2s. Vitalik’s post mentioned in the beginning goes into the details of how to make smart wallets more usable and secure in a world in which users interact with multiple L2 systems. Solutions are being developed by the EF research team and this will likely be a major area of research for some time. Lots of improvements in the workings, but it is important to mention that, already today, L2 pre-confirmations can offer better user experience to DeFi users whose transactions are often time-sensitive. Another path that was mentioned before, is application-specific rollups that are optimized for a specific use-cases, e.g. a stable exchange, which can make more radical designs to increase efficiency and thus deliver better user experience.
📝

Latency in Blockchains and Ethereum L2 Migration

Published
Jul 21, 2023
Type
post
Thanks to Alex Stokes and Al N for helpful discussions, Barnabé Monnot and Julian Ma for review and feedback.
Vitalik recently published a post called “The Three Transitions” envisioning a future for Ethereum where most user activity migrates to L2s. For some applications, such as onchain games and similar compute intensive apps, that have not seen much development/adoption at L1, migration will be easy and some of them will be L2-native. For others, such as DeFi apps, migrating to L2 will be more challenging. This post discusses some of the benefits and paths for such migration.
Note: this is not suggested as an alternative to improve DeFi on L1, it is an exploration of how a mature L2 ecosystem could help overcome the constraints induced by the L1 protocol.
Why low latency of execution is good for DeFi
One of the major challenges for DeFi applications on Ethereum L1 has been the relatively high latency. Take DEXs for example, such as Uniswap. A latency of 12s, the current slot time at L1, presents a few key problems:
  • Low market efficiency
  • High potential for market manipulation
Today most of the volume going through DEXs on Ethereum L1 is on token pairs that are also listed on one of the many CEXs. This sets a high bar for efficiency of DEXs. Some users will always prefer DEXs for ideological reasons, but if we want to drive major adoption and massively increase the value that flows through the ETHconomy we must offer an alternative that is competitive with CEXs. There is always going to be a trade-off between decentralization and efficiency, but if we can close the efficiency gap enough I believe the higher robustness of DEXs together with the redistribution of rents that are captured by CEXs operators will make DEXs the preferred option for the majority of users.
On the market manipulation side, a DEX that makes progress at 12s snapshots, while the CEX counterparts operate at much higher frequency (often sub-ms), allows many degrees of freedom for sophisticated players to take advantage of opportunities and exploit passive LPs and less informed users. The value of transaction reordering is high and market operators (including arbitrageurs) compete on amount of capital, private information, algorithms, and latency. Smaller players are at a disadvantage which only exaggerates as the block latency grows. Systems to prevent exploits such as OFAs and privacy solutions can be deployed to mitigate exploits, but only to some extent if latency remains high.
notion image
The Uniswap v3 ETH/USDC pool on Ethereum L1 and Arbitrum L2 (both 0.05 fee) — The trade volume on L1 is only 0.52x the TVL while on L2 is 1.43x the TVL, almost three times higher. This is likely due to both lower transaction fees on L2 and lower latency, the result is 3x more fees for LPs.
Why low latency is not feasible for Ethereum L1
The most fundamental resource that Ethereum L1 offers is its credibility. The ability to convince any potential user of the integrity of the protocol being executed. Ethereum makes an extreme design choice, similar to Bitcoin, which is trust minimization. I.e., the credibility does not rely on a third party but on direct verification of valid execution by the users of the protocol. This buys an important practical property which is the social scalability of the protocol, its ability to being safely adopted by the most numerous, diverse, and widespread group of users. As a concrete example, Bitcoin as high social scalability because the requirements to run Bitcoin Core are modest, a low-bandwidth internet connection and a personal computer with a few GB of storage (with pruning). This makes it a truly global digital gold (or money, depending on your perspective), a new kind of digital institution that has no limits of jurisdiction, ethnicity, belief, or birthright typical of traditional human institutions. Ethereum aims at providing similar guarantees for its native currency and a robust foundational layer for any other kind of digital institution that is built on top of it.
Social scalability comes at the cost of performance, as Nick Szabo summarizes it in his 2017 essay Money, Blockchains, and Social Scalability:
“That is what proof-of-work and broadcast-replication are about: greatly sacrificing computational scalability in order to improve social scalability.”
and
“Bitcoin offends the sensibilities of resource-conscious and performance-measure-maximizing engineers and businessmen alike.”
Bitcoin makes extreme design choices in terms of network redundancy and security, with very long block times of about 10 minutes. This is feasible because of its radical focus on optimizing for a “single app” and high resistance to change. Ethereum tries to make a more balanced trade-off that can enable applications without compromising the credibility of its base layer protocol and its native currency. The current block time of 12 seconds requires substantial computational resources to run the protocol (much higher than Bitcoin). This is already a compromise in its social scalability, and it will be difficult to justify eroding it further to increase the efficiency (via lower latency) of one, although very important, application such as DeFi.
notion image
The performance-social scalability trade-off — Ethereum currently has a higher bar then Bitcoin in terms of resource requirements and higher performance. High-throughput chains greatly sacrifice social scalability.
Why rollup centric roadmap is the solution for efficient DeFi and MEV mitigation
Fortunately, there are different ways of navigating the trade-off. Technological improvements at the base layer can sometimes increase both, but only to some extent. The direction that Ethereum is pursuing is to have a modular design where the base layer maintains high social scalability and achieves higher performance via L2 chains. Technological improvements at L1, such as DAS, are focused on this direction.
It seems thus that many applications, and in particular DeFi, could gain a lot by running on an L2. Lower transaction costs by few orders of magnitude and sub-second latency will greatly increase DeFi efficiency. Moreover, specialized L2 chains could make design choices that further optimize for the requirements of a DeFi protocol, increasing both efficiency and robustness to manipulations. For example, implementing a first-come-first-served transaction ordering policy or experimenting with hybrid solutions or designing the transaction ordering policy to be optimized for a single DeFi application. This would not only benefit DeFi users but potentially also reduce security risks on L1, if high frequency trading and related applications mostly happen at L2 then the variety and magnitude of MEV flows that the L1 needs to handle goes down. Most of the MEV flows can then be more efficiently managed by specific designs of application and sequencing mechanism.
Some specialized chains, could even make more trusted setups or more radical decisions about geographical distribution of the network to further optimize for efficiency and tailor to a more specific set of users. This is probably necessary for the type of applications that aim to compete with TradFi in terms of user experience. It can make these applications competitive by requiring some level of trust for some time, until transactions settle on L1, but still maintaining full credibility of L1 and a substantial advantage versus TradFi in terms of security.
What would it take for DeFi to migrate to L2?
Ethereum L2s are perhaps the most exciting and dynamic areas of the ecosystem, but today they are still a work-in-progress. Earlier projects, such as Arbitrum, are reaching maturity but many others, including most of the zk-rollups, are testing brand new technology.
Many DeFi applications already deployed on L2s and the migration has already started. However, for the majority of the activity to migrate to L2s and L1 become mostly a settlement/data availability layer, there are three main requirements
  • Lower costs
  • Higher security
  • Better user experience
Rollup costs are quickly going down via L2 improvements/optimizations and L1 improvements such as danksharding. One potential issue with liquidity moving to L2 is fragmentation, but can also be addressed with new protocols that aggregate liquidity across multiple L2s, the design space is large and new protocols are emerging in this area.
Security is a major friction to migrating, especially for large DeFi users, but it is quickly going down as projects mature. There will likely always be a delta between L1 security risks and L2 security risks, but L2 can make different design choices and prioritize performance and efficiency because they do not need to maintain the same social scalability bar as L1. If security risk is low enough it will still make sense for users to migrate on a risk-adjusted assessment, given the improvement in efficiency.
notion image
The L2BEAT dashboard — Up-to-date information on the fast-growing Ethereum L2 ecosystem: alongside financials/scale, it reports the state of the technology and a detailed breakdown of the major security risks.
We will also need better user experience on L2s. Vitalik’s post mentioned in the beginning goes into the details of how to make smart wallets more usable and secure in a world in which users interact with multiple L2 systems. Solutions are being developed by the EF research team and this will likely be a major area of research for some time. Lots of improvements in the workings, but it is important to mention that, already today, L2 pre-confirmations can offer better user experience to DeFi users whose transactions are often time-sensitive. Another path that was mentioned before, is application-specific rollups that are optimized for a specific use-cases, e.g. a stable exchange, which can make more radical designs to increase efficiency and thus deliver better user experience.