paint-brush
ZKSwap Tech Review: SKALE – An Elastic, Decentralized Sidechain Network by@zkbase
266 reads

ZKSwap Tech Review: SKALE – An Elastic, Decentralized Sidechain Network

by ZKBaseAugust 24th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

SKALE Network is positioned as the "elastic sidechain network" of Ethereum, capable of supporting thousands of independent blockchains, sidechains, storage chains, and other types of subchains. The network adopts Solidity as the programming language for smart contracts. The operating model is fully compatible with EVM and supports the mainstream Ethereum token standard. The SKALE administrator contract acts as an "entrance", which undertakes tasks such as the creation and destruction of nodes. The peer node will periodically review the downtime and delay of the node to determine the rewards issued to the network.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail

Coins Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - ZKSwap Tech Review: SKALE – An Elastic, Decentralized Sidechain Network
ZKBase HackerNoon profile picture

Background

What is a sidechain? According to Barry Whitehat, who proposed the concept of Rollup, a sidechain is a group of verifiers that submits the latest state of a chain to a smart contract (on the mainchain), which is a type of system that advances in this way.


These checkpoints that monitor the latest status of a blockchain can be used by a Bridge Contract to support user deposits and withdrawals. Generally speaking, there will also be a leader election process among the group of verifiers to determine who will create the sidechain block at a certain moment, such as the Proof of Authority (PoA) algorithm and the Proof of Staking (PoS) algorithm.


Barry also mentioned that with the maturity of some Layer 2 scaling solutions, it is possible to consider how the sidechain can be better integrated with other solutions. On some specific occasions, the characteristics of the sidechain can yield unusually brilliant results.

At present, mainstream sidechain solutions mainly include Polygon (formerly Matic Network), xDai Stable Chain, and SKALE Network. This article will sort out SKALE's technical solutions, extension packages, IMA cross-chain bridge, SKALE token and governance, and SKALE ecological development as well as investment and financing.

Introduction to SKALE NETWORK

The SKALE network is positioned as the "elastic sidechain network" of Ethereum, capable of supporting thousands of independent blockchains, sidechains, storage chains, and other types of subchains. These blockchains are all connected to the Ethereum mainnet and are fully compatible with the Ethereum ecosystem.


The sidechain on the SKALE network is operated by a set of virtualized subnodes selected from a set of network nodes. Each sidechain is highly configurable, and users can freely choose sidechain specifications, consensus protocols, virtual machines, parent chains, and customized security measures.

The SKALE network adopts Solidity as the programming language for smart contracts. The operating model is fully compatible with EVM and supports the mainstream Ethereum token standard. It can also connect to the network through web3.js and web3.py, and use Truffle and Remix tools to achieve a developer-friendly environment.


SKALE Network Structure

Image Source: SKALE Network Whitepaper

The SKALE network is comprised of two parts: the SKALE node and the SKALE administrator, of which the SKALE administrator is a smart contract deployed on the Ethereum mainnet.


The SKALE administrator contract acts as an "entrance", which undertakes tasks such as the creation and destruction of nodes, the creation and destruction of elastic sidechains, the rotation of virtualized subnodes, and the distribution of SKALE rewards.

Image Source: SKALE Network Whitepaper

Among them, the virtualized subnode is a participant of the elastic sidechain, responsible for executing the SKALE consensus, running the SKALE EVM, and promoting inter-chain communication.

Node Creation and Destruction on SKALE NETWORK

The following steps are necessary to transform potential nodes into SKALE network nodes:


(1) Run the SKALE background program first, and it will evaluate whether the potential node meets the hardware requirements of the network;


(2) If the evaluation is passed, the potential node can submit an application to the SKALE administrator to join the network. To submit an application, you need to pledge a network deposit and provide node metadata such as its IP address, port, and public key;


