Cryptocurrencies: 852,627
Exchanges: 1,063
Market Cap: $2,578,549,711,746
24h Vol: $84,282,520,998
BTC Dominance: 50.66%

Can DeFi Work With Sharding?

Sharding is one of the most talked about aspects about the new Ethereum 2.0 update. However, as good as sharding is, many experts have wondered if sharding will impact the nearly $11 billion USD DeFi industry being built on top of Ethereum.

This article will cover everything you need to know about sharding and why it might cause some problems for DeFi. We will even discuss other cryptocurrencies attempting to resolve this problem.

What is sharding?

In simple terms, sharding is a type of database structure that breaks a database into separate databases. The separate databases then communicate with each other through a central database.

Now, in the case of Ethereum, the database is actually the blockchain. We can think of sharding as separate blockchains that operate independently and then sync up by a central blockchain connecting them together.

As you can probably imagine, sharding frees up a lot of space for more transactions in a shorter amount of time and more efficient manner. 

Sharding reduces blockchain bloat and increases transaction speeds, so it’s generally viewed as a positive. Now, this might sound great for transaction speed and network congestion, but it will have an impact on DeFi. 

The next section will explore how sharding on Ethereum 2.0 might negatively impact DeFi.

The Problem with Sharding on DeFi

The main problem with sharding in relation to DeFi is that messages between shards are not synchronous. This means that transactions on the same block are not possible if the two dApps attempting to communicate with each other are on separate shards.  

In that case, it becomes an asynchronous communication between the two shards, which simply will not work with DeFi as many DeFi transactions are based on synchronous communication.

The simple solution, of course, is to place all dApps on the same shard. However, doing that will simply result in the same problem – expensive transactions because all the data resides on the same shard. It’s essentially the same as not having sharding if all the data is placed on a single shard. 

Flash Loans Won’t Work With Sharding

The biggest impact that sharding will have on DeFi will likely be on flash loans. Flash loans, for those that don’t know, are unsecured cryptocurrency loans that only last for a single transaction. 

The main use of flash loans are for wiser traders to access a large amount of capital for an arbitrage opportunity. A borrower can borrow cryptocurrency, purchase cryptocurrency, sell the cryptocurrency, and repay the loan on a single transaction. 

On a darker side, flash loans are also used for oracle attacks that either pump or tank the price of a cryptocurrency in a single transaction.

Anyway, flash loans only work on a synchronous system. One cannot use a flash loan on a system that takes multiple transactions to fulfill (ie. sharding). 

Smart Contracts Must Be Rewritten

Smart contracts will also require rewriting because of sharding. The reason is simple: smart contracts are currently only written for synchronous function calls. 

Sharding will add an asynchronous system that will require developers to add another type of call. This adds more complexity to smart contracts, which is a negative when DeFi is attempting to grow.

Sharding Will Have Flaws

This should go without saying, but anytime a new system is put in place savvy programmers find a way to exploit it. An asynchronous call will open up many opportunities for manipulation. 

For one, the gas fee is not known between shards communicating with each other. This will open the opportunity for users to increase their gas fee to front run a transaction, which is already a problem with DeFi.

Sharding on ETH 2.0 Has Not Yet Been Released

A common mistake that the cryptocurrency makes is thinking that Ethereum 2.0 includes sharding from the get go.

It does not. 

Sharding did not ship with the first version of ETH 2.0. In fact, it appears unlikely that sharding will arrive on ETH 2.0 until late-2021 or 2022. Ethereum releases updates every six months, but these have a tendency to experience long delays, so it’s unlikely that sharding will appear for years.

This is good news because it gives developers a few years to figure out any problems that sharding may bring to smart contracts.

What are some solutions to the problems that sharding will bring to DeFi?

We have discussed the problems that sharding will bring to DeFi – an asynchronous will simply not work with the time-sensitive aspects of DeFi. 

