NEAR VISION #4: How NEAR Blockchain works.

In this episode, we will learn how Near blockchain works, what is the Near consensus algorithm and the concept of Near Runtime.

The technology underpinning cryptocurrency. Blockchain is a technology that can safely store transaction records on a peer-to-peer network instead of storing them in a single location. Independent servers around the world, called nodes, make up the network that operates the blockchain.

One of the most defining aspects of blockchain technology is decentralization. So, why is decentralization useful? Let’s look at it from the perspective of developers and end users.

  • Developers: In the centralized world, the developers are often at the mercy of cloud platforms or even the government to make sure that they can continue to run the apps. In the decentralized world, there are no domineering intermediaries.
  • End Users: The transparency of decentralized applications can allow users to see the backend code and know exactly how the apps are going to use your personal information.

Consensus protocols are used to reach agreement on a single value between multiple participants in a system. If all network participants collaborate in accordance with the consensus protocol, new values may be appended to the ledger and verified by nodes. However, in the case of disputes, the network may focus on either safety or liveness.

The consensus mechanism implemented on NEAR is called Nightshade. Nightshade models the system as a single blockchain. The list of all the transactions in each block is split into physical chunks, one chunk per shard. All chunks accumulate to one block. Note that chunks can only be validated by nodes that maintain the state of that shard.

Speaking of validation, a key component of the NEAR are the validators. These validators are responsible for maintaining consensus within the protocol. Validators are specialized nodes that need to keep their servers online 100% of the time while keeping their systems continually updated.

Here are a few points that you must keep in mind about network validators.

  • NEAR determines its network validators every new epoch, electing them based on their stake.
  • The already elected validators are re-enrolled by automatically re-staking their tokens plus the accrued rewards
  • Potential validators have to have their stake above a dynamically determined level.
  • There are two methods that a validator can use to strengthen their stake — buy the tokens themself or borrow via stake delegation.
  • The reward you receive is directly proportional to your stake. More your stake, more your rewards.

The consensus is based on the heaviest chain consensus. Meaning, once a block producer publishes a block, they collect the signatures of validator nodes. The weight of a block is then the cumulative stake of all the signers whose signatures are included in the block. The weight of a chain is the sum of the block weights. Additionally, the consensus utilises a finality gadget that introduces additional slashing conditions for higher chain security.

Runtime layer is used to execute smart contracts and other actions created by the users and preserve the state between the executions. It can be described from three different angles: going step-by-step through various scenarios, describing the components of the runtime, and describing the functions that the runtime performs.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
NEAR insights

Insights, news and information on NEAR Ecosystem, focusing on NEAR Protocol’s Technology