Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article covers EIP8030.

EIP8030 proposes registering P256 signatures as 0x01 in the registry of additional signature algorithms defined by EIP7932. This allows the sigrecover precompile to verify P256 signatures and derive Ethereum addresses from public keys.

Overview

EIP8030 does not define a new transaction type or a new P256 verification precompile. Its role is to specify how P256 is handled in the EIP7932 signature algorithm registry.

The following diagram shows the overall architecture. The original diagrams in this article retain their Japanese labels.

Overview of EIP8030

EIP7932 provides a common framework for handling multiple signature algorithms through a single sigrecover precompile. EIP8030 adds a P256 entry to that framework. Actual P256 signature verification uses the same verification logic as EIP7951's P256VERIFY.

EIP7932: Secondary Signature Algorithms

[EIP7951] How the secp256r1 Precompile Connects Apple Secure Enclave and Passkeys to Ethereum

[EIP7951] How the secp256r1 Precompile Connects Apple Secure Enclave and Passkeys to Ethereum

EIP8030 introduces the following values.

Item Description
Target P256 signatures
Signature algorithm type 0x01
Signature container size 129 bytes
Verification logic EIP7951's P256Verify
Return value 64-byte public key formed by concatenating `x

The 129 bytes consist of a one-byte algorithm type followed by 32 bytes each for r, s, x, and y. Rather than recovering a public key, P256 verification checks the signature against the public key supplied in the signature container.

Motivation

EIP7932 defines a common registry and the sigrecover precompile so that signature algorithms other than secp256k1 can be used to derive Ethereum addresses. However, EIP7932 itself does not specify the details of each algorithm. A separate EIP must define the ALG_TYPE, signature size, gas cost, and verification procedure for each new algorithm.

P256, also known as secp256r1, is a NIST-standardized elliptic curve. It is widely used by Apple Secure Enclave, Android Keystore, and FIDO2 and WebAuthn authenticators. Ethereum execution clients already have P256 verification implementations for EIP7951, making P256 a practical choice for evaluating additional algorithms under EIP7932.

EIP8030 connects P256 to the EIP7932 processing model. It accepts a P256 signature, hashes the signing data if necessary, checks that the s value is low, and returns the public key after verification equivalent to EIP7951. That public key is then passed to EIP7932's address derivation procedure.

Specification

The EIP8030 specification covers algorithm constants, gas costs, signature verification, merging detached signatures, and the behavior of the P256Verify function. The EIP7932 sigrecover precompile selects the algorithm from the first byte of its input and invokes the registered verification procedure.

Algorithm Constants

The constants for the P256 algorithm are as follows.

Constant Value Role
ALG_TYPE Bytes1(0x01) One-byte identifier for P256 in the EIP7932 registry.
SIZE 129 Total size of the signature container, including the algorithm type.
N 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551 Order of the P256 subgroup.

The signature container is laid out in the following order.

Offset Size Contents
0 1 byte ALG_TYPE. For P256, this is 0x01.
1..32 32 bytes Signature component r.
33..64 32 bytes Signature component s.
65..96 32 bytes Public key x-coordinate.
97..128 32 bytes Public key y-coordinate.

A P256 public key cannot be recovered from r and s alone. The EIP8030 signature container therefore also includes the public key coordinates.

Gas Cost

The additional gas cost for P256 starts at 3900 gas: the 6900 gas charged by the EIP7951 P256 verification precompile minus the 3000 base gas charged by EIP7932. If the signing data is not 32 bytes long, the cost of hashing it with keccak256 is added.

The gas calculation is as follows.

python
def gas_cost(signing_data: Bytes) -> Uint64:
    BASE_GAS = Uint64(3900)

    if len(signing_data) == 32:
        return BASE_GAS
    else:
        minimum_word_size = (len(signing_data) + 31) // 32
        return BASE_GAS + Uint64(30 + (6 * minimum_word_size))

If the signing data is 32 bytes long, it is treated as an already hashed value. Otherwise, keccak256 converts it to a 32-byte hash, and the corresponding additional gas is calculated.

Pre-validation

EIP7932 algorithms call validate before verify. For P256, validate performs no additional checks.

python
def validate(signature: Bytes) -> None | Error:
    pass

Checks on the P256 signature components, public key coordinates, and whether the point lies on the curve are delegated to P256Verify, which is called within verify. The EIP8030 validate function therefore does not parse the signature container in advance.

Verification

The relationship between the contents of the signature container and the verification procedure is shown below.

EIP8030 signature container

The diagram shows that the signature container received by EIP7932 includes the algorithm identifier, signature values, and public key. P256 verifies the signature against the supplied public key instead of recovering the public key from the signature alone.

The P256 verification flow is as follows.

P256 signature verification flow

The procedure parses the signature container, hashes the signing data, checks that the s value is low, verifies the P256 signature, and returns the public key. Rather than recovering a public key, EIP8030 verifies that the supplied x and y correspond to the signature over the signing data.

The verification procedure is as follows.

python
def verify(signature: Bytes, signing_data: Bytes) -> Bytes | Error:
    if len(signing_data) != 32:
        signing_data = keccak256(signing_data)

    signature = signature[1:]

    (r, s, x, y) = (
        signature[0:32],
        signature[32:64],
        signature[64:96],
        signature[96:128],
    )

    assert(s <= N / 2)
    assert(P256Verify(signing_data, r, s, x, y) == Bytes(
        "0x0000000000000000000000000000000000000000000000000000000000000001"
    ))

    return x || y

First, the function checks whether signing_data is 32 bytes long. Values of other lengths are hashed with keccak256 before signature verification. The function then removes the first byte of the signature container and splits the remaining 128 bytes into r, s, x, and y.

The s <= N / 2 check limits signature malleability. For an ECDSA signature, both s and N - s may be valid, so rejecting high s values restricts the representation to one form. This is similar to the constraint on low s values introduced by EIP2 for secp256k1 signatures.

EIP2: Homestead Hard-fork Changes

Finally, signing_data, r, s, x, and y are passed to the same logic as P256Verify defined in EIP7951. If the verification result is a 32-byte value of 1, the function returns the 64-byte public key formed by concatenating x || y. EIP7932's pubkey_to_address converts that public key into a 20-byte address.

Merging Detached Signatures

EIP7932 also defines a function for combining a signature and a separately supplied public key into the algorithm-specific signature container. For P256 under EIP8030, the detached signature and public key are simply concatenated.

python
def merge_detached_signature(detached_signature: bytes, public_key: bytes) -> bytes:
    return detached_signature + public_key

Here, detached_signature is r || s, and public_key is x || y. The combined result can be used as an EIP7932 signature container.

P256Verify

EIP8030's P256Verify refers to the logic of the P256 verification precompile defined in EIP7951. However, no additional gas is charged when it is called as a function within EIP8030. EIP7932's sigrecover charges gas based on the algorithm-specific gas_cost.

This separation keeps the P256 cryptographic verification logic consistent with EIP7951 while allowing the EIP7932 algorithm registry to treat it as a procedure for obtaining a public key from a P256 signature.

Additional Notes

P256 and secp256k1

Standard Ethereum signatures use the secp256k1 curve. P256, also known as secp256r1, is widely used in authentication mechanisms on smartphones and security keys.

EIP7932 is designed to handle signature algorithms other than secp256k1 through the same sigrecover precompile. EIP8030 registers P256 as the first additional algorithm.

Why the Signature Container Includes the Public Key

With existing secp256k1 signatures, the public key can be recovered from r, s, and y_parity. The signer's public key can therefore be obtained from the signature alone.

For P256, EIP8030 verifies the signature against a specified public key rather than recovering the public key. The signature container therefore includes x and y, and P256Verify checks that the signature over the signing data corresponds to that public key.

Signing Data of Lengths Other Than 32 Bytes

P256 verification itself takes a 32-byte message hash as input. Under EIP8030, if signing_data is not 32 bytes long, the function computes keccak256(signing_data) before verification.

This behavior is consistent with the EIP7932 secp256k1 algorithm. Applications can supply either an existing 32-byte hash or signing data of arbitrary length.

Compatibility

EIP8030 proposes adding a new P256 algorithm to the EIP7932 registry. It does not change the behavior of existing secp256k1 signatures, existing contracts, or the existing ECRECOVER precompile.

Only operations that intend to use P256 signatures construct a signature container with ALG_TYPE = 0x01 and verify it through EIP7932's sigrecover. EIP8030 alone therefore does not replace the signature schemes used by existing applications.

Security

Two important aspects of EIP8030 are P256 signature malleability and the decision to include the public key in the signature container. The s <= N / 2 constraint prevents both a high s value and a low s value from being accepted for the same signature. This reduces ambiguity arising from different byte representations of a signature.

Because the public key coordinates x and y are included in the signature container, verification checks whether the supplied public key corresponds to the signature over the signing data. Only public keys that pass verification are passed to EIP7932's address derivation procedure. Deriving an address without checking the correspondence between the public key and the signature could produce an address from a public key that does not belong to the signer.

EIP8030 uses EIP7951's P256Verify as its P256 verification logic. Input length, the ranges of r and s, the ranges of the public key coordinates, curve membership, and the requirement that the point is not the point at infinity are therefore handled under the same verification requirements as EIP7951.

Citation

James Kempton (@SirSpudlington), "EIP8030: P256 algorithm support [DRAFT]," Ethereum Improvement Proposals, no. 8030, September 2025. Available: https://eips.ethereum.org/EIPS/eip-8030.

Conclusion

This article covered EIP8030.

EIP8030 proposes registering P256 signatures as an EIP7932 signature algorithm. It uses EIP7951's P256Verify logic for actual P256 verification and passes the verified public key to EIP7932's address derivation procedure. Handling P256 through the common sigrecover interface makes it easier to connect signatures from secure hardware and WebAuthn-based systems to Ethereum's address derivation rules.

I also write articles elsewhere, which you can find at the following links.