Cointime

Download App
iOS & Android

Gear Protocol: building a decentralized app platform with infinite possibilities

Cointime Official

By Cointime.com 237

Gear Protocol is a smart contract platform built on Substrate that allows anyone to develop and run dApps in minutes. As the most development-friendly approach, Gear Protocol implements smart contracts with arbitrary logic and complexity. gear smart contracts run as WebAssembly programs, and thus can be compiled using Gear Smart Contracts run as WebAssembly programs and can therefore be compiled using a wide range of popular programming languages (e.g. Rust, C, C++, etc.).

The protocol provides a clean, intuitive and feature-rich API that makes it simple to implement and run programs on multiple networks. From a technical perspective, the Gear Protocol differentiates itself through unique features that allow developers to create new and previously unattainable user experiences, including the use of the Actor model for communication, the concept of persistent memory, and the WebAssembly execution environment. The protocol defines the characteristics that Actors have as communication entities.

By supporting innovative dApps, microservices, middleware, and open APIs, Gear Protocol will drive mass adoption of Web3 technologies.The Gear Network is available either as a stand-alone L1 network or as a parallel chain in the Polkadot and Kusama ecosystems. By deploying on Gear Protocol, developers can take full advantage of the various benefits Gear offers.

Vara Network, on the other hand, is the first Layer-1 decentralized network built and running independently on Gear Protocol.

Vara aims to provide developers with an environment to build decentralized applications and drive the Web3 industry to the next level. Without having to develop their own blockchain, anyone can build dApps and deploy them on the Vara network.

By building a bridge between Web2 and Web3, Vara opens up opportunities for developers to build the next generation of decentralized applications, accelerating the adoption of Web3 technologies and leading the way forward. As a local blockchain based on WebAssembly, developers can write and compile code using traditional programming languages.

Additionally, Vara Network offers features such as low transaction costs, pledges, participation in governance, validators, nominees, and ambassador programs (as well as future rebates on fuel costs).

Platform Features

Gear Protocol has a number of unique features that set it apart from other platforms:

1. Truly decentralized

Unlike other platforms, Gear smart contracts are able to trigger their functionality autonomously, without the need for external components or services to trigger on-chain transactions. Traditional smart contracts typically require the user to initiate a transaction in order to wake up the contract, but in many cases the contract needs to be triggered when specific conditions are met, such as a specific point in time being reached or a specific event occurring. In the past, this has limited the functionality of smart contracts or required developers to introduce centralized services to trigger the contract.

Gear Protocol, based on its support for asynchronous messaging, enables contract developers to implement arbitrary contract logic with delayed messaging that wakes up the contract after a specified period of time or upon the occurrence of a specific event. This brings a wider range of application scenarios for smart contracts, unleashes new decentralized features, and creates more value for users in the blockchain ecosystem.

2. Continuous Message Automation

The execution of every message in Gear (including system messages) consumes "gas", and the Gear Protocol introduces the concept of Gas Reservation, which allows for the creation of pools of gas that can be used by programs for further execution. Each pool is unique to the program that created it, and if the program does not have enough "gas_available", it can consume gas from that pool.

An important advantage of Gas Reservation is the ability to send delayed messages that are automatically triggered at a specific time in the future. These messages are similar to other messages in Gear, and can either call another smart contract in the network or appear in the user's mailbox.

Most interestingly, Gas Reservation allows a program to send a message to itself at a later time, allowing it to continue execution after a defined period of time. This allows a smart contract to implement itself for an unlimited number of executions (provided there is enough available gas).

This opens up a wide range of possibilities for implementing functional logic related to continuous message automation in smart contracts. Delayed messages are similar to cron jobs and cannot be implemented in smart contracts on other blockchain platforms unless external resources are used. The significant advantage of this solution is that it eliminates the need for centralized components in a dApp, ensures that they run entirely on-chain, and enables complete decentralization and autonomy.

Core Technology I: Substrate

Substrate is a modular framework that enables the ability to custom-build unique blockchains by combining custom or pre-built components with networks, consensus mechanisms, core functionality, security and governance features.

Using the Substrate framework simplifies the process of creating different blockchains for specific applications.Substrate provides a rich set of out-of-the-box features and allows developers to focus on creating custom engines on top of the protocol.

The main features of Substrate are as follows:

1, no fork updates

2, built-in coordination

3, cross-language support for WebAssembly

4, light client friendly

5, deterministic finality

6. Seamless integration

Substrate enabled the Gear team to significantly reduce development time and focus on developing key Gear protocol components, while the Rust language ensured security and high performance.