Fortunately, there are some solutions to this problem. These solutions range from placing all dApps on the same shard to migrating DeFi to an entirely separate blockchain from Ethereum. 

This section will discuss those solutions and weigh in on the viability of each option. 

Placing All dApps on The Same Shard

A common solution that many experts have presented to the sharding problem is to simply place all dApps on the same shard. This seems like the most logical solution. 

If all dApps are on the same shard, then they can synchronously communicate with each other. All the problems that sharding brings to DeFi become moot in this case. 

However, it’s not this easy. If all dApps are on the same shard, then that will lead to bloat on the blockchain, increased transaction fees, and slower transaction speeds. 

In other words, this will have all the same problems that currently plague Ethereum and DeFi. 

What is the likelihood of this solution being utilized?

In our opinion, this is a likely solution to the sharding problem. Is it the best solution?

No, but it’s simple and easy.

Migrating DeFi Away From Ethereum

A more extreme solution to the sharding problem is to migrate DeFi away from Ethereum. Many cryptocurrencies are vying for the opportunity to become the next home for DeFi. Some examples include Polkadot, Avalanche, and Solana. 

All the alternatives offer a better architecture for DeFi than sharding. But they all have one major issue:

The projects do not have the name recognition nor the user base of Ethereum.

The only project, in our opinion, that has a chance of eclipsing Ethereum and becoming the new home for DeFi is Polkadot. It was publicly released in August and almost immediately jumped to the 9th highest market cap on CoinMarketcap. 

It helps that Polkadot was founded by Ethereum co-founder Dr. Gavin Wood and offered a comprehensive and viable solution to the problems facing DeFi on Ethereum. 

What is the likelihood of this solution being utilized?

This solution will likely occur on some level – alternatives to Ethereum will exist until a clear market leader emerges. DeFi is still in the fragmented stage of industry.

This means that a lot of companies exist that are fighting for the number one spot. That said, Ethereum has a clear lead above any of the other alternatives that it seems unlikely that DeFi will ever disappear from Ethereum.

However, if sharding is a total disaster for DeFi, then you can expect a mass exodus of DeFi to one of the alternatives. The most likely alternative is Polkadot – it’s already the most popular alternative and it was only released a few months ago. 

Time Sensitive dApps Are Placed On The Same Shard

Another potential solution is to place all time sensitive dApps on the same shard. dApps that are not time sensitive can be placed on a separate solution. 

We like this solution because it breaks up the shard a little bit, which will reduce the size. But it still keeps all the dApps that need to be on the same shard on the same shard. 

It’s the best of both worlds, basically. 

What is the likelihood of this solution being utilized?

This appears that it will probably be the solution to the sharding problem. It’s better than placing all dApps on the same shard. Doing that would lead to the same problems that currently exist on Ethereum. 

The only problem with this solution is that just because a dApp is time sensitive does not mean it will work at an optimum level with asynchronous communication. This means that a big risk is no dApp will like this solution and simply migrate to a better solution such as Polkadot. 

Will Ethereum lose DeFi because of sharding?

polkadot

It’s possible that Ethereum will lose some parts of DeFi because of sharding. dApps already on Ethereum will likely stay on Ethereum, but if a developer wants to develop a DeFi dApp, then they will likely place it on an easier blockchain. 

Polkadot is the one that gets the most attention. However, any blockchain that does not rely on sharding will likely work the same.

As mentioned previously, the good news for Ethereum is that it will likely be another year or two years before sharding is rolled out. This will give developers plenty of time to prepare for sharding, so it will not take any dApp by surprise. 

Conclusion

We hope that answered the question about whether DeFi works with sharding. In simple terms, DeFi will work with sharding, but a lot of the benefits of DeFi will be lost with sharding if a solution to the asynchronous problem is not discovered. 

Ethereum will likely remain fine, though. It has enough good will in DeFi that it will take more than sharding for it to lose the majority of the DeFi industry.

Can DeFi Work With Sharding?