ethereum layer 2 – Finematics https://finematics.com decentralized finance education Mon, 05 Apr 2021 14:48:16 +0000 en-GB hourly 1 https://wordpress.org/?v=5.8.1 https://finematics.com/wp-content/uploads/2017/09/cropped-favicon-32x32.png ethereum layer 2 – Finematics https://finematics.com 32 32 The Truth About DeFi https://finematics.com/the-truth-about-defi/?utm_source=rss&utm_medium=rss&utm_campaign=the-truth-about-defi&utm_source=rss&utm_medium=rss&utm_campaign=the-truth-about-defi https://finematics.com/the-truth-about-defi/#respond Mon, 05 Apr 2021 14:48:14 +0000 https://finematics.com/?p=1312

Intro

So what is the current state of decentralized finance? Where are we with different scaling solutions on Ethereum? How about DeFi on other chains? And what is the most likely scenario when it comes to the future of DeFi? You’ll find answers to these questions in this article. 

And one more thing before we start, Finematics has recently hit 100,000 subscribers on Youtube! This is pretty amazing and I’d like to say a big thank you to all of you watching my videos and reading my articles. Also a special shout out to all of our Patrons who actively support this channel. If you’d like to become one of them and join our DeFi community you can check it out here.  

DeFi – State of Affairs 

Decentralized Finance, together with the whole cryptocurrency space, started 2021 with a bang. 

In just a few months the total value locked in DeFi grew from around $15B to an astonishing $45B. 

The volume on decentralized exchanges has also been at an all-time high with over $50B traded each month. 

On top of this, a lot of DeFi tokens have seen a significant increase in value which attracted even more people to this still very new space. 

We’ve also seen a lot of development. 

New projects popping up pretty much every day. 

Already existing protocols launching their new versions. 

Other well-known projects migrating or announcing their migration to different scaling solutions.  

We also had some big news. For example, Visa announced they will start settling transactions in USDC on Ethereum. This is amazing not only for Ethereum but also for the whole DeFi space in general. 

Despite all of this development, it seems like DeFi is at a crossroad. 

On one hand, we have DeFi protocols on Ethereum exploring multiple different scaling solutions to alleviate high transaction fees. On the other hand, we have other chains trying to attract both the new and the already existing DeFi projects. 

Scaling DeFi 

When it comes to scaling DeFi on Ethereum we have quite a few options either already available or not being too far from a full launch.

These options belong to one of the 2 categories: Layer 2 scaling and sidechains. 

Layer 2 scaling relies on the security of the main layer – the Ethereum blockchain. 

Sidechains rely on their own security models, usually by having a separate consensus mechanism. They can also have additional security guarantees that leverage the main layer, but despite this, they are usually considered less secure than Layer 2 solutions. 

One of the most discussed Layer 2 options, when it comes to DeFi, are rollups. 

Rollups provide scaling by executing transactions outside of Layer 1 but posting transaction data on Layer 1 which allows rollups to be secured by the main Ethereum chain. 

There are 2 types of rollups: optimistic rollups and ZK rollups. 

Optimistic rollups run an EVM-compatible virtual machine which allows for executing the same smart contracts as on Ethereum. Optimism and Arbitrum are currently the most popular options. 

Optimism has been partially rolled out to the Ethereum mainnet with a limited set of partners to ensure that the technology works as expected.

Synthetix has already migrated its staking module to Optimism which allows for minting sUSD and receiving staking rewards in a fast, cheap and secure way. 

Another big partner that has already announced its launch on Optimism is Uniswap with its long-awaited Uniswap V3.

Arbitrum, on the other hand, seems to be even closer to being fully launched on the Ethereum mainnet. They partnered with a few major DeFi projects like Augur and Bancor. 

ZK rollups, although faster and more efficient than optimistic rollups, do not provide an easy way for the existing smart contracts to migrate to Layer 2 – at least not just yet. 

With ZK rollups we have a few options available, mainly StarkWare and ZKSync. 

StarkWare-based rollups are already extensively used by projects such as DeversiFi, Immutable X and dYdX. 

ZKSync is working on an EVM-compatible virtual machine that will be able to fully support any arbitrary smart contracts written in Solidity. They are targeting August for their mainnet release.

Besides Layer 2 options, we have sidechains like the Matic PoS chain or the xDai chain. 