Gear's unique asynchronous messaging architecture enables efficient communication between networks built on Substrate technology. This seamless integration helps to increase the interoperability of network functionality and participation.

Core Technology II: Actor Model

The Actor model is a key and unique feature of the Gear Protocol for message-passing communications. In concurrent computing systems, "message-passing communication" means that programs communicate by exchanging messages. Message passing is easier to understand and has better performance characteristics than "shared memory communication".

The Actor model framework supports asynchronous messaging and parallel computation, which greatly improves speed and makes it easier to build complex dApps. In general, the normal Actor model does not guarantee message order, but the Gear Protocol provides some additional guarantees to ensure that the order of messages is preserved between two specific programs.

In this context, Actor refers to the atomic computation unit in the Actor model that can send and receive messages. In Gear, any instance of the Gear Protocol is an Actor, either a program (smart contract) or a user that sends messages to a program. Each Actor has its own internal private state and the user has a mailbox. Communication is asynchronous; messages are taken from the mailbox and assigned to a message processing stream in which they are processed according to a cycle.

Core Technology III: WebAssembly

WebAssembly is a way to run non-JavaScript programming language applications in web pages. In reality, Wasm is just a virtual machine that runs on modern browsers, but unlike in the past when JavaScript had to be used to run code in web pages, Wasm makes it possible to run code in browsers using non-JavaScript programming languages.

The WebAssembly virtual machine (or Wasm for short) proved to be faster than any alternative virtual machine due to its technical features. Using WebAssembly it is possible to compile Gear's smart contracts directly into machine code and run them at near-native speeds. Higher speed means lower transaction costs and greater efficiency.

All Gear programs and smart contracts run as WebAssembly programs. This means that developers can take their applications to the Web and achieve full performance and the full feature set of the application in a Web browser, just as if it were running natively on Windows or Mac. Instead of writing Wasm code directly, developers actually use Wasm as a compilation target for programs written in other languages.

The main problem WebAssembly solves is the inability to use programming languages other than JavaScript on the Web. Although JavaScript is a great programming language, it is not suitable for ultra-fast execution of large applications.Wasm is revolutionary in that it brings the performance of native applications written in other programming languages to the Web in a completely safe manner.

Wasm can significantly increase speed in two main areas.

First, it should dramatically increase the speed at which applications are launched. In fact, applications already using Wasm have been able to cut application startup times in half, and startup speeds will only increase further as more optimizations are made. This will allow huge applications to load very quickly.

Secondly, Wasm also significantly improves throughput, which means that once the code is compiled, it will run faster, making the application more efficient and responsive, which significantly improves the user experience.

Core Technology IV: Persistent Memory

Another important feature of Gear Protocol is its persistent memory technology. This technology makes development simpler, reduces complexity, and matches the memory management of the actual hardware and operating system.

Instead of using traditional storage, programs running in the Gear network persist their complete state. Doing so greatly reduces the API surface on the blockchain. At the same time, this approach avoids the constraints of a domain-specific language and allows the use of more complex language constructs such as persistent closures and futures combinators.

Gear Protocol employs a clever memory virtualization technique that treats memory allocation and release as first-class system calls. It also tracks memory accesses and loads/stores only the pages needed. This way heap allocations in smart contracts (typically found in futures and their combinators) can be seamlessly persisted and called when needed to preserve their state.

Program code is stored as immutable Wasm blocks with a certain amount of memory space that is persisted between message processing (called static regions). Each program has a separate memory space and is reserved for it during the initialization phase at no additional cost. Programs can only read and write in their own memory space and cannot access the memory space of other programs.

Programs can allocate the memory they need in 64KB blocks. Each memory block allocation consumes gas. Each page (64KB) of these memory blocks is stored separately on the distributed database backend. However, at runtime, Gear nodes build contiguous runtime memory and allow programs to run on it without reloading.

Persistent memory technology also supports memory parallelism. Each program has a separate, isolated memory space, which allows multiple message streams to be processed in parallel on Gear nodes. The number of streams processed in parallel is equal to the number of CPU cores. Each flow is responsible for processing a set of program-specific messages, which can come from other programs or externally (user transactions).

With persistent memory technology, Gear Protocol enables efficient parallelization of message processing, which improves system performance. This technology ensures persistence of program state and provides developers with more flexible and powerful programming capabilities.

Core Technology V: Gear Network State

The Gear network maintains distributed state through a series of state components. Similar to other blockchain systems, runtime code compiled as WebAssembly becomes part of the state stored on the blockchain.

Gear employs an important feature - forkless runtime upgrades. Determinism of the state can be ensured through the use of finality tools.

The stored state consists of the following components:

