secp256r1 (P-256) Signature Verification
A signature verification precompile for the NIST P-256 curve (secp256r1). Tracked as EIP-7951 on the EIP track and RIP-7212 on the rollup track. Same curve used by WebAuthn, FIDO2, and most non-Ethereum chains for ECDSA — distinct from secp256k1, which underlies Ethereum's ecrecover.
Address
| Constant | Address |
|---|---|
PRECOMPILE_EIP7951 | 0x0000000000000000000000000000000000000100 |
Calling convention
Input: 160 bytes total, big-endian.
| msgHash (32) | r (32) | s (32) | pubKeyX (32) | pubKeyY (32) |
Output:
- Valid signature: 1 byte
0x01. - Invalid signature, malformed coordinates, or input length other than 160 bytes: empty bytes.
Invalid signatures and malformed coordinates are not errors — the precompile returns success with empty output. The contract is a thin wrapper around revm_precompile::secp256r1::p256_verify.
Gas
Flat cost per call: P256VERIFY_BASE_GAS_FEE = 3,450 gas. Charged unconditionally before verification runs.
Errors
OutOfFuel—revm_precompilereturnedPrecompileError::OutOfGas.PrecompileError— any other underlying precompile error.
Source
fluentbase/contracts/eip7951/. Underlying implementation: revm_precompile::secp256r1.