Precompiles
All Ethereum precompiles as of the Pectra fork (0x01
to 0x11
), plus precompile 0x0100
(RIP-7212;
signature verification of secp256r1
aka P256), are supported.
Some external references are helpful:
- For
0x01
to0x0a
, see evm.codes - For
0x0b
to0x11
(BLS12-381 utilities), see EIP-2537 - For
0x0100
(secp256r1/P256 signature verification), see RIP-7212
Address | Name | Gas | Notes |
---|---|---|---|
0x01 | ecRecover | 6000 | ECDSA public key recovery function |
0x02 | sha256 | 60 + 12 * word_size | hash function |
0x03 | ripemd160 | 600 + 120 * word_size | hash function |
0x04 | identity | 15 + 3 * word_size | returns the input |
0x05 | modexp | see gas detail | arbitrary-precision exponentiation under modular arithmetic |
0x06 | ecAdd | 300 | point addition (ADD) on the elliptic curve alt_bn128 |
0x07 | ecMul | 30,000 | scalar multiplication (MUL) on the elliptic curve alt_bn128 |
0x08 | ecPairing | 225,000 | bilinear function on groups on the elliptic curve alt_bn128 |
0x09 | blake2f | rounds * 2 | compression function F used in the BLAKE2 cryptographic hashing algorithm |
0x0a | point_eval | 200,000 | verify KZG commitments (see description in EIP-4844) |
0x0b | bls12_g1_add | 375 | point addition in G1 (curve over base prime field). See EIP-2537 |
0x0c | bls12_g1_msm | see EIP-2537 | multi-scalar-multiplication (MSM) in G1 |
0x0d | bls12_g2_add | 600 | point addition in G2 (curve over quadratic extension of the base prime field) |
0x0e | bls12_g2_msm | see EIP-2537 | MSM in G2 |
0x0f | bls12_pairing_check | see EIP-2537 | pairing operation between a set of pairs of (G1, G2) points |
0x10 | bls12_map_fp_to_g1 | 5500 | maps base field element into the G1 point |
0x11 | bls12_map_fp2_to_g2 | 23800 | maps extension field element into the G2 point |
0x0100 | p256_verify | 6900 | signature verification of the secp256r1 (aka P256) elliptic curve. See RIP-7212 |
Note that a few precompiles (namely 0x01
, 0x06
, 0x07
, 0x08
, 0x09
, and 0x0a
) have been
repriced relative to Ethereum, as discussed here.
See also the source code.