A Guide to Sharding in Crypto

By Brian Nibley · January 19, 2022 · 6 minute read

We’re here to help! First and foremost, SoFi Learn strives to be a beneficial resource to you as you navigate your financial journey. Read more We develop content that covers a variety of financial topics. Sometimes, that content may include information about products, features, or services that SoFi does not provide. We aim to break down complicated concepts, loop you in on the latest trends, and keep you up-to-date on the stuff you can use to help get your money right. Read less

A Guide to Sharding in Crypto

Sharding is a method of making a database more manageable for computers. This technique has been used in many modern applications but its use in blockchain is still relatively new.

Sharding is important when it comes to crypto because many networks have difficulty scaling. Some of the largest blockchain networks, like Ethereum, are considering sharding as a potential way to manage their rapidly growing number of users and transactions.

In this guide to crypto sharding, we’ll explore the basic concept of sharding and how it could be applied to blockchain technology.

What Is Sharding?

Sharding is one potential solution to the problem of scaling a blockchain network. Sharding involves splitting a blockchain into multiple pieces, or shards, and storing them in different places. By storing the data across different computers, the computational burden on each can be reduced. This allows the network to process a larger volume of transactions.

A typical peer-to-peer (P2P) network such as a blockchain involves multiple full nodes (computers) that each record copies of the entire chain’s history. Using sharding, it’s possible for nodes to function without having to maintain all of that data at once.

How Does Sharding Work?

Sharding involves splitting a large database of the same type into multiple databases. Because this makes for an algorithm that can be more easily generalized, it’s possible to implement sharding at either the application level or the database level.

Sharding has another name — horizontal partitioning. The term horizontal in this case refers to the traditional layout of a database. A database can be split horizontally, with rows of the same database being distributed across multiple nodes, or vertically, with different information in a separate database.

Vertical partitioning involves drawing a logical split within an application’s data. This is often done at the application level, with a piece of code routing commands to a designated database.

Distributed Ledger Technology and Sharding

A distributed ledger is a database that stores information on multiple servers that are distributed throughout different locations. Blockchain technology involves using a type of distributed ledger that aims to be decentralized.

Sharding can be implemented on databases like the ones maintained by distributed ledger technology (DLT). In this case, the database is typically a record of transactions, along with quite a lot of pertinent data, including:

•   The time each transaction was sent

•   Its transaction hash (a unique number identifying the transaction)

•   Which block the transaction was confirmed in

•   The amount of currency sent

•   The public address of the sender and receiver

With millions of users sending millions of transactions, as time goes on, full nodes have to manage a larger and larger database.

Scalability and Sharding

One of the biggest problems faced by blockchains is scaling. Scaling refers to being able to grow the number of users and transactions on a network.

When a new project becomes popular quickly, its network often gets congested, resulting in high transaction fees as people compete to have their transaction processed in the next block (users can adjust the fee they pay to miners in exchange for processing a transaction. When everyone wants to send a transaction, they might be willing to pay more and more, bidding up prices).

Sharding is one of many proposed solutions to this problem. A network that utilizes sharding can reduce the burden placed upon its nodes, allowing them to function more efficiently without an increase in computing power.

How Sharding Is Done

The details of how sharding is implemented get very technical. Those who understand distributed ledgers, coding, and databases might already have an idea of how it works. Others will have a lot of research to do if they want to learn more.

Sharding is typically done on proof-of-stake (PoS) networks, as opposed to proof-of-work (POW) networks. In the PoS consensus mechanism, nodes validate transactions based on the amount of tokens they have staked. Sharding would involve stakers dealing with different shards of the same blockchain.

Implementing sharding on proof-of-work (PoW) networks is very difficult. Nodes would have difficulty validating transactions with only the information from a single shard.

Blockchain Nodes and Sharding

The computers that facilitate transactions in a peer-to-peer (P2P) network like a blockchain are referred to as nodes. The most common type of node is an archival full node. Full nodes archive a copy of the blockchain’s entire history. For larger networks like Bitcoin and Ethereum, this requires quite a lot of memory and computing power.

The tasks of a node include:

•   Processing transactions

•   Recording transactions

•   Broadcasting transactions

These require computing power, storage, and network bandwidth, respectively.

With sharding, full nodes no longer have to store or process the entirety of the network’s activities. Instead, each node only has to maintain data related to its shard.

Shard Sharing

The information of a shard can still be shared with other nodes. This maintains the security and decentralization of the network because all participants can still see all the ledger entries. They just aren’t required to store and process every bit of information.

