Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Japanese version: /ja/doc/compatibility/precompiles-system-contracts.html

Precompiles & System Contracts

TL;DR

  • Precompile failures are classified as exec.halt.precompile_error.
  • Kasane uses revm mainnet precompile set without custom address overrides.
  • Current default is SpecId::default = PRAGUE, so OSAKA-added 0x0100 (P256VERIFY) is not enabled by default.
  • Opcode-level discussion is out of scope for this page (see ethereum-differences.md).

Operational Policy

  • Use exec.halt.precompile_error as the primary classifier for precompile failures.
  • Smoke-test precompile-dependent paths before mainnet rollout.

Supported Precompiles (Current Default: PRAGUE)

AddressNameIntroduced InNotes
0x01ECRECHomesteadsecp256k1 ecrecover
0x02SHA256Homestead
0x03RIPEMD160Homestead
0x04IDHomesteadidentity
0x05MODEXPByzantiumBerlin gas formula applies under Prague
0x06BN254_ADDByzantiumgas-updated since Istanbul
0x07BN254_MULByzantiumgas-updated since Istanbul
0x08BN254_PAIRINGByzantiumgas-updated since Istanbul
0x09BLAKE2FIstanbul
0x0aKZG_POINT_EVALUATIONCancunenabled in current build (c-kzg / blst / arkworks)
0x0bBLS12_G1ADDPragueEIP-2537
0x0cBLS12_G1MSMPragueEIP-2537
0x0dBLS12_G2ADDPragueEIP-2537
0x0eBLS12_G2MSMPragueEIP-2537
0x0fBLS12_PAIRING_CHECKPragueEIP-2537
0x10BLS12_MAP_FP_TO_G1PragueEIP-2537
0x11BLS12_MAP_FP2_TO_G2PragueEIP-2537

Added in OSAKA but disabled by current default

  • 0x0100 (P256VERIFY, RIP-7212)

Implementation Assumptions

  • evm-core uses Context::mainnet().build_mainnet_with_inspector(...) and directly relies on revm mainnet builder.
  • Precompile set is selected via EthPrecompiles::new(spec) on the mainnet builder side.
  • SpecId::default() is PRAGUE.

Observable Facts

  • Execution error taxonomy includes PrecompileError.
  • Wrapper maps it to exec.halt.precompile_error.

Safe Usage

  • For precompile-dependent features, monitor/classify exec.halt.precompile_error separately from retry logic.
  • For precompile-critical dApps, smoke-test the exact path before mainnet rollout.

Pitfalls

  • Mixing ingress validation responsibility with runtime precompile responsibility
  • Assuming 0x0100 (P256VERIFY) is always enabled
  • Ignoring backend differences for 0x0a (KZG) (c-kzg / blst / arkworks)
  • ethereum-differences.md (opcode/tx type/finality differences)

Sources

  • crates/ic-evm-wrapper/src/lib.rs (exec.halt.precompile_error)
  • crates/evm-core/src/revm_exec.rs
  • crates/evm-core/Cargo.toml (revm feature)
  • vendor/revm/crates/handler/src/mainnet_builder.rs
  • vendor/revm/crates/primitives/src/hardfork.rs
  • vendor/revm/crates/precompile/src/lib.rs
  • vendor/revm/crates/precompile/src/id.rs
  • vendor/revm/crates/precompile/src/bls12_381_const.rs
  • vendor/revm/crates/precompile/src/secp256r1.rs