---
eip: 8030
label: EIP-8030
title: P256 algorithm support
status: Draft
type: Standards Track
category: Core
created: 2025-09-20
requires: 7932, 7951
official: https://eips.ethereum.org/EIPS/eip-8030
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8030.md
canonical: https://eips.huatuo.xyz/eip-8030/
lang: en
tldr: Registers P256 (secp256r1) as signature algorithm type 0x01 under the EIP-7932 framework, reusing the P256 verification logic every client already ships for the EIP-7951 precompile.
tags: [signatures, p256, secp256r1, cryptography, core]
---

# EIP-8030: P256 algorithm support

> Adds an EIP-7932 algorithm type for P256 support of type `0x01`

**TL;DR:** Registers P256 (secp256r1) as signature algorithm type 0x01 under the EIP-7932 framework, reusing the P256 verification logic every client already ships for the EIP-7951 precompile.

## What problem does it solve?

Ethereum accounts sign with secp256k1. [EIP-7932](/eip-7932/) proposes a framework for **secondary signature algorithms**, each identified by a one-byte type, so transactions and other objects could be signed with something else. A framework needs a first concrete algorithm to define and test against.

P256 (also called secp256r1) is a widely used NIST curve, the one used by passkeys and many secure hardware chips. It is also already implemented in every execution client because of the P256 verification precompile in [EIP-7951](/eip-7951/). That makes it a low-risk first algorithm. EIP-8030 defines exactly how P256 plugs into EIP-7932.

## How it works

The algorithm is registered with:

| Constant | Value |
| --- | --- |
| `ALG_TYPE` | `0x01` |
| `SIZE` | `129` bytes |

A signature is `alg_type (1) || r (32) || s (32) || x (32) || y (32)`: the type byte, the signature, then the uncompressed public key.

The functions EIP-7932 requires:

- **`verify(signature, signing_data)`**: if `signing_data` is not exactly 32 bytes it is first hashed with keccak256. The type byte is dropped, `s` must be at most `N/2` (low-s, to prevent malleability, as secp256k1 does since [EIP-2](/eip-2/)), and the EIP-7951 `P256Verify` logic must succeed. It returns the 64-byte public key `x || y`.
- **`gas_cost(signing_data)`**: a base of 3,900 gas, defined as the EIP-7951 precompile cost minus 3,000 (the cost of the secp256k1 `ecrecover` precompile). Non-32-byte data adds keccak cost: `30 + 6 * words`.
- **`validate`**: a no-op.
- **`merge_detached_signature`**: concatenates `r || s` with `x || y`.

Unlike secp256k1, P256 cannot recover the public key from a signature alone, which is why the key travels inside the 129 bytes.

## Sample code

Building the 129-byte signature in TypeScript with `@noble/curves`:

```ts
import { p256 } from "@noble/curves/p256";
import { keccak_256 } from "@noble/hashes/sha3";
import { concatBytes } from "@noble/hashes/utils";

const priv = p256.utils.randomPrivateKey();
const pubUncompressed = p256.getPublicKey(priv, false); // 0x04 || x || y

const digest = keccak_256(message);                      // 32-byte signing data
const sig = p256.sign(digest, priv, { lowS: true });     // enforce s <= N/2

const encoded = concatBytes(
  new Uint8Array([0x01]),                                // ALG_TYPE
  sig.toCompactRawBytes(),                               // r || s (64 bytes)
  pubUncompressed.slice(1),                              // x || y (64 bytes)
);
console.log(encoded.length); // 129
```

## Things to know

- **Status: Draft**, and it depends on [EIP-7932](/eip-7932/), which is also Draft. Nothing here is usable on mainnet until both are adopted.
- The [EIP-7951](/eip-7951/) precompile, which this reuses, is separate: it lets contracts verify P256 signatures today. EIP-8030 is about P256 as a signature type at the protocol level.
- The spec states its main purpose is to give EIP-7932 a known-safe algorithm for test cases.
- Signatures must use low-s form; many P256 libraries do not normalise `s` by default.
- Security considerations are still marked "Needs discussion".


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8030