1. program and memory

This includes the program's code and private memory. The program code is stored in immutable Wasm blocks. Each program has a certain amount of memory that is persisted between message processing (i.e., static regions). A program can allocate more memory from the memory pool provided by the Gear instance, and can only read and write in the memory specifically allocated to it.

2. Message Queues

The global message queue is used to receive message transactions sent by the user to a particular program. These messages populate the message queue, are queued out and routed to the appropriate program during block building.

3、Accounts

Network accounts and their balances are stored in the Accounts component.Gear provides a Balances module to manage user and program balances and to pay for transactions. For public networks, defending against DOS attacks usually requires payment of gas/fees. In the case of a license, the balance module may not be required.

The Gear network may be a licensed or unlicensed public blockchain. In the case of licensing, the balance module may not be needed, but it is necessary for public networks.

In summary, Gear Network state technology enables efficient distributed state management through components such as programs, memory, message queues, and accounts, and provides developers with powerful tools to build blockchain solutions for a variety of application scenarios.

Core Technology VI: State Transition

Each system performs state transitions according to certain rules and updates the state according to the state transition rules when the network processes new input data. This input data is packaged into fine-grained information called transactions.

In Gear network, nodes maintain and synchronize a transaction pool which contains all new transactions. When a transaction is received by any node (validating or non-validating), that node propagates it to all connected nodes.

When a Gear validation node is ready to generate a new block, it selects some or all of the transactions from the transaction pool and merges them into a block through which state transitions are performed. Transactions not included in the previous block are kept in the pool until the next block is generated.

The Gear network supports the following types of transactions:

1. Uploading a program: Users can upload a new program (smart contract) and associate an initial balance with it.

2、Upload Code: You can upload uninitialized Wasm code for subsequent creation of programs.

3、Create Program: Users and programs can use the uploaded code to create new programs.

4、Send Message: End users interact with the program by sending messages to the Gear network. Sent messages populate a global message queue that acts as a runtime-driven transaction queue, ensuring that all messages are eventually processed.

5. Sending replies: Similar to messages, replies can only be sent as a response to a received message. Users can send replies to messages contained in their mailboxes.

6、Claim value from mailbox: When a message associated with a value is received, the user must claim the value and transfer it from the message to the user. Unclaimed values will be returned to the sender when the gas limit is exhausted.

7. out-of-queue messages: validators choose which messages to out-of-queue when it is their turn to generate the next block. This eliminates the need for each validator to maintain full memory state. The queuing process occurs only at the end of each block.

8. Balance transfers: Conventional balance transfers can be performed in two ways, either using the extrinsics provided by the Substrate Balances module (e.g., transfer, setBalance, etc.), or by sending a transfer request with the relevant values to other users via messages.

The lifecycle of message processing, block building and events in the Gear network is shown below. According to the Actor model of communication, there is no sharing, only messages. It ends up in the form of an event log for inspection by the user space.

Conclusion

Gear Protocol and Vara Network provide developers with powerful tools and environments that enable them to build innovative decentralized applications in the Web3 industry. By supporting multiple programming languages and the flexibility of smart contracts, these platforms bring great convenience and freedom to developers.

Unique features of Gear Protocol, such as asynchronous messaging support and the Gas Reservation mechanism, bring greater functionality and automation capabilities to smart contracts. This allows developers to achieve previously unattainable persistent message automation and decentralized logic, further expanding the boundaries of blockchain applications.

As Web3 technology continues to evolve and adoption accelerates, we can expect Gear Protocol and Vara Network to continue to push the boundaries of the space. These platforms provide a strong foundation for the creation and innovation of next-generation decentralized applications, facilitating a thriving Web3 ecosystem. As an important technology support, these platforms are likely to lead the way in the future development of Web3 technology and create more value and rich user experience for users.

Comments

All Comments

