Precompile Addresses
Every precompile the runtime registers, as listed in template/runtime/src/precompiles.rs. An
address is its index as a 20-byte big-endian number, so index 2050 is
0x0000000000000000000000000000000000000802. Every other address is unregistered.
Registered precompiles
| Address | Index | Name | What it does | Input | Reference |
|---|---|---|---|---|---|
0x…0001 | 1 | ECRecover | Recovers the signer address of a secp256k1 signature | Raw bytes, as on Ethereum | Ethereum precompiles |
0x…0002 | 2 | Sha256 | SHA-256 | Raw bytes | Ethereum precompiles |
0x…0003 | 3 | Ripemd160 | RIPEMD-160 | Raw bytes | Ethereum precompiles |
0x…0004 | 4 | Identity | Returns its input | Raw bytes | Ethereum precompiles |
0x…0005 | 5 | Modexp | Modular exponentiation; operands up to 1,024 bytes, EIP-7883 pricing | Raw bytes, as on Ethereum | Modexp rules |
0x…0400 | 1024 | Sha3FIPS256 | FIPS 202 SHA3-256, not Keccak-256 | Raw bytes; returns 32 bytes | — |
0x…0401 | 1025 | ECRecoverPublicKey | Recovers the 64-byte uncompressed secp256k1 public key | 128 bytes: hash, v, r, s, as for ECRecover | — |
0x…0402 | 1026 | Curve25519Add | Adds up to 10 Ristretto255 points | Raw bytes: 32-byte compressed points, at most 320 bytes | — |
0x…0403 | 1027 | Curve25519ScalarMul | Multiplies a Ristretto255 point by a scalar | Raw bytes: 32-byte little-endian scalar, then a 32-byte compressed point | — |
0x0000000000000000000000000000000000000801 | 2049 | ShieldedPool | shield: deposits ORB into the shielded pool | Solidity ABI | ShieldedPool Precompile |
0x0000000000000000000000000000000000000802 | 2050 | Balances | transfer, transferKeepAlive: pays ORB to any AccountId32 | Solidity ABI | Balances Precompile |
0x…0400 hashes with SHA3-256 as standardised in FIPS 202, which pads differently from the
Keccak-256 behind Solidity's keccak256. The two give different digests for the same input; use
keccak256 for Ethereum hashing.
The Curve25519 precompiles have no function selector and no ABI: the input is the raw bytes above, and both return a 32-byte compressed Ristretto255 point. A malformed point or a wrong input length fails the call.
Unregistered addresses
BN254 (0x06–0x08), BLAKE2F (0x09), KZG (0x0a), BLS12-381 (0x0b–0x11) and P256VERIFY
(0x100) are not registered. A call to them, as to any unregistered address, succeeds and returns
no data. See Unregistered precompile addresses.
Rules for the Orbinum precompiles
| Rule | ShieldedPool 0x…0801 | Balances 0x…0802 |
|---|---|---|
STATICCALL | Refused | Refused |
DELEGATECALL, CALLCODE | Refused | Refused |
msg.value | Required: the shielded amount | Refused |
| Account that pays | The value sent with the call | msg.sender, mapped to its AccountId32 |
| Failure | Reverts with Error(string) | Reverts with Error(string) |
| EVM logs | None; Substrate events instead | None; Substrate events instead |
Because delegated calls are refused, a contract can move only its own balance through Balances, never its caller's. Neither precompile repeats signature verification: the EVM transaction already authenticates the caller.
Every precompile past the Ethereum range (0x0400–0x0403, 0x0801, 0x0802) holds a five-byte
stub, 0x60006000fd (PUSH1 0 PUSH1 0 REVERT). It never runs: the precompile executes instead. It
only gives the address code, so eth_getCode is non-empty and Solidity's high-level calls reach
the precompile. 0x01–0x05 hold no code, as on Ethereum. See
Calling a Precompile.
Related
- Calling a Precompile — the Balances interface and examples
- ShieldedPool Precompile —
shieldABI and origin model - Balances Precompile —
transferABI and encoding - EVM Compatibility — every difference from Ethereum