Is Sharding Necessary?

Sharding is not always necessary. Only networks that are having difficulty scaling are likely to consider sharding. Where other solutions will suffice, developers may opt to forgo sharding due to the additional complexities it can add to an application.

Another method of scaling that has been growing in popularity lately is the use of layer-2s. A layer-2 is a solution that involves processing transactions off-chain, separate from the base layer of the ledger. This can decrease transaction times and decrease fees dramatically.

Bitcoin’s Lightning network is one example of a layer-2 solution. Lightning allows for instant transactions that cost a fraction of a penny.

Pros and Cons of Sharding

There are advantages and disadvantages to using sharding in cryptocurrency. It can be a great way for some networks to scale, but there are still some unknowns, and most developers believe it might not work for every blockchain.

Pros of Sharding

Cons of Sharding

Allows for greater scalability Difficult for proof-of-work protocols to implement
Reduces the processing and memory burden placed on full nodes Makes the database and its applications more complex
Works well for proof-of-stake networks Mostly untested for blockchain technology, meaning there are some unknowns surrounding security

The Takeaway

Sharding was being discussed a lot several years ago as a potential scaling solution. Recently, layer-2s are increasingly being looked at as an alternative.

Bitcoin’s Lightning and Ethereum’s layer-2 solutions — have both seen increasing adoption lately. It’s worth noting, however, that if Ethereum upgrades to Ethereum 2.0 and adopts proof-of-stake, sharding will become the main method used for scaling.

FAQ

Does ETH 2.0 have sharding?

After a series of delays, ETH 2.0 still hasn’t been launched as of December 2021. If ETH 2.0 does launch at some point in the future, then the network would likely adopt a proof-of-stake consensus mechanism and look to use sharding as its main scaling solution.

Is sharding in crypto always needed?

No, sharding is not always necessary. Because sharding can make things more complicated, developers sometimes opt for other solutions to the problem of scaling. This could simply involve getting a more expensive and powerful computer. Adding additional caches or database replicas can also work as a solution for applications that are bound by read performance. A database can also be vertically partitioned according to functionality.

Photo credit: iStock/Poike


SoFi Invest®
INVESTMENTS ARE NOT FDIC INSURED • ARE NOT BANK GUARANTEED • MAY LOSE VALUE
SoFi Invest encompasses two distinct companies, with various products and services offered to investors as described below: Individual customer accounts may be subject to the terms applicable to one or more of these platforms.
1) Automated Investing and advisory services are provided by SoFi Wealth LLC, an SEC-registered investment adviser (“SoFi Wealth“). Brokerage services are provided to SoFi Wealth LLC by SoFi Securities LLC.
2) Active Investing and brokerage services are provided by SoFi Securities LLC, Member FINRA (www.finra.org)/SIPC(www.sipc.org). Clearing and custody of all securities are provided by APEX Clearing Corporation.
For additional disclosures related to the SoFi Invest platforms described above please visit SoFi.com/legal.
Neither the Investment Advisor Representatives of SoFi Wealth, nor the Registered Representatives of SoFi Securities are compensated for the sale of any product or service sold through any SoFi Invest platform.

Crypto: Bitcoin and other cryptocurrencies aren’t endorsed or guaranteed by any government, are volatile, and involve a high degree of risk. Consumer protection and securities laws don’t regulate cryptocurrencies to the same degree as traditional brokerage and investment products. Research and knowledge are essential prerequisites before engaging with any cryptocurrency. US regulators, including FINRA , the SEC , and the CFPB , have issued public advisories concerning digital asset risk. Cryptocurrency purchases should not be made with funds drawn from financial products including student loans, personal loans, mortgage refinancing, savings, retirement funds or traditional investments. Limitations apply to trading certain crypto assets and may not be available to residents of all states.

Third-Party Brand Mentions: No brands, products, or companies mentioned are affiliated with SoFi, nor do they endorse or sponsor this article. Third-party trademarks referenced herein are property of their respective owners.

Financial Tips & Strategies: The tips provided on this website are of a general nature and do not take into account your specific objectives, financial situation, and needs. You should always consider their appropriateness given your own circumstances.

SOIN1221534

All your finances.
All in one app.

SoFi QR code, Download now, scan this with your phone’s camera

All your finances.
All in one app.

App Store rating

SoFi iOS App, Download on the App Store
SoFi Android App, Get it on Google Play

TLS 1.2 Encrypted
Equal Housing Lender