Sharding as a blockchain scaling solution does not work
Imagine if Chase Bank and Citibank required their ledgers to be in sync before committing a new transaction to their database. This is how Ethereum and other account-based blockchains work. In an account-based model, users have a balance of tokens or coins linked to an address or an account.
Take John from the US who lives paycheck to paycheck. On Thursday, John has zero dollars in his bank account at Chase. Tomorrow (a Friday) John gets paid. To use his money, he has to wait for the credit to his account to arrive. From Chase Bank’s perspective, John cannot spend from his account until the balance is positive. John can only buy dinner at a fancy restaurant on Friday night after the credit is cleared at the bank. The credit must be processed before the charge, in order. This is manageable for a private database where only one entity is responsible for maintaining updates to its ledger, but not for an open, public ledger where many parties are constantly writing updates to various accounts.
Ethereum (and other account-based models) must process transactions sequentially. This is why online gas prices rise when there is high demand to use the network. Users bid up fees on top of each other to have their transaction sequentially processed before the other.
To solve this scalability problem, Ethereum developers have proposed sharding (or more commonly known in computer science as multi-threading) to solve this problem. Different nodes process different sets of transactions horizontally across the ledger to increase throughput. However, if we consider the implications when multiple transactions are processed, we can conclude that this solution is akin to kicking the can down the road.
First, given the bank example above, only certain transactions can be processed across shards in parallel, those that don’t update the same account or the state of an object (think a digital pet, or attributes of an in-game weapon). If Shard A tries to process the debit of John’s dinner before Shard B tries to process John’s required credit, the transactions are invalid. Therefore, shards are limited to parallelizing only certain transactions. Second, as demand increases transactions need to be processed, how many shards are enough?
If the demand over the network is 1,000,000 transactions per second, and we have 8 nodes that can process 125,000 each, what happens when one of the nodes cannot handle that volume?
Suddenly, the bottleneck becomes the weakest node on the network that is too slow or crashes due to high demand. If sharding works at 1 million transactions, it might not work at 10 million or 100 million. Sharding is at best a mitigation solution, not a long-term solution. Perhaps this is why the technique has not yet been implemented, but “may be shipped sometime in 2023.”
Contrast this approach with a UTXO-based model where the spending conditions of coins do not depend on another. For example, if I have a $1 and a $5 bill in my pocket, I can spend the $1 without paying attention to the $5 bill. This is the trade-off that Satoshi Nakamoto accepted when designing Bitcoin and one of the fundamental reasons why it scales. Technically, $1 and $5 can be spent in different places at the same time, regardless of order. This is the opposite of John’s case above where transactions must be processed in sequence.
The trade-off, however, is global state which, while useful, does not scale. The state can be calculated independently by off-chain users, for example by summing up the coins associated with a Bitcoin address to get its “state”. However, nodes don’t care or have such a concept of balances, which is why Bitcoin scales horizontally simply by throwing more hardware and resources at the problem.
See: BSV Global Blockchain Convention panel, The Future World with Blockchain
width=”560″ height=”315″ frameborder=”0″ allowfullscreen=”allowfullscreen”>
New to Bitcoin? Check out CoinGeeks Bitcoin for beginners section, the ultimate resource guide for learning more about Bitcoin – as originally envisioned by Satoshi Nakamoto – and blockchain.