(3) After submission, potential nodes join the system and are called "full nodes" or "light nodes". (The difference between the two types of nodes is: full nodes provide all resources for a certain elastic sidechain, while light nodes participate in multiple elastic sidechains.)


When a node is created, the SKALE network will distribute a set of peer nodes (currently 24). The peer node will periodically review the downtime and delay of the node to determine the rewards issued to the node in each network cycle.


If a node wants to be disconnected from the network, it needs to broadcast an exit message to the network first and wait for a period of termination. Afterward, the node can get back its pledged network security deposit.

Creation and Destruction of Elastic Sidechains on SKALE NETWORK

One of the innovative ideas on SKALE is its customizable "elastic sidechain". "Elasticity" means that the blockchain is not fixed, users can follow their needs according to 1/128(small), 1/16(medium), or 1/1 (large) node resources and 3, 6, and the 12-month duration option as well as the storage capacity of the network to select the configuration of the blockchain, combining with the use of SKALE tokens to pay the corresponding rent.


Currently, the cost of resources consumed in the SKALE network depends on the specifications and life cycle of the chain and will be dynamically calculated in the future based on current network conditions and system load.


After the user submits the application to the SKALE administrator, a new elastic sidechain is created correspondingly.

Image Source: SKALE Network Whitepaper

If the rent paid by the user has been consumed or the user deletes his elastic sidechain, the elastic sidechain will be destructed on this occasion.

Furthermore, users can also rotate the virtualized subnodes to avoid collusion and ensure the decentralization of the elastic sidechain.


As a whole, the creation and destruction of SKALE's elastic sidechain are similar to our usual model of renting cloud servers, which means selecting resources on-demand and paying for resources. After the rent is consumed, the user can choose to either renew or delete the server (that is, the elastic sidechain).


Just as Docker and Kubernetes allow easily customized and scalable cloud services, SKALE's vision is to provide decentralized "chain services".


SKALE Reward Distribution

After the termination of each SKALE network cycle, the SKALE tokens released during that period will be equally distributed to all nodes participating in the network before the beginning of the cycle.


The number of tokens allocated to each node depends on the average indicators submitted by 16 of its 24 peer nodes (excluding the highest and lowest 4 indicators). Tokens not distributed to nodes due to insufficient running time or delay will flow to the N.O.D.E Foundation.


Elastic Sidechain and Consensus Process The elastic sidechain is composed of virtualized subnodes in the SKALE network. These virtualized subnodes participate in the creation and confirmation of blocks by an asynchronous, leaderless and provable security protocol. As long as over 2/3 of the virtualized subnodes verification set is online, they will continue to create and confirm new blocks on the chain. The consensus process of SKALE is shown in the figure:

Image Source: SKALE Network Whitepaper

Block Proposal on SKALE NETWORK

Virtualized subnodes need to follow the following principles to create a block proposal:


(1) Check the pending transaction list;

(2) If the transaction size in the pending list is less than or equal to MAX-BLOCK-SIZE, the virtualized subnode will take out all the transactions and add them to the block proposal;

(3) If the transaction size in the pending list is greater than MAX-BLOCK-SIZE, the virtualized subnode will take out the pending transactions in the order of receipt and add them to the MAX-BLOCK-SIZE block proposal;

(4) Afterwards, according to the transactions sorted by the SHA-256 root node from minimum to maximum, the virtualized subnodes collect block proposals.

(5) If the pending list is empty, the virtualized subnode will wait for a BEACON_TIME. If the list is still empty afterward, then a block proposal that does not contain any transactions will be created.


After a virtualized subnode creates a block proposal, it will notify other virtualized subnodes according to the data availability protocol. The data availability protocol ensures that information can be delivered to most virtualized subnodes.


Consensus and Rounds on SKALE NETWORK

The consensus on the block proposal adopts the Asynchronous Binary Byzantine Agreement (ABBA). Currently, SKALE employs a variant of the ABBA derived from Mostefaoui et al.

