Sharding is something people talk about often as a way of making blockchain more scaleable or essentially allowing them to process more transactions per second. But how does it actually work?
Sharding splits up an entire network into smaller partitions, known as āshards.ā Each shard is comprised of its own data which makes it distinctively different and entirely independent when compared to other shards.
Sharding can help reduce the latency or slowness of a network since it splits a blockchain network into separate shards.
The high volume of transactions on any network If we think of a blockchain as a shared database, as more and more data is added, the network needs to find new ways to be able to process all of that data efficiently and quickly. So, sharding can actually really help.
TheĀ distributed ledgerĀ of blockchain technology is perfect since it allows the transactions to be consensually shared across geographies. As transactions are recorded, copies are sent to the shared network which in essence creates public āwitnesses.ā
If one portion of the network falls victim to some sort of attack, the shared networkās participants can identify what was changed by the fraudsters since they all maintain a copy of the ledgerās transactions.
One of the biggest challenges with blockchain technology is that as additional computers are added to the network and more transactions are processed, the network works less efficiently which slows down transactions (this is called latency).
One solution to creating latency-free scalability is the process of sharding. Sharding is designed to spread out the workload of a network into partitions, which may help reduce latency and allow more transactions to be processed by the blockchain.
Soā¦ how does it work?
Currently, each node in a network must process or handle all of the transaction volumes within the network.Ā Nodes in a blockchain are independent and are responsible for maintaining and storing all of the data within a decentralized network.
While it ensures a blockchainās security by storing every transaction in all of the nodes, this model slows down transaction processing a TON.
Sharding can help since it partitions the transactional workload from a blockchain network so that every node doesnāt need to handle or process all of the blockchainās workload.
It basically turns the workload into partitions or shards.
Sharding can be accomplished through horizontal sharding where there is a partitioning of databases through the splitting of rows.
Shards, as the rows are called, are created based on characteristics. As an example, one shard could have the job of storing the state and transaction history for a specific type of address.
Also, itās possible to divide shards based on the type of digital asset stored in them. Transactions involving that digital asset might be made possible through a combination of shards.
Each shard is still able to be shared amongst the other shards, which maintains the decentralized ledger technology. In other words, the ledger is still accessible to every user which allows them to see all the ledgerās transactions
A huge concern for sharding is security. Each shard is separate and processes its own data, yet there is a concern with the corruption of the shards because one shard could take over another shard which would mean a loss of information or important data.
If we think of each shard as its own blockchain network with its authenticated users and data, a hacker could take over a shard and introduce false transactions or corrupt programs.
Ethereum is on top of testing sharding as a possible solution to latency and scalability issues. Ethereum has combated the potential of a shard attack by randomly assigning nodes to certain shards and constantly reassigning them at random intervals. This random sampling would make it difficult for hackers to know when and where to corrupt a shard.
Also, itās important to note that sharding is still in the early testing phase of being used for blockchain networks but itās already being leveraged in a ton of new projects (Iāll have more posts soon on some I found interesting).
Sharing is cool because it solves one of the fundamental problems with the widespread use of blockchain. Iām curious about how other projects have been able to overcome the security concerns of sharding and the extent to which it has been able to make the network more scalable and secure.
Learn more š
designing ethereum - vitalik speaks on bankless
shard chains on ethereum
scaling blockchain - what is sharding?
Iām trying to build a writing habit by writing here every day about things I learn in web3, blockchain, crypto, etc. If you find errors in my understanding or would just like to talk, it would be most appreciated if youād reach out @_anyasingh