Recommended for you

  • U.S. Congressman Mike Flood: Looking forward to working with the next SEC Chairman to revoke the anti-crypto banking policy SAB 121

     US House of Representatives will investigate Representative Mike Flood's recent statement: "Despite widespread opposition, SAB 121 is still operating as a regulation, even though it has never gone through the normal Administrative Procedure Act process." Flood said, "I look forward to working with the next SEC chairman to revoke SAB 121. Whether Chairman Gary Gensler resigns on his own or President Trump fulfills his promise to dismiss Gensler, the new government has an excellent opportunity to usher in a new era after Gensler's departure." He added, "It's not surprising that Gensler opposed the digital asset regulatory framework passed by the House on a bipartisan basis earlier this year. 71 Democrats and House Republicans passed this common-sense framework together. Although the Democratic-led Senate rejected it, it represented a breakthrough moment for cryptocurrency and may provide information for the work of the unified Republican government when the next Congress begins in January next year."

  • Indian billionaire Adani summoned by US SEC to explain position on bribery case

    Indian billionaire Gautam Adani and his nephew, Sahil Adani, have been subpoenaed by the US Securities and Exchange Commission (SEC) to explain allegations of paying over $250 million in bribes to win solar power contracts. According to the Press Trust of India (PTI), the subpoena has been delivered to the Adani family's residence in Ahmedabad, a city in western India, and they have been given 21 days to respond. The notice, issued on November 21 by the Eastern District Court of New York, states that if the Adani family fails to respond on time, a default judgment will be made against them.

  • U.S. Congressman: SEC Commissioner Hester Peirce may become the new acting chairman of the SEC

    US Congressman French Hill revealed at the North American Blockchain Summit (NABS) that Republican SEC Commissioner Hester Peirce is "likely" to become the new acting chair of the US Securities and Exchange Commission (SEC). He noted that current chair Gary Gensler will step down on January 20, 2025, and the Republican Party will take over the SEC, with Peirce expected to succeed him.

  • Tether spokesperson: The relationship with Cantor is purely business, and the claim that Lutnick influenced regulatory actions is pure nonsense

     a spokesperson for Tether stated: "The relationship between Tether and Cantor Fitzgerald is purely a business relationship based on managing reserves. Claims that Howard Lutnick's joining the transition team in some way implies an influence on regulatory actions are baseless."

  • Bitwise CEO warns that ETHW is not suitable for all investors and has high risks and high volatility

    Hunter Horsley, CEO of Bitwise, posted on X platform that he was happy to see capital inflows into Bitwise's Ethereum exchange-traded fund ETHW, iShares, and Fidelity this Friday. He reminded that ETHW is not a registered investment company under the U.S. Investment Company Act of 1940 and therefore is not protected by the law. ETHW is not suitable for all investors due to its high risk and volatility.

  • Musk said he liked the "WOULD" meme, and the related tokens rose 400 times in a short period of time

    Musk posted a picture on his social media platform saying he likes the "WOULD" meme. As a result, the meme coin with the same name briefly surged. According to GMGN data, the meme coin with the same name created 123 days ago surged over 400 times in a short period of time, with a current market value of 4.5 million US dollars. Reminder to users: Meme coins have no practical use cases, prices are highly volatile, and investment should be cautious.

  • Victory Securities: Funding Rates halved and fell, Bitcoin's short-term direction is not one-sided

    Zhou Lele, the Vice Chief Operating Officer of Victory Securities, analyzed that the macro and high-level negative impact risks in the cryptocurrency market have passed. The risks are now more focused on expected realization, such as the American entrepreneur Musk and the American "Efficiency Department" (DOGE) led by Ramaswamy. After media reports, the increase in Dogecoin ($DOGE) was only 5.7%, while Dogecoin rose by 83% in the week when the US election results were announced. Last week, the net inflow of off-exchange Bitcoin ETF was US$1.67 billion, and the holdings of exchange contracts and CME contracts remained high, but the funding rates halved and fell back, indicating that the direction of Bitcoin in the short term is not one-sided, and bears are also accumulating strength.

  • ECB board member Villeroy: Falling inflation allows ECB to cut interest rates

     ECB board member Villeroy de Galhau said in an interview that the decline in inflation allows the ECB to lower interest rates. In addition, the slow pace of price increases compared to average wages is also a factor in the rate cut. Villeroy de Galhau emphasized that the ECB's interest rate policy decision is independent of the Fed. Evidence shows that the ECB began to lower interest rates in early June, while the Fed lowered interest rates three months later. With the decline in inflation, we will be able to continue to lower interest rates. Currently, the market generally expects the ECB to cut interest rates by 25 basis points at the next meeting in December, but weaker data increases the possibility of a 50 basis point cut.

  • State Street warns Bitcoin craze could distract gold investors

    George Milling-Stanley, the head of gold strategy at Dominion Bank, warned that the rise of Bitcoin may mislead investors to overlook the stability of gold. He believes that Bitcoin is more like a return-driven investment, while gold provides long-term stability. He also criticized Bitcoin promoters for misleading the market by using the term "mining," and believes that gold is still a more reliable investment choice.

  • Web3 data and AI company Validation Cloud completes $10 million in new round of financing

     Web3 data and AI company Validation Cloud announced a $10 million financing round from True Global Ventures. The company plans to use the funds to expand its AI products and achieve seamless access to Web3 data.