We’ve recently seen a lot of projects launching on both of these chains. This includes Sushiswap, Polkamarkets and Aave on the Matic PoS chain and Perpetual Protocol, RealT and Gnosis on xDai. Both chains are also integrated with Chainlink oracles. 

Matic, after its recent rebranding to Polygon, also aims at expanding its available scaling solutions and add things like ZK and optimistic rollups, on top of already available solutions: the PoS chain and the Plasma chains. 

Although Layer 2 scaling and sidechains can alleviate high transaction fees and increase both the throughput and speed of transactions they come with their own challenges. 

The biggest one, that can negatively affect DeFi, is the lack of smart contract composability between different scaling solutions.

Composability is clearly one of the most important characteristics of DeFi. When it comes to the Ethereum main chain, a single transaction can interact with multiple different DeFi protocols. For example, a smart contract can borrow funds on Aave, swap these borrowed coins to other ones on Uniswap and provide the swapped coins to a yield farming aggregator – all of this in one single Ethereum transaction. 

Although composability is still possible within one scaling solution, it would break if even one of these protocols is not available on this particular scaling solution. 

Continuing with our previous example, if Aave is only additionally available on Matic PoS and Uniswap is only available on Optimism, we wouldn’t be able to compose one transaction that calls both the Aave’s and Uniswap’s smart contracts in any way outside of the Ethereum main chain.

The next issue is the interoperability between different scaling solutions.

What if we borrowed funds on Aave on the Matic PoS Chain but we later want to swap them using Uniswap on Optimism. At the moment we’d have to withdraw them to the Ethereum main chain before being able to use the coins on Optimism. This of course adds a lot of friction as some withdrawals can take a long time to be fully settled especially when it comes to optimistic rollups. 

Having multiple scaling solutions also provides us with some challenges when it comes to the existing liquidity in DeFi. Instead of having a lot of liquidity available on the Ethereum main chain in a few major protocols, we’ll see the existing liquidity being split across the Ethereum main chain, multiple implementations of rollups and different sidechains. 

Fortunately, most of these challenges are solvable. 

We’ll probably see a lot of bridges between different scaling solutions which should help with reducing friction. On top of this, the other approach is to create a whole ecosystem that is interoperable by default. This is the approach that Polygon decided to go with. 

Also, it looks like most liquidity outside of Layer 1 will concentrate around a few most popular scaling options with the biggest number of high-quality DeFi protocols available. 

Despite the existing and future challenges, Ethereum is clearly an undisputed leader when it comes to DeFi. It offers credible neutrality, decentralization and a strong community, driven not only by the recent price rise of ETH but even more about building the future of finance and web3. 

When it comes to DeFi on other chains there are also a few options available. 

BSC And DeFi On Other Chains

Let’s start with Binance Smart Chain – yes, I know, BSC is not always even considered as DeFi and more like CeDeFi and you can find more about it here in this article

Nevertheless, BSC attracted a lot of users and trading volume in a very short period of time. 

BSC, as a fork of Ethereum, allows for deploying the same smart contracts as the ones already available on Ethereum. 1inch and Alpha Homora are some of the projects that decided to expand their reach and launch on BSC in parallel to Ethereum.  

Besides Binance Smart Chain, there are a lot of other chains that come with their own security models and different levels of decentralization. 

Many also put a lot of effort into building their own DeFi ecosystem, including Solana with its decentralized exchange – Serum, Avalanche with Pangolin and even Bitcoin where DeFi can be built on top of sidechains. 

The challenges with all of these blockchains are similar to the challenges of different scaling solutions on Ethereum, mainly the lack of composability and interoperability. 

Fortunately enough, there are also a few other projects that focus predominantly on these problems. 

Cosmos aims at creating “The Internet Of Blockchains” by leveraging its inter-blockchain communication protocol. 

Polkadot, on top of its parachains technology that allows for creating sovereign blockchains, also aims to make bridging to the external blockchains easier.

Thorchain focuses on cross-chain liquidity and decentralized exchange of assets between different blockchains.

With all of these options within the Ethereum ecosystem, and outside of it, most people feel lost trying to answer the question – what will DeFi look like in the future. 

The Truth 

Although it seems like DeFi is at a crossroad, in practice we’re just experiencing an ongoing Cambrian Explosion of this nascent space. 

The truth is, that at this point, no one can be certain what the future of DeFi will look like.

What we can pretty much assume though is that every single potential solution will be explored. Some of them will survive and thrive while others will become irrelevant over time. 

