Introduction
Learn how to customize the Ethereum Virtual Machine with Subnet-EVM and Precompiles.
Welcome to the Subnet-EVM customization guide. This documentation provides an overview of Subnet-EVM, the purpose of Validator Manager Contracts, the capabilities of precompiles, and how you can create custom precompiles to extend the functionality of the Ethereum Virtual Machine (EVM).
Overview of Subnet-EVM
Subnet-EVM is Avalanche's customized version of the Ethereum Virtual Machine, tailored to run on Avalanche L1s. It allows developers to deploy Solidity smart contracts with enhanced capabilities, benefiting from Avalanche's high throughput and low latency. Subnet-EVM enables more flexibility and performance optimizations compared to the standard EVM.
Validator Manager Contracts
Validator Manager Contracts (VMCs) are smart contracts that manage the validators of an L1. They allow you to define rules and criteria for validator participation directly within smart contracts. VMCs enable dynamic validator sets, making it easier to add or remove validators without requiring a network restart. This provides greater control over the L1's validator management and enhances network governance.
Precompiles
Precompiles are specialized smart contracts that execute native Go code within the EVM context. They act as a bridge between Solidity and lower-level functionalities, allowing for performance optimizations and access to features not available in Solidity alone.
Default Precompiles in Subnet-EVM
Subnet-EVM comes with a set of default precompiles that extend the EVM's functionality:
- Warp Messenger: Enables cross-chain communication between Avalanche L1s.
- AllowList: Manages access control by allowing or restricting specific addresses.
- Reward Manager: Handles the distribution of staking rewards to validators.
These precompiles enhance the capabilities of your smart contracts and enable more complex decentralized applications.
Custom Precompiles
One of the powerful features of Subnet-EVM is the ability to create custom precompiles. By writing Go code and integrating it as a precompile, you can extend the EVM's functionality to suit specific use cases. Custom precompiles allow you to:
- Achieve higher performance for computationally intensive tasks.
- Access lower-level system functions not available in Solidity.
- Implement custom cryptographic functions or algorithms.
- Interact with external systems or data sources.
Creating custom precompiles opens up a wide range of possibilities for developers to optimize and expand their decentralized applications on Avalanche L1s.
By leveraging Subnet-EVM, Validator Manager Contracts, and precompiles, you can build customized and efficient decentralized applications with greater control and enhanced functionality. Explore the following sections to learn how to implement and utilize these powerful features.
Last updated on