After the proposal phase is over, each virtualized subnode


A that receives most of the signatures of proposal P will immediately vote for ABBA in a consensus round R. The agreement is as follows:


(1) For each round of R, the virtualized subnode will execute ABBA instances of number N;

(2) Each ABBA [i] is equivalent to a vote of the virtualized subnode I in the block proposal;

(3) Each ABBA [i] ends the consensus voting with a "yes" or "no";

(4) After all ABBA [i] is over, a voting vector v[i] will be generated, which includes the "yes" or "no" of each proposal;

(5) If there is only one vote for "yes", the related block proposal P will be submitted to the elastic sidechain;

(6) If there are multiple votes for "yes", the pseudo-random number R will be used to select P from the "yes" voting proposal pseudo-randomly. The selected proposals index the remaining part of R divided by N-WIN, where N-WIN is the total number of "yes" proposals;

(7) The random number R is the sum of all COMMON-COINs (a source of random numbers) in ABBA.

(8) If all votes are "No", then submit an empty block to the blockchain. The probability that all votes are "No" is quite low, and decreases as N increases.


Once the consensus successfully selects block P on any virtualized subnode A, the virtualized subnode will execute the following algorithm to determine the proposal and submit it to the blockchain.


(1) A will check whether it has received the selected proposal P;

(2) If A does not receive the proposal, it will apply to its equivalent virtualized subnode for downloading;

(3) A will sign a signature fragment S to P, and then send it to all other virtualized subnodes;

(4) A will wait to receive signature fragments from most virtualized subnodes including itself;

(5) Once A receives most of the signature fragments, it will combine them into a threshold signature;

(6) Finally, A submits P to the blockchain together with the threshold signature S.


Additionally, the containerized structure of SKALE also provides enterprise-level performance and options for dApp developers, aiming to achieve the same level of flexibility, configurability, and modularity of the centralized system, providing SKALE management services, node monitoring services, virtualized subnode deploy services, and integrate a series of emergency strategies and failure recovery plans to cope with emergency situations such as network attacks and failures.

Extensions on SKALE NETWORK

SKALE has developed two extension packages: file storage and interchain communication.


File Storage

Image Source: SKALE Network Blog

The file storage of the SKALE network relies on its built-in data availability protocol, which ensures the data is stored on at least 2/3 of the virtualized subnodes of each elastic sidechain.


The fileStorage.js is an npm package, and users can integrate SKALE FileStorage into their dApp with just a few lines of code.


Moreover, by calling uplodaFile, downloadFileIntoBrowser/downloadFileIntoBuffer, and deleteFile methods to upload, download and delete files, SKALE network users can divide files into 1MB "chunks", submit them to the fileStorage smart contract, and store them in the file system of each node in a continuous manner.

Interchain Communication on SKALE NETWORK

Image Source: SKALE Network Whitepaper

The SKALE network employs BLS (Boneh-Lynn-Shacham) threshold signatures. The BLS signature algorithm is an algorithm that can realize signature aggregation and key aggregation (that is, multiple keys can be aggregated into one key, and multiple signatures can be aggregated into one signature), which can avoid unnecessary communication between signers.


Each elastic sidechain in the SKALE network supports the signature, thereby achieving fast and secure inter-chain communication.


That is, an independent elastic sidechain in the SKALE network can verify the block signed and submitted by another elastic sidechain so that the SKALE network can realize the execution of smart contracts and the conversion of encrypted assets between the elastic sidechains.

IMA Cross-chain Bridge on SKALE NETWORK

Image Source: SKALE Network Blog

SKALE launched the IMA (Interchain Messaging Agent) cross-chain bridge in July this year, allowing users to transfer digital assets supporting mainstream ERC standards and general message data between Ethereum and any SKALE chain.


If the user needs to transfer assets from Ethereum to the SKALE network, the IMA cross-chain bridge will deposit the assets on Ethereum into the Deposit Box contract and wait for the confirmation of 10 Ethereum blocks.


