EIP-8030 P256 algorithm support

No call decision · Account abstraction · EIP status Draft · created 2025-09-20

Registers the P256 (secp256r1) algorithm as type 0x01 in the EIP-7932 framework, which allows transactions to use multiple signature algorithms.

Why it is needed

Ethereum transactions have so far been signed using a single signature algorithm, secp256k1. EIP-7932 is a proposal to create a framework that allows transactions to use other signature algorithms as well, but confirming that this framework actually works properly requires a concrete algorithm registered within it. P256 (secp256r1) is an algorithm standardized by the US National Institute of Standards and Technology (NIST) and widely used around the world, and thanks to the EIP-7951 precompile, every execution client already has an implementation of it. Since the existing, verified implementation already in the codebase can be reused as is, it is well suited for writing test cases against EIP-7932 implementations using an algorithm whose security is well understood. This EIP defines that P256 as algorithm type 0x01.

What changes

Today

After EIP-8030

Who is affected

In depth

Algorithm type and signature size

As the EIP-7932 algorithm type, ALG_TYPE is defined as Bytes1(0x01) and SIZE as 129. The signature consists of the 1-byte algorithm type followed by r (32 bytes), s (32 bytes), public key x (32 bytes), and y (32 bytes). The merge_detached_signature function simply concatenates the detached signature (r, s) and the public key (x, y) to form the complete signature. The validate function is a no-op that does nothing, since EIP-7951 exposes no separate validation function.

Gas cost calculation

BASE_GAS is 3900. This is the EIP-7951 precompile cost minus the 3000 gas cost of the secp256k1 precompile. If the signing data is exactly 32 bytes, only 3900 gas is charged. For any other length, the keccak256 hashing cost is added, charging 3900 + 30 + (6 x minimum_word_size). minimum_word_size is calculated as (data length + 31) // 32.

The verification procedure of the verify function

If the signing data is not 32 bytes, it is first hashed with keccak256. From the signature, excluding the first algorithm type byte, r, s, x, and y are read as 32 bytes each. It checks s <= N/2, a device similar to the malleability check in EIP-2. N is 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551. Then P256Verify(signing_data, r, s, x, y) must return the 32-byte value 1, and if it passes, the 64-byte public key in the form x || y is returned.

The P256Verify function and gas handling

P256Verify uses the logic of the precompile defined in EIP-7951 as is. The only difference is that this function MUST NOT charge gas. Gas is calculated separately at the transaction stage by the gas_cost function above, so it is not double-charged within the verification logic.

Why P256

P256 (secp256r1) is a NIST standard algorithm used worldwide, and more importantly, every execution client already has an implementation of it. The proposer's rationale is that since an algorithm with well-understood security can be easily implemented, it is well suited as a test algorithm for EIP-7932 implementations.

Current status and remaining discussion

It states that no backward compatibility issues have been found. However, the Security Considerations section is still empty, marked as 'Needs discussion.' Since this EIP is in Draft status, its constants, gas costs, and verification procedure may still change. There is no record to date of a core developer call deciding on fork inclusion.

Original EIP · ← EIPs