Skip to content

Ethereum-Native Precompiles

Introduction

Ethereum-native precompiles are special contract implementations that provide essential cryptographic and utility functions at the runtime level. These precompiles are available at predefined addresses and offer optimized, native implementations of commonly used operations that would be computationally expensive or impractical to implement in pure contract code.

In Polkadot Hub's Revive pallet, these precompiles maintain compatibility with standard Ethereum addresses, allowing developers familiar with Ethereum to seamlessly transition their smart contracts while benefiting from the performance optimizations of the PolkaVM runtime.

How to Use Precompiles

To use a precompile in your smart contract, simply call the precompile's address as you would any other contract. Each precompile has a specific address (shown in the table below) and expects input data in a particular format. The precompile executes natively at the runtime level and returns the result directly to your contract.

For example, to use the ECRecover precompile to verify a signature, you would call address 0x0000000000000000000000000000000000000001 with the properly formatted signature data. The precompile handles the complex cryptographic operations efficiently and returns the recovered public key.

You can find sample contracts for each precompile in the precompiles-hardhat project.

Standard Precompiles in Polkadot Hub

Revive implements the standard set of Ethereum precompiles:

Contract Name Address (Last Byte) Description
ECRecover 0x01 Recovers the public key associated with a signature
Sha256 0x02 Implements the SHA-256 hash function
Ripemd160 0x03 Implements the RIPEMD-160 hash function
Identity 0x04 Data copy function (returns input as output)
Modexp 0x05 Modular exponentiation
Bn128Add 0x06 Addition on the alt_bn128 curve
Bn128Mul 0x07 Multiplication on the alt_bn128 curve
Bn128Pairing 0x08 Pairing check on the alt_bn128 curve
Blake2F 0x09 Blake2 compression function F

Conclusion

Ethereum-native precompiles provide a powerful foundation for smart contract development on Polkadot Hub, offering high-performance implementations of essential cryptographic and utility functions. By maintaining compatibility with standard Ethereum precompile addresses and interfaces, Revive ensures that developers can leverage existing knowledge and tools while benefiting from the enhanced performance of native execution.

Last update: October 30, 2025
| Created: September 30, 2025