Avalanche HyperSDK: The Definitive Toolkit for Custom VM-Powered Subnets
Tags: avalanchehypersdk, avalanchesubnets
Published: 2024-04-18 06:17:31

<p>When you wish to build your own blockchain for powering your use-case-specific protocols, it shouldn’t be bound by the restriction put forward by the main L1 chain. However, L1 VMs are designed in such a manner that you have to follow a cookie-cutter approach. If you move away from the same, your chain will end up compromising decentralization, interoperability, and security for meeting your project-specific goals.&nbsp;</p>
<p>One might suggest that forking is a good option to overcome this problem, but it has drawbacks, like liquidity fragmentation, because a forked blockchain is a standalone ecosystem.&nbsp;</p>
<p>The need of the hour is to give blockchains the same degree of flexibility like a traditional Web 2 solution without forking and with complete access control over their chains.&nbsp; In addition to this, the process should be simple to construct and integrate. Avalanche Hyper SDK optimizes the data structure and algorithm, allowing developers to customize the VM on their own terms without sacrificing interoperability and fragmenting liquidity.&nbsp;</p>
<p>In this article, we will explore how Avalanche Hyper SDK achieves this through its custom VM-powered L1 subnets.&nbsp;</p>
<figure class="wp-block-image aligncenter size-large"><a href="https://app.zeeve.io/auth/signup?serviceURL=https://app.zeeve.io/avalanche/networks"><img src="https://www.zeeve.io/wp-content/uploads/2024/04/Manage-Subnets-Enterprise-class-with-Zeeve-Avalanche-Management-Dashboard-1024x213.jpg" alt="Avalanche Hyper SDK" class="wp-image-65830"/></a></figure>
<h2 class="wp-block-heading" id="h-what-is-avalanche-hyper-sdk">What is Avalanche Hyper SDK?</h2>
<p>Avalanche Hyper SDK is the front-runner in the world of blockchain framework to help build high-performance custom runtime virtual machines from scratch without forking the chain or compelling the developer to write lengthy codes. Hence, despite not writing very long chains of commands through codes for their specific VM, the developers own their execution environment, and that’s why <a href="https://www.reddit.com/r/Avax/comments/176avwm/the_nodekit_team_building_on_avalanche_is/">Noah Pravecek,</a> the CEO&nbsp; of NodeKit, chose Avalanche HyperSDK for building a fully customized VM for its NodeKit chain.&nbsp;</p>
<p>By the way, if you are looking for NodeKit sequencer integrations, you can easily do them with Zeeve Rollups as a service. <a href="https://www.zeeve.io/blog/zeeve-raas-partners-with-nodekit-to-bring-shared-sequencing-into-its-ecosystem-of-rollups/">Get the details here.</a>&nbsp;</p>
<p>Coming back to HyperSDK. So, through the <a href="https://www.zeeve.io/appchains/avalanche-subnets/">Avalanche HyperSDK for subnets</a>,&nbsp; the developers can bypass the need to develop everything from scratch using the abstraction to run common run-time complexities that are often challenging when you want to deploy your own VM with full customization, but you do not want to either fork the chain or wait for a longer time for upgrades on the main-chain allowing you to develop your own custom VM, which might take time in eternity to occur.&nbsp;</p>
<p>This simplifies the creation of chains that mirror a common run-time blockchain environment while letting the Dapps define their use cases' specific rules. So, if a developer is using Avalanche HyperSDK for their subnets that delve into gaming, he/she can redesign their own custom VM performing use-case-specific functions like customizing the gas spent, simplifying user interaction, and increasing the transaction per second as per the changing game environment without having to seek permission from the main L1 chain.&nbsp;</p>
<p>The outcome, if a game or DeFi app, at any instance, experiences a higher network usage, the custom VM-powered L1 Subnet will adjust the environment accordingly without forking or making protocol-level changes that dilute user experience and obstruct mainstream blockchain adoption.&nbsp;</p>
<h2 class="wp-block-heading" id="h-how-does-hypersdk-make-custom-vm-powered-hyper-scalable-l1-subnets-possible">How does HyperSDK make Custom VM-powered hyper-scalable L1 Subnets Possible?</h2>
<p>When you are building your own custom chains, you need to think about designing your own VM to manage the run-time complexities as per changing environments. So, you have to crack this enigma code without compromising the transaction throughput because HyperSDK for your custom VM powered L1 subnet means hyper scalability. We are speaking of more than 100,000 to 150,000 TPS to fall within this bandwidth of hyper scalability.&nbsp;</p>
<p>Avalanche HyperSDK abstracts run-time code complexities through the use of Avalanche-optimized data structures and algorithms that shorten the development time of your customized blockchains from months to days. So, you just need to write maybe 500-1000 lines of code to make the VM customized as per your application-specific need. Avalanche HyperSDK makes this possible for your subnets by abstracting everything that you can think of while creating your VM for your subnet in the following manner;&nbsp;</p>
<li><strong>Triggering a Partial Transaction Execution&nbsp;</strong></li>
<p>In the partial transaction execution, the subnets created using Avalanche HyperSDK will trigger an action that will request a result from an execution. In this pursuit, any arbitrary execution/function will be requested. If the execution is successful, HyperSDK&nbsp; Smart-Contract Based RunTime execution will be triggered, an optimized fee will be deducted, and state change will occur. However, the data will be stored as blob-data and subsequently destroyed through an x/merkledb, a path-based merkelized Radix tree implementation, which significantly reduces the on-disk footprint of any HyperVM by deleting the data that is no longer needed.&nbsp;</p>
<p>So,&nbsp; a minimal fee will be deducted by exiting the execution if only a few conditions are met. The trade-off of this practice will help meet hyper scalability because all the transactions will be executed in the custom VM environment, and they will pass upon meeting a threshold limit. If a weighted average of the conditions are met, the transaction passes. If not, they are rolled back, and the user pays either a bare minimum fee or no fee, as per the protocol rules.&nbsp;</p>
<p>Furthermore, Avalanche HyperSDK doesn’t store or index the transaction like other blockchains in archival mode, which saves storage costs. On the other hand, Avalanche HyperSDK for subnets will store the transaction in HyperVM in SQL database or Kafka Stream. Whenever a query is created, the HyperSDK will trigger the HyperVM to validate the data by relaying the information from the SQL and Kafka database servers. If the transactions are executed and finalized, the relative data will be deleted from the server via an x/merkledb, as mentioned above.&nbsp;</p>
<li><strong>Using Account Abstraction for Authorization&nbsp;</strong></li>
<p>Instead of validating every single transaction through an AUTH Module, the Hyper VM&nbsp; provides all the registries of supported AUTH to the Avalanche Hyper SDK, which simultaneously validates the transactions as they occur. It is made possible through a Dynamic State Sync model, which allows any node joining the Hyperchain to validate only the most recent state instead of all the transactions on the subnet. Because, if all the transcations on the subnet have to be downloaded by the new node joining the Hyperchain, it will slow down their operation.&nbsp;</p>
<p>On the contrary, the HyperSDK uses X/sync, which is a bandwidth-aware dynamic sync implementation powered&nbsp; by Avalanchego that verifies AUTH Modules&nbsp; from simplified signature verification to WASM Blobs and destroys the same after the process is complete to free up the chain&nbsp; and keep only the necessary data in it to build and verify the next block. .&nbsp;</p>
<li><strong>Using&nbsp; Nonce-less Transaction&nbsp;</strong></li>
<p>While most blockchains use Nonce to counter double spend errors, Avalanche&nbsp; HyperSDK uses a Time History. So, if a specific time has passed, such transactions are not included in the block and it can significantly improve the mempool performance because multiple transactions from a single account need not have to be stored in the mempool .&nbsp;</p>
<p>This makes the execution network faster because a node can gossip any valid transaction to any node instead of the transaction that was specifically executed at that very moment. In this way, it completely revolutionizes the lag time on the mempool and possibly averts the MEV scams as well.&nbsp;</p>
<li><strong>Quick communication for faster Updates</strong></li>
<p>Unlike in other VMs, where all the state transitions or protocol upgrades are broadcasted to the participating validating nodes and they provide an approval for the same, which delays operation, Avalanche HyperSDK makes sure that every object that appear on-chain on HyperSDK Custom VM like actions/ AUTH and Unit Price are time stamped and simultaneously broadcasted at one point of time across the network so that everyone can at a time participate, accept or deny the changes in any form: be it a fee modification or an authorizing action restricted based on consensus.&nbsp;</p>
<li><strong>Smart Gossip&nbsp;</strong></li>
<p>While other VMs gossip the transaction to all the validators, the Avalanche Hyper SDK Custom VM Powered L1 Subnets gossips the transcations to only a few of the upcoming block prospers through the use of <a href="https://github.com/ava-labs/avalanchego/blob/master/vms/proposervm/README.md">SNOWMAN++ ‘s LookAhead Logic </a>which uses a SOFT Proposer Logic selecting a single proposer to validate the block but the block propagation is open to all for challenge. This is very effective in reducing the lag in the gossip when multiple proposers have to participate and vote for a change or inclusion of the transcations in the block. In this way, it significantly improves the transaction speed.&nbsp;</p>
<p>Moreover, there’s a choice given under Avalanche Hyper SDK Custom VM Powered L1 Subnets blockchains where proposers can choose to either accept blocks from RPC instead of a node to node gossip. It entirely depends on what type of finality you wish to keep for your faster blockchain to support your use-cases specific subnet&nbsp; hosted on top of the Avalanche HyperSDK.&nbsp;</p>
<li><strong>Parallel Transaction Execution&nbsp;</strong></li>
<p>While in other VMs, your chain deployed on top of it will have to abide by the rules of the chain while executing the transaction. For example, they will have to validate the transcations occurring in sequence, the Hyper SDK custom VM chain uses executor package which provides an executioner key to the validators that they can trigger to authenticate and execute all non-conflicting transcations. For this, the >Hyper SDK uses HyperVMs AUTH and Action executionary codes which are prespecified and they execute in nano-seconds.&nbsp;</p>
<p>For this purpose, cross-subnet WARP messaging is used, which not only expedites cross-subnet communication but also eliminates the need to have bridges for interoperability among the greater subnet ecosystem. In this way, allowing your application to create a custom VM for its state execution and participation with the greater Avalanche ecosystem.&nbsp;&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jwr4ss6y9m3gov5vvafk.png)
<h2 class="wp-block-heading" id="h-why-is-avalanche-hypersdk-for-subnets-very-promising">Why Is Avalanche HyperSDK for Subnets Very Promising?</h2>
<h3 class="wp-block-heading" id="h-high-performance-vms">High Performance VMs</h3>
<p>Projects built on top of blockchains are facing an innate technological barrier where they need to abide by the specifics rules of the L1 chain hosting their application. In this way, instead of focussing on improving their project. For example, a DEX should be more concerned at improving the features on their protocol. However, they are fixated at improving the speed and scalability and they give very little time to improving their ecosystem from a feature’s standpoint.&nbsp;</p>
<p>After the introduction of the custom VM powered L1 subnets provided by Avalanche Hyper SDK, the application can shift their focus from concentrating at complying with the execution environment to improving the UX on their protocol. While the HyperSDK will help them launch as a HyperChain subnet and scale their ecosystem as per the changing trends without having to make many adjustments on their protocol.&nbsp;</p>
<h3 class="wp-block-heading" id="h-simple-development-process-nbsp">Simple Development Process&nbsp;</h3>
<p>Developing your application and hosting the same on top of blockchain for trust, transparency and cost effectiveness shouldn’t end up like a complex task for businesses. Avalanche Hyper SDK is making the development process simple by abstracting the complex runtime coding. In this way, any developer can look forward to customizing their subnets and innovating the same to support their use-cases as per the changing situation without getting pinned by technicalities of deploying on top of the blockchain.&nbsp;</p>
<h3 class="wp-block-heading" id="h-versatility-in-ecosystem-nbsp">Versatility In Ecosystem&nbsp;</h3>
<p>Avalanche HyperSDK for custom VM powered L1 subnets allow any type of use-cases from gaming, NFT marketplaces to DeFi to be hosted on top of the Avalanche ecosystem as a subnet without compromising the speed, throughput features and others. Hence, the ecosystem can become much more diverse and sustainable for improving the future of the blockchains.&nbsp;</p>
<h2 class="wp-block-heading" id="h-zeeve-for-deploying-and-managing-your-custom-avalanche-subnet">Zeeve for deploying and managing your custom Avalanche Subnet</h2>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shqvkc9ivg6335prbndl.png)
<p>Zeeve’s appchain infrastructure as a service, let anyone create their custom Avalanche Subnets with plug-and-play developer tools and fully managed infrastructure. Zeeve also provides an Avalanche Management Dashboard for effective management of Avalanche Subnets. And the good news is, this can be utilized for both Zeeve hosted and self-hosted nodes. The complete list of features for the management dashboard is added above.&nbsp;</p>
<p>The cherry on top is you can view and manage your Subnet network from your Android and iOS devices on the go.</p>
<p>If you are already running on a blockchain infrastructure and want to migrate to Subnet, our expert team can help you do that without experiencing any downtime or data loss.&nbsp;</p>
<p>For more information on Zeeve managed Avalanche Subnets, <a href="https://www.zeeve.io/appchains/avalanche-subnets/">visit our webpage.&nbsp; </a>If you have any further queries, <a href="https://www.zeeve.io/talk-to-an-expert/">schedule a call with our Avalanche Subnet experts</a> and see how we can simplify your Subnet experience.&nbsp;</p>