EVM precompile
A precompile is a built-in function that lives at a fixed contract address but is not written in EVM bytecode at all — it is implemented directly in the client software (Geth, Nethermind, etc.) in fast native code. To a contract it looks like an ordinary address you CALL with some input and get output back; under the hood the client recognizes the special address and runs hand-optimized native code instead of interpreting opcodes. They exist for operations that would be ruinously expensive if executed instruction by instruction in the EVM.
The canonical precompiles sit at low addresses. Address 0x01 is ecrecover, which recovers the signer's address from an ECDSA signature — the backbone of signature verification on Ethereum. 0x02 and 0x03 are SHA-256 and RIPEMD-160 (useful for Bitcoin interoperability). 0x04 is the identity function (a cheap memory copy). 0x05 is modular exponentiation (modexp), used in RSA and other number-theoretic checks. Addresses 0x06, 0x07, and 0x08 provide elliptic-curve addition, scalar multiplication, and pairing checks on the alt-bn128 (BN254) curve — the cryptographic engine that lets the EVM verify zk-SNARK proofs cheaply enough to run on-chain. 0x09 is the Blake2 compression function, and 0x0A is the KZG point-evaluation precompile added by EIP-4844 for verifying blob commitments.
Precompiles are priced with their own bespoke gas formulas reflecting the real native cost, often depending on input size (modexp and the pairing check, for instance, charge more for larger inputs or more pairings). This pricing matters enormously: the affordability of the bn128 pairing precompile is precisely what made on-chain SNARK verification — and thus ZK rollups — economically viable.
Because adding or repricing a precompile changes consensus, it can only be done through a hard fork, and every client must implement it bit-for-bit identically. The set has grown over the years exactly as new cryptography became important to the ecosystem, with proposals continually debated to add curves like BLS12-381 (now landing via EIP-2537) for BLS signatures and more efficient proof systems.
A precompile has no bytecode, so EXTCODESIZE on its address returns zero; libraries that guard 'is this a contract?' by checking code size can mistakenly treat a precompile as a plain account.