DeFi on Ethereum with different Layer 2 options and sidechains; DeFi and CeDeFi on other chains; interoperability between blockchains or maybe something completely new: It’s almost guaranteed that all of this will be tried and after some time we’re going to end up with the most adopted and hopefully most decentralized working solution.

And even though some people may not like it, this is the beauty of DeFi and any other open ecosystems like this. 

The exact details might still be quite vague, but the future of the whole DeFi space is brighter than ever. DeFi is here to stay. We may not be 100% sure of its final form, but it is almost certainly the future of finance. 

One thing that can be used to indicate which projects and ideas are here to stay more than anything else is the next, most likely inevitable, bear market. During this time most bad ideas and projects without strong communities die off and the remaining users concentrate around the best, long-lasting protocols. 

When it comes to individual DeFi projects, some of them will thrive and capture value across multiple scaling solutions or even across multiple blockchains. Others won’t be able to do it and new protocols will be able to steal their market share.

Because of this ever-changing space, it’s really important to keep learning and expanding our knowledge about DeFi, crypto, finance and technology in general. 

Fortunately, Finematics is here for you and will always deliver fresh and relevant content to keep you up to speed!

So what do you think about the future of DeFi? What will it look like in its final form? Or maybe there is no final form at all and the whole space will keep evolving?

If you enjoyed reading this article you can also check out Finematics on Youtube and Twitter.

]]>
https://finematics.com/the-truth-about-defi/feed/ 0
Ethereum Layer 2 Scaling Explained https://finematics.com/ethereum-layer-2-scaling-explained/?utm_source=rss&utm_medium=rss&utm_campaign=ethereum-layer-2-scaling-explained&utm_source=rss&utm_medium=rss&utm_campaign=ethereum-layer-2-scaling-explained https://finematics.com/ethereum-layer-2-scaling-explained/#respond Tue, 27 Oct 2020 19:09:12 +0000 https://finematics.com/?p=1057

So what is Ethereum Layer 2 scaling all about? And what is the difference between projects such as Optimism, xDai, OMG and Loopring? We’ll answer all of these questions in this article. 

Need For Scaling

Ethereum scaling has been one of the most discussed topics pretty much since the time when the network launched. The scaling debate always heats up after a period of major network congestion. 

One of the first periods like this was the 2017 crypto bull market where infamous CryptoKitties, together with ICOs, were able to clog up the entire Ethereum network causing a major spike in the gas fees. 

This year the network congestion came back even stronger, this time caused by the popularity of DeFi and yield farming. There were periods of time when even gas fees as high as 500+ gwei would not get your transaction verified for a while. 

When it comes to scaling Ethereum or blockchains in general, there are 2 major ways of doing it: scaling the base layer itself (Layer 1) or scaling the network by offloading some of the work to another layer – Layer 2. 

Layers 1 vs Layer 2 Scaling 

Layer 1 is our standard base consensus layer where pretty much all transactions are currently settled. The concept of layers is not an Ethereum-specific concept. Other blockchains such as Bitcon or Zcash also use it extensively.   

Layer 2 is another layer built on top of Layer 1. There are a few important points here. Layer 2 doesn’t require any changes in Layer 1, it can be just built on top of Layer 1 using its existing elements such as smart contracts. Layer 2 also leverages the security of Layer 1 by anchoring its state into Layer 1.

Ethereum can currently process around 15 transactions per second on its base layer (Layer 1). Layer 2 scaling can dramatically increase the number of transactions. Depending on the solution, we’re talking about processing between 2000-4000 tx/second. 

How about Ethereum 2.0? Wasn’t that supposed to scale Ethereum? 

Yes. Ethereum 2.0 introduces Proof of Stake and sharding that will dramatically increase the transaction throughput on the base layer. 

Does it mean we don’t need Layer 2 scaling when Ethereum 2.0 ships? 

Not really, even with sharding Ethereum will still need Layer 2 scaling to be able to handle hundreds of thousands or even millions of tx per second in the future. 

This is also where the famous Scalability Trilemma comes into play. In theory, we could just skip Layer 2 entirely and focus on scaling the base layer instead. This would require highly specialized nodes to handle the increased workload which would lead to higher centralization and, therefore, lowering security and censorship-resistant properties of the network. 

Sticking to the fact that scalability should never come at the expense of security and decentralization, we are left with a combination of Layer 1 and Layer 2 scaling going forward into the future. 

Layer 2 Scaling Solutions

