This article was written by Andrew Wagner, the founder of www.blockchaingaming.com
The concept of sharding predates blockchains. Defined by some experts as “breaking up your big database into much smaller databases that share nothing,” it was intended to fix issues that arose as databases grew too large, such as increased response times when querying for data. It also helped organize data into categories.
Sharding is still used for this purpose, today. Apps like Pinterest utilize it to help reduce the strain of hundreds of millions of monthly users constantly uploading and downloading information. In the gaming world, it might be employed when players from different regions use different servers, or enter different sections of a large virtual world. This can further aid response time by allowing developers to place shards geographically closer to their users, and by removing data unnecessary to their gameplay.
It works for decentralized storage systems, as well. Software pirates reading this might remember helping to upload a file before theirs had finished downloading. This was basically sharding, and a similar technique is applied by emerging decentralized storage systems such as MaidSafe, which have adopted blockchain technology.
The major difference between sharding in centralized versus decentralized databases is that decentralized shards cannot be trusted. Data is stored redundantly in case a node goes offline, and is verified using cryptography to prevent it from being corrupted either intentionally or unintentionally. The blockchain can be used to track content ownership and incentivize network participants, which is the focus of platforms like DCore.
The practice of sharding the blockchain itself is still nascent, however. Forming consensus via proof-of-work, proof of stake, or other protocols has mathematical requirements which make distributing it more complex. Hackers might try to isolate and take over one shard at a time or obstruct communication between them, which must be combatted without the assistance of a server administrator.
The main difference between this process and sidechains is that sidechains are more subordinate: failed sidechains cause no lasting systemic damage to the main network, and may be safely kept or rejected as desired. Sharded blockchains, however, exhibit a property called “tight coupling”: their validity is inseparable from that of their constituent shards, from which they are derived. Losing a shard means the potential loss of crucial entries to the base ledger.
The desire to implement sharding in Ethereum is part of the reason for their community’s drive to switch to proof-of-stake. In Proof-of-work, miners could easily choose which shard they want to compute hashes for, targeting it for what’s called a “1% attack.” In proof-of-stake, randomness is used to help select who gets to validate a block or shard, and can similarly be used to select which shard a validator is responsible for. Targeting is impossible.
The need for communication between shards can be reduced by grouping transactions together strategically. Members of a local community who frequently engage in commerce are one good example of such a group. Decentralized applications are another good example, which includes video games.
Sharding is applicable to many key features of the blockchain gaming industry. Players within a particular token economy are usually interacting with each other when using their chosen cryptocurrency; in a sharding system, cross-shard communication might only be necessary when they engage in exchange across ecosystems. That also includes non-fungible tokens.
Sharding is especially of interest to developers of decentralized MMOs, however, for whom scalability is a notorious issue. Even when exchanging assets with players of other games, it shouldn’t be necessary for them to know your current in-game location, health, mana, etc. You just need to know they have what they’re selling, and all of that extra information adds up to a lot that can bloat your copy of the blockchain.
Platforms like XAYA could also be used to shard individual game worlds, themselves. Daniel Kraft, Lead Blockchain Developer of XAYA, theorized in one scientific paper that game worlds can be broken into shards corresponding to regions of the map. Distant players are typically incapable of interaction, anyway, and therefore won’t effectively require persistent access to each other’s shards.
It might also be actively detrimental for players to have a full copy of the blockchain. It would prevent the implementation of fog of war, an effect simulating the uncertainty of real combat by only allowing vision of nearby areas. This could potentially be a more elegant solution than anonymous cryptocurrencies such as Monero, which store the whole blockchain but use added cryptography to obfuscate it.