Skip to content

Commit

Permalink
Update EIP-7212: Move to Review
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
ulerdogan committed Jul 11, 2023
1 parent 4ca0d66 commit 0e6a9c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions EIPS/eip-7212.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: Precompiled for secp256r1 Curve Support
description: Proposal to add precompiled contract that allows signature verifications in the “secp256r1” elliptic curve.
author: Ulaş Erdoğan (@ulerdogan), Doğan Alpaslan (@doganalpaslan)
discussions-to: https://ethereum-magicians.org/t/eip-7212-precompiled-for-secp256r1-curve-support/14789
status: Draft
status: Review
type: Standards Track
category: Core
created: 2023-06-22
---

## Abstract

The proposal aims creating precompiled contract that allows signature verifications in the “secp256r1” elliptic curve by given parameters of message hash, `r` - `s` components of the signature, and `x` - `y` coordinates of the public key. So that, any EVM chain -principally Ethereum rollups- will be able to integrate this precompiled contract easily.
This proposal creates a precompiled contract that allows signature verifications in the “secp256r1” elliptic curve by given parameters of message hash, `r` - `s` components of the signature, and `x` - `y` coordinates of the public key. So that, any EVM chain -principally Ethereum rollups- will be able to integrate this precompiled contract easily.

## Motivation

Expand All @@ -28,7 +28,7 @@ Modern devices have these signing mechanisms that are designed to be more secure

## Specification

As of `FORK_TIMESTAMP` in the integrated EVM chain, add precompiled contract `P256VERIFY` for signature verifications in the “secp256r1” elliptic curve at address `PRECOMPILED_ADDRESS`.
As of `FORK_TIMESTAMP` in the integrated EVM chain, add precompiled contract `P256VERIFY` for signature verifications in the “secp256r1” elliptic curve at address `PRECOMPILED_ADDRESS` in `0x19`.

### Elliptic Curve Information

Expand Down Expand Up @@ -112,6 +112,8 @@ The "secp256r1" elliptic curve signatures consists of `v`, `r`, `s` components.

The signature values in `r` - `s` and the public key coordinates in the `x`- `y` provides direct computations in signing and verification part, so these formats are chose in the input data format which are 32 bytes.

The `PRECOMPILED_ADDRESS` is chosed in `0x19` as it is the next available address in the precompiled address set.

The gas cost has proposed by comparing the performances of the `P256VERIFY` and the `ECRECOVER` which is implemented in the EVM at `0x01` address. It is seen that “secp256r1” signature verification by `P256VERIFY` is ~15% slower (elaborated in the [test cases](#test-cases) part) than “secp256k1” signature recovery by `ECRECOVER`, so `3450` gas is proposed by comparison which causes similar “mgas/op” values in both precompiles.

## Backwards Compatibility
Expand Down

0 comments on commit 0e6a9c9

Please sign in to comment.