Author: Dewhales Research Source: Translation: substack Shan Ouba, Golden Finance
Introduction
AppLayer actually has quite a long development history, focusing on scaling solutions. Initially, the team worked on Æverest++, which emerged during the hackathon at the 2022 Avalanche Summit. The project had a simple goal - to build a deterministic subnet that met two key requirements: support high throughput and be built in C++. This development later evolved into SparqNet - a protocol that contains tools for creating subnets and decentralized applications with record-breaking transaction speeds, achieving things that were once thought to be impossible.
SparqNet provides tremendous value in a range of protocol-level services, starting with a bridge that handles transactions from any EVM chain in and outside of SparqNet. Furthermore, SparqNet is language agnostic and its bridge is compatible with any chain, ensuring seamless transfer of smart contracts and assets. As early as 2022, the team was leaning towards GameFi and DeFi, and they continue on this trajectory.
Currently, we see the project as AppLayer - a modular EVM layer for cross-chain applications. How does it work and how is it different from other solutions? Let's take a closer look.
2. AppLayer Review
First, it is worth noting that while AppLayer is EVM-specific, it has several unique features. In particular, AppLayer aims to solve inherent EVM problems. For example, in the case of the Ethereum Virtual Machine, you won’t be able to do any of the following:
Execute a function loop more than 50 times due to gas limit
Have a stack size larger than 16 variables due to EVM limitations
Execute multiple contracts in parallel (for example, every time a new block contains multiple transactions interacting with different contracts, you need to load the contracts, analyze them, and save the changes to each contract in a specific order to the database).
As AppLayer developer Itamar said: “The biggest problem is that everyone shares the same computer, and that computer is a Commodore 64.”
So App Layer is a modular blockchain with multiple layers that aims to address these limitations. It introduces a blockchain system with state tracking precompiles, allowing third parties to deploy and initially maintain these contracts in a unified network that shares its state. All of this is supported by EVM integration, state saving precompiles, and chain abstraction.
In addition, one of the biggest challenges in blockchain development is handling block rollbacks. For example, in the Bitcoin chain, if we assume that there is a final block followed by another block, and a node receives a block that replaces the last block, then the next block and all transactions within it will also be replaced, causing the blockchain state to roll back by one block.
Bitcoin and other derivative blockchains follow the "longest chain rule". However, rollbacks expose problems in this rule. For example, when developers create a dApp that has to handle such special cases, it may require significant effort, depending on the size and/or complexity of the application.
The solution to this problem is to avoid rollback conditions altogether. This can be achieved by deterministically defining which network node can create a block, thus eliminating block race conditions and making everyone in the network synchronized with the same final block.
App Layer implements this concept as Randomized Deterministic Proof of Stake (rdPoS), which combines a block overload system and a random number generator system to allow only one validator to create a block at any given time, thus avoiding rollbacks and reaching consensus in a super-fast network.
3. AppLayer Components and Network Participants
At a basic level, the AppLayer network consists of three parts:
A Blockchain Development Kit (BDK) with rich developer documentation, allowing them to easily create their own AppLayers with unprecedented freedom.
The EVM network built with the Blockchain Development Kit allows developers to deploy EVM smart contracts and extend them with C++ precompilation and state tracking.
The network that enables data and asset aggregation between these application chains and external chains is called the Chain Abstraction Network (CAN).
Thus, blockchains created using BDK can interact with each other through AppLayer.
In order for this system to work properly, AppLayer has several participants and auxiliary components:
Validator - a computer, usually hosted in a data center, commonly called a server, whose sole purpose is to operate and protect the blockchain network. Validators need to stake at least 200,000 $APPL tokens and are responsible for creating blocks, generating a "random" seed used to select the next block creator, and collecting and signing bridge and block data. According to the document, the team is exploring the possibility of implementing a slashing mechanism.
Sentinels are similar to Validators, except that they cannot create blocks or operate independently. Both randomly selected Validators and Sentinels must submit the same data to the requester; otherwise, they will be reported to the network as malicious nodes. AppLayer Labs and its partners host them to ensure that this does not happen. Sentinels can be hosted by a trusted third party and are subject to a rigorous KYC process. Eventually, as the network and core technology develop, Sentinels will be phased out and replaced by a completely permissionless system. Sentinels also require a stake of $200,000 APPL.
AppChains — The core part, also known as AppLayer™, consists of blockchains built using AppLayer’s Blockchain Development Kit (BDK) and deployed on AppLayer’s Chain Abstraction Layer. AppLayer’s BDK currently supports development in C++ and Solidity, with plans to add other languages such as Rust, C#, Golang, and more. These AppChains are compiled into binaries for efficient execution alongside Solidity bytecode.
Bridges — A component that allows AppLayer-powered blockchains to communicate natively using the Chain Abstraction Network (CAN) as an intermediary, where AppLayer acts as a bridge between two dAppChains trying to communicate. The bridge is also maintained by a set of validators and sentinels.
rdPoS (Randomized Deterministic Proof of Stake) - allows validators and sentinels to handle block overload and random number generation. At the heart of rdPoS is RandomGen, a deterministic uint256_t generator used for almost everything consensus related. This deterministic randomness ensures that every node has a chance to respond to a given request (block, randomness, bridge, etc.), while also ensuring that the selected nodes are truly random and cannot be attacked by malicious actors.
4. Transaction Lifecycle in AppLayer
1. The list of network validators is randomly generated and ordered using the "randomness" seed from the previous block.
2. The first validator in the list becomes the block creator, while at least four other validators generate a random 32-byte string and use it to execute two transactions: one containing the hash value of the specified string, and the other containing the string itself, both of which are signed.
3. The hashes are verified to ensure that they match the corresponding random strings.
4. The first validator creates a new block by combining and hashing the random strings of other validators to generate a new "randomness" seed, which will be used in the next block.
4. The block is signed by the first validator and published to the network, while other validators verify that all transaction signatures (random and hashed) match the list generated at the beginning.
6. The genesis block (the first block in the chain) provides effective fixed randomness because there is no previous block before the genesis block that can generate randomness. In addition, at least five hard-coded validators are required to bootstrap the network, because each block requires at least four validators to confirm the string and hash transaction signatures and one validator to sign the block itself.
In addition, the document has a very detailed description of the internal functions and files of BDK and contracts (including regular, EVM and pre-built).
5. What advantages does AppLayer provide to GameFi and DeFi developers?
GameFi:
Previously, GameFi developers had to manually decode transaction data and call the corresponding functions in the dynamic contract. For example, in a game where players receive in-game tokens after reaching a certain stage, developers must manually decode this transaction and initiate token issuance. This process can be time-consuming and error-prone. With the new automatic registration feature, this process is automated. Dynamic function identification and registration allows the system to automatically issue tokens as soon as a player reaches a checkpoint.
In the past, using std::string to store various types of data led to confusion and complexity, especially in games that used multiple data types. For example, a game might use bytes to store image data, text strings to store player names, and hexadecimal to store color codes. Storing all of this in a std::string is not intuitive. With the new update, developers can store these types in the appropriate types (Bytes, BytesArr, and BytesArrView), which improves code readability and reduces debugging issues.
Overhaul of the P2P protocol can drastically improve the performance of multiplayer games. In fast-paced multiplayer games, every millisecond counts. Using Websockets for P2P communication can cause lag and degrade the gaming experience. By switching to raw TCP sockets in the new update, communication between peers becomes faster and more efficient. This means faster game synchronization and data transfer, resulting in better gaming experience, more real-time interaction, and happier players.
Before simplifying contract management through reflection, developers had to manually register dynamic contracts in the contract manager, which could lead to complex workflows. Imagine a game involving multiple smart contracts - one for player rankings, one for token issuance, and one for in-game purchases. Each contract must be manually registered, which is a tedious process. Introducing proper contract return types can simplify the development process. Consider a game with a marketplace where players can buy, sell, and trade in-game assets. Previously, when players purchased items, contract functions returned generic types, requiring developers to handle type conversion and interpretation. This was complex and error-prone.
DeFi:
Previously in DeFi, if developers wanted to encode functions in dynamic contracts that allowed token swaps, they had to manually decode transaction data. For example, exchanging one cryptocurrency for another required manually registering each step of the transaction. With automatic registration, this process becomes simple because the system can dynamically identify and register functions in dynamic contracts.
Storing various data types such as transaction details, addresses, or token information in std::string can lead to confusion and increase debugging time, which reduces the overall efficiency of DeFi operations and slows down the execution of smart contracts.
A major overhaul of P2P protocols can enhance the performance of DeFi applications. Previously, the use of Websockets could slow down transactions or lead to inefficient data transmission.
Before the update, dynamic contracts for managing liquidity pools, staking protocols, or yield farming schemes had to be manually registered in the contract manager. This can be time-consuming and complex. Now, this update automates the registration process and simplifies the management of multiple contracts, allowing developers to focus on building more advanced DeFi protocols instead of managing administrative tasks, thereby accelerating the development of DeFi applications.
With the introduction of proper contract return types, interactions have become simpler. For example, if a user wants to check their loan balance, the contract function now returns the correct type without the need for complex type conversions. This simplifies the user experience and makes DeFi more accessible to a wider audience.
6. Team
AppLayer has experienced founders as well as 5 developers, 3 BDs, and 3 marketing team members.
Michael Weinrub, Co-founder and Head of Business has been involved in the cryptocurrency space since the early days of Bitcoin. Michael has experience in 0-1 startups and has worked in technology solutions sales at companies such as Microsoft and Citrix.
Itamar Carvalho, Co-founder and CTO - Itamar has been building custom blockchains for enterprises since 2016 and has leveraged a lot of knowledge and experience from these custom implementations. Additionally, Itamar has been working on creating a highly flexible blockchain solution that allows for the implementation of super customized blockchain systems dating back to 2018, and we decided to merge our two frameworks into a single SDK in 2022 that other builders can leverage, leading to the hackathon win at the Avax Summit.
7. Partnerships & Integrations
AppLayer has a wide variety of partnerships in different areas, including those inherited from SparQnet before the rebrand: L2, DeFi, Infrastructure Solutions, AI, and Tools, but with a particular focus on partnerships in the gaming space.
In the L2 and Infrastructure space, AppLayer has partnerships and integrations with projects and products such as IoTex, KuCoin Chain, Avy Domains, Covalent, P2P Cloud, Biometric Financial, and NUVO. These integrations are designed to improve the performance of existing solutions and create new products or add-ons with AppLayer technology. They are also used to bring additional functionality to AppLayer itself.
In the DeFi and NFT space, AppLayer has established partnerships and integrations with projects such as OilSwap, EZSwap, StreamNFT, and others. This area involves improving the user experience through mutual integration.
In the AI and tooling space, AppLayer has established partnerships with projects such as OpenFabric, ChainFuse, SendingNetwork, and Mises Browser. These collaborations are driven by a shared ambition to pave the way for seamless integration between decentralized finance and AI.
The most extensive track in the previous section is the collaboration and integration in the gaming space, where AppLayer can fully deploy its product as the essence of Appchains, providing impressive speed, scalability, and multi-language support. In particular, gaming projects are leveraging AppLayer's OrbiterSDK to create complex smart contracts that take the gaming experience to the next level. These projects include MetaStrike, CheersLand, Kingdom Karnage, CatacombCrawler, Meta2150s, Cosmic Force, Yesports, Ready Player DAO, LULU Market, Bionic Owls, Apes Planet, Battle For Giostone, Janus Network, HypaVerse, Eternis, Mental Maze, Stratagems.world, GGNation, Battledogs Arena.
8. Backers
With its experience and extensive connections, AppLayer has backers such as Dewhales Capital, Cogitent Ventures, Big Brain Holdings, Magnus Capital, Curiosity Capital, Builder Capital, Zephyrus Capital, FrensDAO, Rengen Family Office, Brian Johnson (Republic Capital), Connectico Capital, etc.
9. Conclusion
App Layer represents a significant advancement in blockchain technology, addressing long-standing limitations in the Ethereum Virtual Machine (EVM) ecosystem. By leveraging its modular architecture and advanced features such as Randomized Deterministic Proof of Stake (rdPoS) and enhanced blockchain development tools, App Layer promises to deliver unparalleled scalability, efficiency, and flexibility for cross-chain applications.
For developers in the GameFi and DeFi space, App Layer brings significant improvements. Its automated features such as dynamic contract registration and enhanced P2P communication protocols simplify the development process, reduce debugging complexity, and improve application performance. These advancements are expected to significantly improve the user experience, making the platform highly attractive to both new and existing projects.
App Layer's strategic partnerships and integrations with major industry players in L2 solutions, DeFi, NFTs, and AI demonstrate its broad utility and collaborative approach. The focus on games, supported by a strong ecosystem of gaming projects, further emphasizes its potential to transform and enhance the gaming experience in the blockchain space.
Preview
Gain a broader understanding of the crypto industry through informative reports, and engage in in-depth discussions with other like-minded authors and readers. You are welcome to join us in our growing Coinlive community:https://t.me/CoinliveSG