Layer 2 scaling is a collective term for solutions that help with increasing the capabilities of Layer 1 by handling transactions off-chain (off Layer 1). The 2 main capabilities that can be improved are transaction speed and transaction throughput. On top of that, Layer 2 solutions can greatly reduce the gas fees. 

When it comes to actual scaling solutions there are multiple options available. Whilst some of the options are available right now and can increase Ethereum network throughput in the near to medium-term, others are aiming for a medium to long-term time horizon.  

Some of the scaling solutions are application-specific, for example, payment channels. Others, such as optimistic rollups, can be used for any arbitrary contract executions.

To understand these differences better let’s explore the most popular Layer 2 scaling solutions.

Channels

Channels are one of the first widely discussed scaling solutions. They allow participants to exchange their transactions off-chain a number of times while only submitting two transactions to the base layer.  

The most popular types of channels are state channels and their subtype – payment channels.

Although channels have the potential to easily process thousands of transactions per second, they come with a few downsides. They don’t offer open participation – participants have to be known upfront and users have to lock up their funds in a multisig contract. On top of that, this scaling solution is application-specific and cannot be used to scale general-purpose smart contracts. 

The main project that leverages the power of state channels on Ethereum is Raiden. The concept of payment channels is also extensively used by Bitcoin’s Lightning Network. 

Plasma

Plasma is a Layer 2 scaling solution that was originally proposed by Joseph Poon and Vitalik Buterin. It’s a framework for building scalable applications on Ethereum.

Plasma leverages the use of smart contracts and Merkle trees to enable the creation of an unlimited number of child chains – copies of the parent Ethereum blockchain. 

Offloading transactions from the main chain into child chains allows for fast and cheap transactions. One of the drawbacks of Plasma is a long waiting period for users who want to withdraw their funds from Layer 2. Plasma, similarly to channels, cannot be used to scale general-purpose smart contracts.

The OMG Network is built on their own implementation of Plasma, called MoreViable Plasma. Matic Network is another example of a platform using an adapted version of the Plasma framework. 

Sidechains 

Sidechains are Ethereum-compatible, independent blockchains with their own consensus models and block parameters.

Interoperability with Ethereum is made possible by using the same Ethereum Virtual Machine, so contracts deployed to the Ethereum base layer can be directly deployed to the sidechain. xDai is an example of such a sidechain. 

Rollups 

Rollups provide scaling by bundling or “rolling up” sidechain transactions into a single transaction and generating a cryptographic proof, also known as a SNARK (succinct non-interactive argument of knowledge). Only this proof is submitted to the base layer. 

With rollups, all transaction state and execution are handled in sidechains. The main Ethereum chain only stores transaction data. 

There are 2 types of rollups: Zk rollups and optimistic rollups. 

Zk rollups, although faster and more efficient than optimistic rollups, do not provide an easy way for the existing smart contracts to migrate to Layer 2. 

Optimistic rollups run an EVM compatible Virtual Machine called OVM (Optimistic Virtual Machine) which allows for executing the same smart contracts as can be executed on Ethereum. This is really important as it makes it easier for the existing smart contracts to maintain their composability, which is extremely relevant in DeFi where all major smart contracts were already battle-tested.  

One of the main projects working on optimistic rollups is Optimism, which is getting closer and closer to their mainnet launch. 

When it comes to Zk rollups, Loopring and Deversifi are good examples of decentralized exchanges built on Layer 2. On top of that we have ZkSync enabling scalable crypto payments.

Rollups’s scalability can also be magnified by Ethereum 2.0. In fact, because rollups only need the data layer to be scaled, they can get a tremendous boost already in Ethereum 2.0 Phase 1 which is about the sharding of data.

Summary

Despite a spectrum of Layer 2 scaling solutions available, it looks like the Ethereum community is converging on the approach of mainly scaling through rollups and Ethereum 2.0 Phase 1 data sharding. 

This approach was also confirmed in a recent post by Vitalik Buterin called “A rollup centric Ethereum roadmap” that I will link in the description box below. 

In our future articles, we’ll explore the base layer scaling with Ethereum 2.0 and how both layer 1 and layer 2 scaling can help with making decentralized finance more accessible to everyone. Stay tuned by subscribing to the channel. 

So what do you think about Ethereum’s approach to scaling? And which scaling solution would you like to learn more about?

If you enjoyed reading this article you can also check out Finematics on Youtube and Twitter.

]]>
https://finematics.com/ethereum-layer-2-scaling-explained/feed/ 0