NEAR Launches Nightshade Sharding, Paving the Way for Mass Adoption
Today is a momentous day for the NEAR blockchain and the NEAR ecosystem: The launch of Simple Nightshade, the first step toward a fully sharded and secure blockchain.
Since NEAR released the design for the protocol back in 2019, it was always meant to be a sharded blockchain. However, when preparing for the launch in early 2020, we realized that there was no need to launch a completely sharded network.
Sharding is a very complex piece of technology — which we’ll be explaining in detail over the coming weeks on our Medium blog — and the network was brand new. It didn’t need to be capable of handling hundreds of millions of transactions at launch.
Since then, the average number of daily transactions has risen to more than 300k. With the emergence of more and more projects building on NEAR, the number of transactions is only going to increase in the coming months.
While the network is still currently using only 13% of the total capacity, we wanted to start the transition to sharding now to avoid any unpleasant surprises and ensure we can support all the applications on NEAR. Today is the start of that transition.
Below, we’ll briefly discuss how sharding — a partitioning of the NEAR protocol — splits the work of processing transactions across many participating nodes. We’ll also offer some details on why this matters for NEAR’s booming community of developers and users.
Today, the code for phase 0 was successfully deployed to the mainnet — it can take several hours or days for the code to be integrated by all network participants.
This phase, nicknamed Simple Nightshade, will kickstart a year of changes and additions to the NEAR blockchain that when complete, will make it super-fast, incredibly secure, and capable of onboarding millions of users into the world of Web3 without skipping a beat.
In this initial phase, we will shard the state, but not processing — meaning the blockchain will still be validated by all the network’s validators. The state will be split into four shards, significantly increasing the throughput of the network.
In this step, we have built a mechanism to split a shard into multiple parts through live upgrades, which will serve as the foundation for dynamic resharding in the future — more on that later. Meanwhile, because every shard is still validated by all validators, the safety guarantees remain the same.
What does this mean for users?
It means they get the same simple, easy-to-use experience, but with increased speed and performance. One of blockchain’s biggest challenges has been scalability: how does a network grow to handle increased activity without compromising on security? Our solution to that question is Nightshade Sharding.
While there are many new blockchains claiming to have thousands of transactions per second (TPS) and many layer 2 scaling solutions, due to their non-sharded designs, they would all hit an upper limit of what the network could handle eventually.
NEAR’s Nightshade Sharding, on the other hand, allows NEAR Protocol to scale linearly with the number of shards, thereby having the ability to satisfy the demand for transactions as more and more users start to use NEAR. Ultimately it prepares NEAR for mass consumer adoption of billions of users.
What does this mean for developers?
Similar to users, developers will not have to change existing processes in order to take advantage of the increase in speed and scalability.
Thanks to Nightshade’s homogeneous design, developers are not exposed to the details of sharding from the very beginning and they will remain unaffected by this upgrade. More specifically, internally we treat cross-contract calls the same regardless of whether two contracts are on the same shard. Therefore, developers should expect no changes to their experience of developing on NEAR.
What does Nightshade Sharding change about the network’s performance?
While transactions per second are often used as a measure of a network’s speed, there are many other factors that go into how quickly a blockchain can verify a transaction.
At NEAR, network congestion, transaction finality and cost are all parts of the puzzle when it comes to assessing how ‘quick’ a network is. For reference, for token transfers, on one shard we can do 800–1000 TPS and with the upcoming sharding with four shards, we will be able to do a minimum of 2500–3000 TPS.
Ultimately, NEAR’s Nightshade is theoretically limitless (by increasing the number of shards) and can handle millions of transactions per second.
What comes after Phase 0?
Late in 2022, Phase 1 will begin. In this phase, we introduce a new role: chunk-only producers, who only validate one shard. They produce chunks (shard blocks) for some specific shard and only need to run inexpensive hardware, without sacrificing the security of the network.
The introduction of chunk-only producers also helps increase the total number of validators and improve the decentralization of NEAR as a whole. Once this phase is complete, we will have 200–400 validators and only a fraction of them (block producers) need to run more expensive hardware.
Phase 2: Nightshade
In this phase, we finish the implementation of challenges, thereby eliminating the need for any validators to track all the shards. Once this step is completed, both state and processing will be fully sharded. This will also further lower the hardware requirements of running a block producer on NEAR, making the network more accessible for validators. We expect to deliver phase 2 in 2023.
Phase 3: Dynamic Resharding
After phase 2 is complete, we will have a fully functional sharded mainnet with a fixed number of shards. In phase 3, we want to expand on that and create the ability for the network to dynamically split and merge shards based on resource utilization. This will make NEAR almost infinitely scalable and resilient to short-term usage spikes. We expect to deliver phase 3 in 2023.
Eventually, the network itself will dynamically adjust the number of shards based on their utilization and no validators will need to validate all the shards.
Sharding is not the final phase of evolution for NEAR Protocol. Rather, we hope it’s just the beginning. We are simultaneously working on a number of improvements on the protocol level to build a secure, user-friendly, and scalable blockchain that can support mainstream usage and adoption.
An ecosystem primed for growth
In addition to the work on the protocol by NEAR Inc, NEAR Foundation is creating an ecosystem for developers, entrepreneurs, and enterprises to thrive with ambitious funding programs including $800 million worth of global ecosystem funding (now valued at $1.2 billion).
For consumers, we’re making strides forward to make the crypto experience even easier to use. From simple, language-based wallet names, to two-factor authentication, and staking baked right into the wallet.
This is just the beginning of a period of explosive growth at every level. We can’t wait to show you what’s coming next.
Get Started Today
If you’re looking to build on NEAR, check out our developer resources.
If you’re an entrepreneur and want to get started, head for our Founders space.
If you’re looking to create DAOs and Guilds, check out our Community Page.