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

  • Xinjiang launches special campaign to combat illegal fundraising, with key areas including virtual currency, blockchain, etc.

    According to Chang'an Xinjiang Public Account, Xinjiang Autonomous Region and Corps have launched a joint special action to crack down on illegal fund-raising, with key areas including third-party wealth management, fake private equity, fake gold exchange and other traditional fields, as well as emerging fields such as virtual currency, blockchain, cultural tourism, film and television investment, and debt resolution services. It is reported that key cases include cases involving more than 100 million yuan and cases that have been criminally filed for more than five years.

  • A British court has postponed the final sentencing of Wen Jian, a British-Chinese national involved in the country's largest Bitcoin money laundering case, until May 24.

    On May 11th, it was reported that Jian Wen, a 42-year-old British Chinese citizen, was found guilty of "participating in arranging money laundering" in the UK's largest Bitcoin money laundering case. He could be sentenced to up to 14 years in prison. Jian Wen's defense lawyer, Mark Harries, stated that due to the judge's busy schedule, the UK court has postponed Jian Wen's final sentencing, which was originally scheduled for May 10th, to May 24th.

  • Web3 startup Star Nest completes $6 million in Pre-A round of financing

    Hong Kong Web3 music startup Star Nest announced that it has completed a $6 million Pre-A round of financing, led by Chuangqi International Limited, a wholly-owned subsidiary of Hong Kong Stock Exchange-listed company Guofu Innovation. Star Nest will collaborate with Armonia Meta Chain to develop the Star Nest SpaceStar metaverse game, which includes music, role-playing, and social features.In addition, Star Nest plans to launch its NEST project in the third quarter of 2024. Nest will receive 2.1 billion NEST tokens tailored for the project, and Star Nest will use the NEST token to build a more complete music industry token economic system. The NEST token will be widely used for purchasing performance tickets, chain game cooperation, metaverse consumption, governance voting, and other activities.

  • Over $594 million worth of PYTH is staked

    According to Dune data,  there are currently 1,201,167,362 PYTH tokens in the staked state, with a total staked value exceeding $594 million. The number of PYTH stakers has reached 151,211.

  • US Department of Justice: Tornado Cash indictment has nothing to do with "free speech"

    On May 11th, the US Department of Justice explained why the motion to dismiss the criminal case against Tornado Cash founder Roman Storm was invalid. The Department of Justice reiterated that their indictment was not related to whether the Tornado Cash computer code had freedom of speech or was protected by the First Amendment of the Constitution. The defendant was not charged for publishing computer code, but for using it to facilitate profitable illegal activities.

  • USDC circulation decreased by $100 million in the past week, with a total circulation of $33 billion

    According to official data,as of May 9th, Circle has issued approximately $2 billion USDC and redeemed approximately $2 billion USDC in the past 7 days, with a decrease in circulation of approximately $100 million. The total circulation of USDC is $33 billion, with a reserve of $33.1 billion, including approximately $3.3 billion in cash and Circle Reserve Fund holding approximately $29.8 billion.

  • SEC rejects Coinbase's request for appeals court ruling on cryptocurrency rules

    The US SEC has rejected Coinbase's request to appeal to the court to review whether traditional securities rules are applicable to cryptocurrencies. In its application, Coinbase stated that it hoped the appeals court would consider whether the Howey test, which has long been used for securities evaluation, should be applied to digital assets. However, the SEC pointed out that Coinbase has not successfully demonstrated the need for such an evaluation. The SEC stated that Coinbase is attempting to create a "new legal test," but this attempt was rejected by the court. The court found that Coinbase's arguments lacked consistency and did not successfully demonstrate the existence of decisive issues. Currently, the judge responsible for hearing the SEC's case against Coinbase will make a ruling on Coinbase's intermediate appeal motion.

  • Colombian President Suspected of Accepting $500,000 in Illegal Crypto Donations

    Colombian President Gustavo Petro is suspected of accepting over $500,000 in digital token donations from a fraudulent cryptocurrency project during his 2022 election campaign. A former contractor revealed that the illegal donation occurred during a meeting in February 2022 that discussed the advantages of cryptocurrency and the possibility of working with the government. This allegation is one of the latest charges faced by President Petro during his election campaign, with the Colombian Prosecutor's Office investigating his campaign last year.

  • Barcelona-based Web3 Video Games Startup GFAL Raises $3.2M in Seed Funding to Expand Team and Accelerate Production Plans

    Barcelona-based startup GFAL has secured $3.2 million in seed funding from investors including Supercell Ltd and Mitch Lasky. The company plans to use the funds to expand its team and accelerate its game production plans, which leverage AI and Web3 technology for immersive gameplay. GFAL's Elemental Raiders mobile game soft-launched in March 2023, with plans to build on this for a 2024 launch. CEO Manel Sort expressed gratitude for the investment and excitement to work with former colleagues from Digital Chocolate.

  • Wu Jiezhuang, a member of the National Committee of the Chinese People's Political Consultative Conference, suggested that Hong Kong refer to IPO to provide innovative financing models for Web3

    Wu Jiezhuang, a member of the National Committee of the Chinese People's Political Consultative Conference and a member of the Hong Kong Legislative Council, wrote an article in the Hong Kong Wen Wei Po titled "Leading the Digital Economy by Adapting to the Web3 Trend". The article pointed out that developing Web3+ has both advantages and new challenges. The Hong Kong government has taken an important step in the direction of developing Web3 and the digital economy by formulating a short- to medium-term strategic development blueprint, ensuring that policies and resources are in place, and promoting the construction of Web3+ application scenarios. Focusing on Web3, establishing an international innovation financing platform can not only help Hong Kong leverage its traditional financial advantages, but also help it become a global digital technology center. It is suggested to refer to the mature mode of existing enterprises' IPOs in Hong Kong, provide an innovative financing model for Web3, and create a market trend and service competitive advantage to promote the development of the industry and attract upstream and downstream of the industry chain at home and abroad to gather in Hong Kong.