Substrate again -Astar Node framework -

Realtakahashi Work
5 min readOct 21, 2023

Introduction

At TOKEN 2049 in Singapore, Astar Network announced that it will develop a new chain at zkEVM. I will not go into the details here, but overall I am in favor of this choice.However, Astar Network is not leaving the Polkadot community, nor is Astar Node, which is implemented using substrate, being shut down.

Certainly the Ethereum community is large and active, and it is amazing to see a community where new components are being developed one after another.However, I have never considered Astar Network’s choice of substrate as an inferior technology. It is precisely because of this kind of timing that I would like to take another look at sustrate. I would like to give an overview in this first installment.

On a recent topic, are you familiar with modular blockchain architecture? My understanding is that it is the latest blockchain architecture. Here is an article in Japanese that may be helpful.

The modular blockchain architecture is the idea of dividing the blockchain into four layers, each consisting of different chains, or components. One of the products supporting one of those four layers, the DA layer, is Avail. This Avail is implemented in substrate.

What Is Substrate

The term that most easily characterizes Substrate is “Polkadot connection”. My guess is that many people think “substate is the framework needed to connect to Polkadot”. That is not a lie. You certainly need to use substrate to connect to Polkadot, but that is not all.

The official documentation describes it as follows.

Substrate is a Software Development Kit (SDK) that uses Rust-based libraries and tools to enable you to build application-specific blockchains from modular and extensible components. Application-specific blockchains that are built with Substrate can run as standalone services or in parallel with other chains to take advantage of the shared security provided by the Polkadot ecosystem. Substrate includes default implementations of the core components of the blockchain infrastructure to allow you to focus on the application logic.

However, if someone who is not familiar with substrate reads this, he or she will naturally not see its advantages. Therefore, I will try to list the good points of substrate as my personal opinion in the next section.

Substrate Goodness

I will not explain here the advantages of the premise of connecting to Polkadot. Therefore, I will not describe the benefits of joining Polkadot, such as interoperability, XCM, shared security, etc.

Attachment and detachment of functions by Pallet

The following diagram is based on my understanding and may not be accurate. Nevertheless, I believe I have succeeded in representing the characteristics of the substrate I wish to describe here.

substrate is compositionally decoupled from the core module of node and each of the other functions. Many functions do not exist in the core module, but are implemented by pallets. For example, the smart contract execution engine, consensus engine, account management, and other functions are implemented by pallets.

Therefore, it is easy to separate the execution layer in substrate. It is also possible to implement your own consensus layer. It is also easy to add other unique features to the chain.

Tutorials for adding a pallet or developing and adding your own pallet exist on the official Substrate website. I will introduce the specific contents of these in the next and subsequent articles.

Forkless Upgrade

I want you to look at the figure I posted earlier one more time. Once again, this diagram is not accurate: substrate holds the runtime module as a state of the blockchain. Therefore, it does not require fork to update the functionality implemented in the pallet. You can update the functionality of a blockchain node by executing a transaction. This is a great thing.

A tutorial is also available on this forkless upgrade. I will introduce this tutorial in the next issue.

Off-Chain Worker

I want you to look at the following figure. The following figure is from substrate’s official website as an explanation of off-chain workers. For example, when we try to implement our own blockchain using geth, what should we do when we want to handle off-chain data? Maybe it’s because I’m not familiar with geth, but I honestly don’t have the confidence to safely integrate this logic into geth. Another approach might be to consider using smart contracts like Chainlink to input external data.

Substrate provides a function from the beginning to incorporate these off-chain data into the node.

https://docs.substrate.io/learn/offchain-operations/
https://docs.substrate.io/learn/offchain-operations/

Offchain workers run in their own Wasm execution environment outside of the Substrate runtime. This separation of concerns makes sure that block production is not impacted by long-running offchain tasks. However, because offchain workers are declared in the same code as the runtime, they can easily access on-chain state for their computations.

The above is a quotation from the official website, but it is a simple description of the advantages of off-chain workers.
There is also a tutorial on off-chain worker, which we will introduce in the future.

Other

There are others that I would like to introduce, but I will not discuss other features in this article for the purpose of highlighting only those areas that I particularly like. If you are interested, please check out the official website.

Next Step

In my next article, I would like to present the tutorials listed in this issue in a step-by-step guide in order.

I discovered Avail while checking out a modular blockchain architecture that has been getting a lot of attention lately, and learned that it is implemented using substrate. I believe it proves that substrate is still ahead of its time. And although the polkadot community seems to be facing many problems at the moment, I hope that they will overcome these problems and further develop the technology to open a new era.

About Astar Network

https://astar.network/

--

--