Skip to main content

Standard EVM Precompiles

Fluent ships every standard Ethereum precompile at addresses 0x01 through 0x11. Each is implemented as a system contract that wraps the corresponding revm_precompile function — semantics are byte-for-byte identical to mainnet Ethereum, with one minor implementation note in BN254.

AddressDescription
0x0000000000000000000000000000000000000001ecrecover — secp256k1 signature recovery (Frontier)
0x0000000000000000000000000000000000000002SHA-256 hash (Frontier)
0x0000000000000000000000000000000000000003RIPEMD-160 hash (Frontier)
0x0000000000000000000000000000000000000004Identity / data copy (Frontier)
0x0000000000000000000000000000000000000005Modular exponentiation — EIP-198 (Berlin gas schedule)
0x0000000000000000000000000000000000000006BN254 G1 addition — EIP-196
0x0000000000000000000000000000000000000007BN254 G1 scalar multiplication — EIP-196
0x0000000000000000000000000000000000000008BN254 pairing check — EIP-197
0x0000000000000000000000000000000000000009BLAKE2 F compression — EIP-152
0x000000000000000000000000000000000000000aKZG point evaluation — EIP-4844
0x000000000000000000000000000000000000000bBLS12-381 G1 addition — EIP-2537
0x000000000000000000000000000000000000000cBLS12-381 G1 multi-scalar multiplication — EIP-2537
0x000000000000000000000000000000000000000dBLS12-381 G2 addition — EIP-2537
0x000000000000000000000000000000000000000eBLS12-381 G2 multi-scalar multiplication — EIP-2537
0x000000000000000000000000000000000000000fBLS12-381 pairing — EIP-2537
0x0000000000000000000000000000000000000010BLS12-381 map FP → G1 — EIP-2537
0x0000000000000000000000000000000000000011BLS12-381 map FP² → G2 — EIP-2537

Implementations live under fluentbase/contracts/<name>/, where <name> matches the precompile: ecrecover, sha256, ripemd160, identity, modexp, bn256, blake2f, kzg, bls12381. Address constants are defined in fluentbase/crates/types/src/genesis.rs as PRECOMPILE_<NAME> via Address::with_last_byte(0xNN).

Notes on implementation

  • BN254 (BN256) endianness: the implementation converts between Ethereum's big-endian inputs and SP1's little-endian internal representation at the boundary (bn256/src/lib.rspoint_be_to_le / point_le_to_be). The external interface remains EIP-196/197 compliant; the conversion is invisible to callers.
  • One contract crate, several addresses: the BN254 family shares one bn256 contract crate dispatched by caller address; the BLS12-381 family shares one bls12381 crate the same way. The genesis build installs the same compiled rWasm at every address in each family.

Source

Implementations delegate to revm_precompile for the underlying math, so any divergence from mainnet semantics would be visible in the wrapper code.