Polkadot Smart Contract Platform Gear: The Road to Parallel Architecture Public Chain
Gear supports parallel execution of different transactions and asynchronization of smart contract programming and execution, which can significantly speed up program operation.
In November 2021, as Polkadot mainnet officially launched the auction of parallel chain slots, its ecosystem suddenly became a dazzling new force. The idea of multi-chain connectivity advocated by its founder Gavin Wood has brought a lot of imagination to the blockchain field, while also making Polkadot Eco-projects, including Acala, Moonbeam, Astar and others, went viral.
Gear is one of the relatively underrated projects in the Polkadot ecosystem. As a Polkadot smart contract platform, Gear technology supports asynchronous programming and parallel computing, WASM virtual machine, and Gear is said to run much faster than traditional EVM chain, with TPS much higher than Ethereum, BSC, Polygon and other EVM public chains. Gear CEO Nikolay Volf also made it clear that Gear will support DApp developers to deploy smart contracts using Rust, C, C++ and other mainstream development languages, and launch templates and libraries suitable for different applications, so that developers can easily deploy DApps by modifying some parameters, and enhance compatibility as much as possible.
In addition, Gear CEO Nikolay Volf previously worked as a core developer at Polkadot’s parent company Parity Technologies, where he participated in the development of the Parity Ethereum client and Substrate framework and worked with Polkadot founder Gavin Wood for six years.
Following, ChainCatcher&CatcherVC will give an in-depth explanation of Gear project from the perspective of application scenarios, team members, technical solutions, competitor analysis, strengths and weaknesses analysis, etc.
1. Introduction of Gear
1.1 Application Scenarios
Gear is the smart contract platform of Polkadot-Kusama ecology, which will become a parallel chain of Polkadot in the future. Since Polkadot relay chain itself does not support DApp contract deployment, developers who want to enter Polkadot network often have to deploy contract code on a parallel chain or build and launch a blockchain by themselves to access Polkadot network. The latter requires pledging a large amount of DOT tokens to participate in slot bidding, which is costly, so the vast majority of developers will deploy their DApp programs on a suitable parallel chain.
As a parallel chain, Gear serves as a platform for multiple categories of DApps including DeFi, DAO, NFT, and supply chain management systems, providing developers with a variety of infrastructure, enabling out-of-the-box creation processes, and enabling the DApps it carries to be secured by the Polkadot relay chain. At the same time, if the proposed parallel task processing mechanism is successfully put into use, it can run faster than other parallel chains of Polkadot, and thus become the best entrance to Polkadot ecosystem. In essence, Gear is positioned as a new public link.
1.2 Team Members
Nikolay Volf is the co-founder and CEO of Gear. He has been a core developer at Parity Technologies, Polkadot’s parent company, since 2015 and has worked with Polkadot founder Gavin Wood for six years. While at Parity, Volf was involved in the development of Parity’s Ethereum client and Substrate framework, and led the initial implementation of WASM smart contracts.
Ilya Veller is the co-founder and CFO of Gear. He has worked with hedge funds and high net worth individuals globally for more than 20 years with Renaissance Capital, Morgan Stanley and Bank of America. Over the past 20 years, Ilya Veller has raised over $1 billion in capital for various projects.
Alexander Bugorkov is the co-founder and CBDO of Gear and has experience working at leading technology companies such as Lyft, New Relic and Spotify.
Petr Volynskiy is the CTO of Gear and has extensive experience in product development and technical leadership in multiple domains. His areas of involvement include application development for project and business process management, system architecture, cross-platform development environments, web and mobile applications, operating systems, virtualization and cloud (SaaS, IaaS, PaaS).
1.3 Project Progress
In August 2021, the Gear project officially unveiled the project.
In September 2021, the Gear project team unveiled its GitHub codebase and completed its test network node configuration.
In November 2021, Gear restructured its standard library.
In December 2021, Gear closed a $12 million private funding round led by Blockchange Ventures, with participation from Three Arrows Capital, Web3 Foundation, Parity Technologies, Lemniscap, Distributed Globals, LAO, Mechanism Capital, Bitscale, Spartan Group LLC, HashKey, etc.
In February 2022, Gear officially announced that a whitepaper will be written in March, or that a test network will be released in the near future, with plans to launch the main network in 2022.
2. Technical solution interpretation
2.1 WASM VM
To improve on the node VM and development language level, EOS, NEAR and Substrate frameworks, and Polkadot relay chain nodes all use WASM VM, as does Gear. Unlike the EVM and Solidity languages, WASM (WebAssembly) has been developed for years by top technology companies such as Google, Microsoft, and W3C, and was adopted by the four major web browsers such as Firefox, Chrome, Microsoft Edge, and Safari in November 2017.
Compared to EVM, WASM VM has been in development for a long time in terms of standardization efforts, comes with a more complete and compatible instruction set with most modern hardware architectures (for interacting with hardware devices), and can compile high-level languages such as Rust, C, and C++ into machine code that runs at near-native speeds. In theory, WASM is up to 10 times faster than EVM, according to Gear’s CEO.
With support for compiling Rust and mainstream languages such as C and C++, the adoption of the WASM VM allows Gear-based smart contract development to support a wider audience and more traditional programming languages (such as C and C++), facilitating the introduction of programmers from traditional IT industries into the blockchain and Web3 domains. Combined with features found in traditional computing environments such as parallel computing, the Gear overall will be closer to a traditional computing environment than Ethereum, those that use EVM, and other new public chains that don’t support parallelism.
2.2Parallel task processing and asynchronous programming patterns
One of the major bottlenecks limiting the TPS of current public chains is that most public chains (EVM-based public chains such as Ether, BSC and Polygon) use Single threaded processes mode, which greatly limits the possibility of scaling the blockchain network at the time level.
Unlike most public chains, Gear has made a big change in technical architecture. In its technical documentation, it explicitly states that Gear network nodes will support “parallel processing” and “asynchronous programming”, and it adopts “parallel processing streams”, “Message passing communication”, “Actor communication model” and “async/await support”.
Theoretically speaking, these features can make Gear’s TPS several orders of magnitude higher than that of average public chains.
The interaction model of “Actor communication model” adopted by Gear treats each transaction as a “message” passed between different users. This interaction model has been widely adopted in the traditional computer domain, and message passing concurrency has better performance characteristics than shared memory.
At the same time, Gear node VM architecture allows to creation of the “event streams” according to the number of CPU cores. For example, if the CPU has two cores, two streams can be created, and the transaction events can be packaged into two different event streams and sent to two different CPU cores for execution. If there are 100 events to be processed, and there is only one event stream, it will take 100 seconds for a single core to execute it; if two event streams are created, each containing 50 events, and they are executed by two cores, it will only take 50 seconds. Theoretically, adopting this multi-core parallel mode can reduce the processing time.
Scenarios, where multiple transaction events are running at the same time, can induce conflicts. For example, if event A and event B are executed by different CPU cores at the same time, but the contract address for both events is C, then event A and event B will affect each other and may result in a “double payment”.
To avoid this issue, the Gear solution is to put A and B into the same “event stream” and have the same CPU core execute them sequentially, thus solving the shared resource problem.
In this way, Gear nodes can support multithreading and solve the problem of events being related and conflicting with each other. In this form, Gear can be dramatically more efficient.
These are the improvements to the Gear transaction event processing mode. But a transaction event can be broken down into multiple steps, or calls to multiple contract programs. Therefore, in order to streamline the structure and improve efficiency, Gear is also looking for ways to speed up the execution of smart contract code and improve the programming experience of developers. To that end, the Gear supports an “asynchronous programming” mode.
In the traditional programming model, code is executed in a “synchronous” sequence from top to bottom line, with the first line of code executed before the next line of code is executed in a strict order. This mode has disadvantages, such as calling a command function (printf in the figure below) and waiting for the command to finish executing. If the command is not executed for a long time, the following code must wait in line, which delays the execution of the entire program. This will undoubtedly reduce the TPS of the system.
To this end, the Gear uses the “asynchronous programming” mode, where the smart contract can execute multiple commands, rather than being in a “wait” state. Previously executed command functions can return response results in the future. For example, a smart contract on Gear contains instructions to call multiple other contracts (A, B, C) in a code segment. In traditional “synchronous” mode, B is called after A is called, and C is called after B. In the asynchronous mode, contracts A, B, and C are invoked at the same time in the same period without waiting for the completion of the invocation process. In this way, the execution time of the contract code is shortened. In essence, “asynchronous programming” means having different code instructions for smart contracts “execute concurrently.”
As mentioned earlier, Gear improves efficiency by enabling “parallel computing” and “asynchronous programming” to process multiple transaction events at the same time, but this brings other pitfalls. For example, user A initiates A transaction and invokes the on-chain program B; When executing, B calls programs C and D, and programs C and D call the same program E; In the “parallel” and “asynchronous” modes, if C and D are executed at the same time, E will be called at the same time, resulting in resource scheduling conflicts and chaos.
In this case, the callers (contracts) must have a definite sequence, and Gear uses the Actor model to solve this problem.
The Actor model was put forward in 1973. It is a logic model supporting concurrency. It was originally developed for a highly parallel computer composed of a large number of independent microprocessors, and has been widely used in traditional computer programming. In the application scenario of blockchain, the Actor model classifies different smart contracts into different Actor entities. Each Actor entity has its own mailbox, which receives relevant transaction events in sequence, and then changes its data state in accordance with the sequence of events. Each Actor entity handles only one event at a time, which eliminates shared state and prevents multiple events from affecting the Actor entity at the same time. Meanwhile, different Actor entities can send messages to each other to call each other, which corresponds to the scenario of contracts calling each other on the blockchain.
Actor entities are smart contracts that add their own “transaction event queue.” As mentioned above, in the case that contracts C and D, both of which are running at the same time, call request of C and D will be put into the mailbox message queue of contract E in sequence according to the initiating time (which may be very close, but distinguishable enough). E then executes the call requests from C and D in order (for example, C first and D later), thus resolving the conflict. The Actor logical model fits the characteristics of smart contracts (with its own state and storage space).
By using the Actor model, Gear developers can conduct “asynchronously program” and “asynchronously execute” code instructions in smart contract development. Building on this, the Gear can support asynchronous programming features native to the Rust language, such as Futures and key grammars async/await, which have long been out of the Solidity language. Asynchronous programming will dramatically change the paradigm of writing smart contract code and make it easier for developers.
To sum up, by combining the two most important unique features of “parallel processing” and “asynchronous programming”, Gear can process transaction events faster and run on-chain programs faster than traditional public chains, resulting in a significant INCREASE in TPS.
3. Competitor Analysis
Since Gear itself is positioned as Polkadot Parallel chain, its competitive products are other Parallel chains of Polkadot ecosystem, such as Moonbeam, Astar, Acala, Parallel, Clover, etc. This article will focus on comparing information about these parallel chains.
Moonbeam is an EVM compatible chain on Polkadot, positioned as an Ethereum-compatible Polkadot smart contract platform. With its EVM compatibility, developers are able to deploy existing Solidity smart contracts and DApps to Moonbeam with minimal changes. Moonbeam interconnects with the relay chain, enabling intercommunication across the Polkadot ecosystem.
Moonbeam’s development team, Purstake, was founded by Derek Yoo, an American who spent 12 years as a CTO at office social software company Fuze. Purstake was founded by Derek Yoo in May 2019. The company has been involved in Substrate Framework development, mainly responsible for the Frontier module.
In September 2020, Moonbeam development team PureStake raised a $1.4 million seed round led by Hypersphere Ventures. In March 2021, it completed a $6 million strategic round led by CoinFund, with participation from Binance Labs, IOSG Ventures, ParaFi, Coinbase Ventures, Fenbushi Investment Management, and others.
Currently, native protocols on the Moonbeam chain mainly include: DEX platform, such as StellaSwap, BeamSwap, Zenlink, etc. Yield class items like Pickle and Astral Financial; Options AMM: Polkamarkets; Cross-chain Bridges: cBridge and Connext.
As of Feb. 15, Moonbeam TVL was worth approximately $180 million, with StellaSwap holding 45.74%. Kusama’s Pioneering network Moonriver has over $210 million in total lock-ups.
Moonbeam’s on-chain figures are as follows: The platform has handled more than 1.05 million transfers, and GLMR has more than 100,000 addresses in Polkadot ecosystem.
Astar is positioned as a multi-chain, multi-VM smart contract platform that supports both EVM and WASM VM, extending beyond the Solidity ecosystem while supporting original Ethereum DApp developers.
Astar, meanwhile, has unique “DApp Staking” incentives, in which 50% of each block reward is distributed to DApp project developers and nominees, and 50% to PoS Staking, in order to attract DApp deployment. This mechanism is designed to give developers a clearer long-term revenue path and increase their motivation.
Astar currently develops to support Ethereum, BSC, Polygon, Avalanche, Dfinity, Cosmos and more. It also supports the Layer2 ecosystem and has implemented OVM solutions that help the Layer2 network to transfer assets and interact with information. In line with its vision, Astar aims to become a smart contract platform that encompasses a variety of complex development environments and supports multiple types of DApps.
Astar’s development company, Stake Technologies, was founded in Japan in 2018 by Sota Watanabe, who owns resources in the Japanese Internet industry. In 2021, Astar Ecosystem was powered by Microsoft For Startups, with support from Microsoft services like Azure and infrastructure like Microsoft Global Networks.
Astar has received 3 rounds of financing in the past year, with a total amount of $34.4 million raised by investors including Binance Labs, Polychain Capital, HashKey Capital, Alameda Research, etc.
Astar officially launched its mainnet in January, with on-chain contracts including DEX platforms: ArthSwap, PolkaEx and cBridge. As of February 15th, Astar TVL was worth about $480 million. Staked in Astar dApps Staking is $440 million, or 90.57% of Astar. Astar’s Shiden on Kusama has a total lock-up of about $15 million.
Astar’s on-chain data is roughly as follows. Currently, the platform has handled nearly 650,000 transfers, and its token ASTR has about 60,000 token-holding addresses in Polkadot Ecology
Acala is positioned to serve the underlying infrastructure of the PolkadotDeFi ecosystem, supporting both EVM and WASM VM, and has built a complete DeFi application for the user, including the stablecoin system for mortgage lending, the release of pledged asset liquidity protocol, and the core infrastructure of DEX. Because of its EVM support, Acala offers developers modules that are compatible with Ethereum smart contracts. A series of DeFi components are available out of the box to help developers build applications such as NFT and DEX on top of the Acala application layer.
The Acala development team was launched by the Laminar and Polkawallet teams for decentralized finance protocols, with some members from the Web3 Foundation. The team’s CEO is Ruitao Su, who graduated from the University of Auckland and was previously the CTO of Centrality. CTO is Bryan Chen, a graduate of the University of Auckland, a major contributor to Substrate codebar and Polkadot Ambassador; COO is Bette Chen, who graduated from the University of Auckland and is responsible for blockchain protocol and DApp product development.
Acala completed $1.5 million seed round financing in March 2020, with Polychain leading the investment and Hashkey, KR1 and other investors participating. In August of the same year, Acala completed $7 million series A financing, led by Pantera Capital, with the participation from ParaFi Capital, 1Confirmation, Arrington XRP Capital, Coinfund, DCG and other investors. In March 2021, Acala received an undisclosed investment from Coinbase Ventures.
Acala launched the money transfer function in January this year and launched the Million ACA rewards program on February 10 to spur the development of Acala Swap, its on-chain DEX platform. As of February 15, Acala’s total Karura lock-up on Kusama was about $45 million.
The on-chain numbers for Acala are rough as follows. Currently, the platform has handled nearly 490,000 transfers and ACA has 140,000 holding addresses in the Polkadot ecosystem.
3.4 Parallel Finance
Parallel Finance is positioned as a DeFi Parallel chain, incorporating various DeFi products. A service using WASM VM, Leverage Staking is now in Heiko, allowing users to lend out assets pledged in return for interest on both the collateral and the loan. Parallel — Heiko also supports Auction Loans, allowing users to lend their DOT or KSM to slot Auction participants at fixed or variable interest rates or depending on the amount of project borrowing.
Parallel Finance was launched around April 2021 by Yubo Ruan, founder of 8 Decimal Captial, and other members of the team with backgrounds from Facebook, JPMorgan, Sushi, TrueFi, Mina, etc.
Last year, Parallel Finance completed three rounds of financing, totalling between $20 million and $30 million, led by Polychain Capital, with participation from Slow Ventures, Lightspeed Venture Partners, Blockchain Capital and Alameda Research, Pantera Capital, Sequoia Capital and Founders Fund, etc.
At present, Parallel Finance TVL is about $600 million, basically focusing on its slot auction crowdlending business segment.
The data on the Parallel Finance chain is rough as follows. At present, the platform has processed nearly 40,000 transfers, and the number of token holding addresses of PARA in Polkadot ecosystem has reached about 30,000.
Clover Finance positions itself as the EVM compliant chain of the Polkadot ecosystem, creating a one-stop EVM compliant framework for Substrate based applications to reduce barriers and costs for developers. Evm-linked projects like Ethereum and BSC can simply migrate smart contracts to Clover.
In response to ethereum’s high Gas fees, Clover will collect transaction fees for each transaction and users won’t have to store additional tokens dedicated to paying for gas, significantly lowering the barrier to entry for users. Clover also resets the gas allocation parameters and sends gas fees directly to network maintenance and DApp developers, creating passive income for smart contract developers.
Clover project began in November 2020. Project leader and co-founder Viven Kirby was previously the technical lead and architect for ERP software development at Microsoft, as well as the core developer of many blockchain projects. Burak Keceli, technical lead and co-founder, was previously the technical lead of payment product GatePay and founder of cross-border payment product Staqq. Norelle Ng, Head of Operations and co-founder, is a former partner at Bithumb Global and Head of Client Relations at Amber Group.
In February 2021, Clover Finance closed a $3 million seed round led by Polychain, Hypersphere, Bithumb Global, and Divergence Ventures. In May 2021, Clover Finance was invested by Huobi Innovation Lab.
The on-chain data of Clover Finance is as follows. At present, the platform has processed 36 transfers, and the number of CLV’s holding addresses in Polkadot is 32.
4. Advantages and Disadvantages
Through the above elaboration and analysis, Gear has the following advantages and disadvantages:
It supports a more full-featured, faster WASM VM and supports mainstream languages such as Rust and C/C++.
It supports the parallel execution of different transaction events and the asynchronization of smart contract programming and execution, which can greatly accelerate the running speed of programs and make the TPS order of magnitude much higher than public chain using EVM. Compared to Solana, Gear is secured by the Polkadot relay chain.
Performance and architecture are closer to a traditional computer environment than most public chains, especially those that use EVM;
The founder and CEO of the project have a background at Parity Technologies, Polkadot’s parent company, and are close to Gavin Wood, Polkadot’s founder. Early on, the project was funded by Web3 Foundation, Parity Technologies and Three Arrows Capital.
Due to the parallel architecture and asynchronous programming that is difficult to implement, the potential complexity is related to the deterministic state of the blockchain, but different nodes have different numbers of CPU cores and need to be overcome by developing special cutting-edge algorithms. The difficulty of development is not to be underestimated.
Even with the most meticulous and thoughtful design, the parallel processing model can be buggy over the long run. In 2018, EOS founder BM said of parallelism, which is described in the EOS whitepaper and is hard to implement: “Anyone who can solve this problem must have prior experience in developing at least three blockchain systems.” In addition, Solana has proposed a “Sealevel” technology solution to support parallel architecture, but it has not been implemented.
The Gear has yet to launch its testnet, and it may still be a long time before the mainnet is officially operational and Polkadot slots are auctioned, which would deprive it of its first-mover advantage in the Polkadot ecosystem.
Gear currently supports Rust and C language, especially Rust. Rust is difficult to learn and can have a limited number of developers.
Gear has not officially expressed support for EVM, which would deprive it of the vast Solidity developers that currently dominate blockchain development and hinder the rapid development of the Gear ecosystem;
The Gear’s safety depends on the Polkadot relay chain, and its future prosperity will be dictated by the Polkadot ecosystem itself. Polkadot’s potential flaws in the future could seriously affect Gear.
As a new entry point for developers into the Polkadot ecosystem, Gear is refreshing in terms of technical proposition and team background. However, the special business logic and operation mechanism of blockchain makes it inherently “hostile” to the working way of parallel multithreading, which is undoubtedly a huge obstacle for the Gear team who hold high the banner of “parallel computing”.
Meanwhile, with Ethereum EVM virtual machines and Solidity itself almost too big to fail, Gear still faces a tough test for Moonbeam, Acala, and Astar, which have gained traction among Ethereum-related developers within the Polkadot ecosystem due to their EVM compatibility.
Note: Special thanks to Polkadot Eco-developer, Patract CTO @aten and Ethereum eco-developer @一只帅狗 for their technical answers to this article.
《The advantage of Gear technology》
《Gear Technologies Raises $12M to Boost Smart-Contract Development on Polkadot》
《Patract CTO Aten | 未来合约平台的展望，如何突破现有瓶颈？》