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
| Address | Name | Purpose | OXN | Gas base | Gas per word |
|---|---|---|---|---|---|
0x01 | ecrecover | Recover Ethereum signer from signature | ✅ | 3000 | — |
0x02 | sha256 | SHA-256 hash | ✅ | 60 | 12 |
0x03 | ripemd160 | RIPEMD-160 hash | ✅ | 600 | 120 |
0x04 | identity | Copy input to output | ✅ | 15 | 3 |
0x05 | modexp | Modular exponentiation (EIP-198) | ✅ | Complex | — |
0x06 | ecAdd | Elliptic curve addition on bn128 (alt_bn128) | ✅ | 150 | — |
0x07 | ecMul | Elliptic curve scalar multiplication on bn128 | ✅ | 6000 | — |
0x08 | ecPairing | Pairing check on bn128 | ✅ | 45000 | 34000/pair |
0x09 | blake2f | BLAKE2b F compression function | ✅ | Complex | — |
0x0a | pointEvaluation | KZG 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
- Precompiles Overview — OXN-specific precompiles
- EVM Compatibility — opcode support matrix