adding-precompiles

Create and register custom precompiles for Moonbeam-style Substrate runtimes.

2|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/manuelmauro/moonbeam-skills --skill adding-precompiles
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-precompiles
Source: https://github.com/manuelmauro/moonbeam-skills/tree/main/skills/adding-precompiles
Command: npx skills add https://github.com/manuelmauro/moonbeam-skills --skill adding-precompiles

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expose Substrate functionality to the Ethereum Virtual Machine by implementing and integrating precompiled contracts, enabling Solidity contracts to access runtime features securely and efficiently.

Core Features & Use Cases

  • Bridge Substrate pallets to the EVM via custom precompiles, enabling seamless interoperability for on-chain logic.
  • Provide a reusable scaffolding to create, test, and register precompiles in Moonbeam-like runtimes.
  • Use Case: A developer wants a pallet feature to be accessible in Solidity without crossing runtime boundaries.

Quick Start

Create the precompile crate, implement the precompile with the provided macro, and register it in the runtime precompiles.

Frequently Asked Questions about adding-precompiles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose Substrate pallet functionality to Solidity smart contracts?

You can expose Substrate pallet functionality to Solidity smart contracts by implementing precompiles that bridge the EVM to your runtime, allowing direct access without crossing runtime boundaries. This requires creating a dedicated precompile crate and registering it in the runtime.

How do I create a custom precompile in a Moonbeam-style Substrate runtime?

To create a custom precompile in a Moonbeam-style runtime, you implement the precompile interface using a provided macro, define a unique precompile address, set up a mock runtime for testing, and register the precompile within the runtime configuration.

What is the role of precompiles in Substrate and EVM interoperability?

Precompiles act as a bridge for Substrate and EVM interoperability by mapping specific runtime pallet features to predefined EVM addresses, enabling Solidity contracts to securely invoke native Substrate logic without adding heavy computational overhead to the EVM.

Do I need Rust to write EVM precompiles for Substrate?

Yes, you need Rust to write EVM precompiles for Substrate because the underlying runtime and pallet logic are written in Rust, and the precompile interface must be implemented as a Rust crate that integrates directly with the Substrate runtime environment.

What is the best way to test a Substrate precompile before runtime registration?

The best way to test a Substrate precompile before runtime registration is to set up a mock runtime environment alongside your precompile crate, allowing you to verify the interface logic and macro implementation against simulated pallet calls prior to deployment.

Why use precompiles instead of standard smart contracts for Substrate pallet access?

Precompiles are used instead of standard smart contracts for Substrate pallet access because they execute native Rust runtime code directly, avoiding the gas-heavy EVM interpretation overhead and enabling seamless, secure bridging between Solidity contracts and Substrate features.