Then the IMA cross-chain bridge will send a transfer request to an agent called “SKALE IMA Agent”, which will call SKALE TokenManager running in the SKALE network by turns to process the transfer in their respective SKALE chain.


If there is a need to transfer assets from the SKALE chain to Ethereum, the tokens will be burned on the SKALE chain and unlocked on the Ethereum mainnet. If the token to be transferred is minted on the SKALE chain, it will be minted on Ethereum as part of the transfer to retain the ownership of the token.

SKALE Token and Governance on SKALE NETWORK


SKALE Token represents the right to participate in the network as a verification node, or as a part of the resources obtained by developers deploying and renting flexible sidechains for a certain period of time.


(1) In the form of an elastic sidechain, users rent (computing, storage, and bandwidth) resources by a subscription model for a predetermined period of time.

(2) The verification node pledges SKALE tokens to the network and then obtains the right to operate the node and earn transaction fees and inflation passes.


Generally speaking, the SKALE governance adopts a delegated pledge model, that is, stakeholders can directly participate in governance by pledging stocks or delegate their voting right to other stakeholders.


The default voting model adopted by SKALE is a simple majority vote. Proposals usually include a 14-day voting phase. SKALE tokens that have been "loyal and formally pledged" for more than 90 days are eligible to vote on crucial issues raised by the SKALE committee.

Ecological Development, Investment, and Financing on SKALE NETWORK

SKALE launched the first phase of its mainnet in June last year; in May this year, after completing the Denali upgrade, SKALE announced that its upgraded mainnet was officially launched. This upgrade introduces multiple chains to Ethereum and introduces a modular framework for the SKALE network, allowing it to include local and third-party chain services, including file storage, inter-chain messaging, Oracles, Rollups, etc.


Meanwhile, the upgrade introduces high-performance App-specific, which means that each dApp and protocol can run on their own EVM compatible chains, which are isolated from other network traffic but will inherit the security of the Ethereum mainnet.

Image Source: SKALE Network Blog

At the end of July this year, SKALE announced the first batch of dApps running on the SKALE mainnet, including Boot.Finance (decentralized liquidity protocol), Covey(portfolio sharing application), CurioDAO (real asset tokenization platform), Human Protocol (decentralized labor market framework), Ivy (NFT and token transaction protocol), and Minds (decentralized social network platform).


In addition, according to SKALE official news, apart from the dApps that have joined the SKALE Innovator program and are building on the platform, SKALE has also established cooperative relationships with over 40 partners and verifiers.


SKALE network is supported by the world's top Validators platforms, including 01NODE, Ankr, Anonstake, Audit One, Blockdaemon, Blockware, Chainflow, Chainode, Chorus One, Cypher Core, Dokia Capital, Figment Networks, FreshSkale, Hashed x DELIGHT, Hasquark, Staked, Stakin, StakedWithUs, WolfEdge Capital, and Staking Facilities. At present, the SKALE network has 48 validators and 160 nodes in operation.


As for financing, SKALE Labs announced as early as October 2019 that it had raised a total of US$17.1 million in financing, and obtained support from over 40 angel investors and venture capital institutions such as Arrington XRP Capital, Blockchange, ConsenSys Labs, Hashed, HashKey, Multicoin Capital, Recruit Holdings, etc.


Conclusion

Compared with popular Rollup-based scaling protocols and the sidechain projects such as Polygon and xDai, SKALE seems to be a little uninterested. As an established project that started operation in 2017, SKALE has made a series of ecological progress after the Denalis upgrade, such as launching the first batch of dApps, establishing partnerships with other projects and verifier platforms, etc. With the implementation of different scaling schemes, SKALE's years of accumulation have offered itself a relatively stable advantage, but it still needs to catch up in ecological construction.


References

[1] SKALE Network Whitepaper

[2] SKALE Network Blog