Skip to main content

Standard EVM Precompiles

OXN implements the standard Ethereum precompile set at addresses 0x01 through 0x09. 0x0a (KZG point evaluation, introduced with EIP-4844) is not supported — OXN does not have blob transactions.

Support matrix

AddressNamePurposeOXNGas baseGas per word
0x01ecrecoverRecover Ethereum signer from signature3000
0x02sha256SHA-256 hash6012
0x03ripemd160RIPEMD-160 hash600120
0x04identityCopy input to output153
0x05modexpModular exponentiation (EIP-198)Complex
0x06ecAddElliptic curve addition on bn128 (alt_bn128)150
0x07ecMulElliptic curve scalar multiplication on bn1286000
0x08ecPairingPairing check on bn1284500034000/pair
0x09blake2fBLAKE2b F compression functionComplex
0x0apointEvaluationKZG point evaluation (EIP-4844)

Gas costs are per the current EVM specification.

Usage examples

ecrecover

Recover the Ethereum address from a signed hash:

function recoverSigner(bytes32 hash, uint8 v, bytes32 r, bytes32 s)
external pure returns (address)
{
return ecrecover(hash, v, r, s);
}

Used for meta-transactions, EIP-712 typed signatures, and off-chain signature verification.

sha256 / ripemd160

Cryptographic hashes:

bytes memory input = "hello";
bytes32 shaResult = sha256(input);
bytes20 ripemdResult = ripemd160(input);

keccak256 (address 0x00, not a precompile) is the standard Ethereum hash — use it unless you specifically need SHA-256 or RIPEMD-160 for compatibility with an external system.

modexp

Modular exponentiation for large numbers — used in RSA verification and other cryptographic protocols:

function modexp(bytes memory base, bytes memory exp, bytes memory mod)
internal view returns (bytes memory)
{
(bool success, bytes memory result) = address(0x05).staticcall(
abi.encodePacked(base.length, exp.length, mod.length, base, exp, mod)
);
require(success);
return result;
}

bn128 curve operations

Used for zkSNARK verification (Groth16, Plonk) and other pairing-based cryptography:

// ecAdd: (x1, y1) + (x2, y2) on bn128
function ecAdd(uint256 x1, uint256 y1, uint256 x2, uint256 y2)
internal view returns (uint256, uint256)
{
(bool success, bytes memory result) = address(0x06).staticcall(
abi.encode(x1, y1, x2, y2)
);
require(success);
return abi.decode(result, (uint256, uint256));
}

What's not supported and why

0x0a (pointEvaluation) — introduced by EIP-4844 for blob transaction verification. OXN does not have blob transactions, so this precompile has no purpose here.

If your contract needs to verify KZG commitments for reasons unrelated to blobs, you'll need to implement the verification in Solidity (expensive) or wait for a runtime upgrade to add this precompile.

Next steps