Skip to content

EIP-7951: Precompile for secp256r1 Curve Support - #31991

Merged
fjl merged 9 commits into
ethereum:masterfrom
fjl:secp256r1-v2
Jul 7, 2025
Merged

fjl merged 9 commits into
ethereum:masterfrom
fjl:secp256r1-v2

Conversation

@fjl

@fjl fjl commented Jun 9, 2025 •

Copy link
Copy Markdown
Contributor

Comment thread crypto/secp256r1/verifier.go Outdated
Comment on lines 30 to 32

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check needed? Which part of the EIP does this correspond to?

I believe this check was not added in the RIP version, neither was it present in the implementation deployed in Scroll or OP.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the answer: ethereum-optimism/op-geth#168 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we can get rid of it,

for more context, https://github.com/golang/go/blob/master/src/crypto/elliptic/nistec.go#L129-L134

@jwasinger jwasinger changed the title EIP-7951: Precompile for secp256r1 Curve Support EIP-7212: Precompile for secp256r1 Curve Support Jun 10, 2025
@alexb5dh

Copy link
Copy Markdown

Is this 7212 (which uses r' == r) or 7951 (r' == r [mod n])?

@jwasinger jwasinger changed the title EIP-7212: Precompile for secp256r1 Curve Support EIP-7951: Precompile for secp256r1 Curve Support Jun 10, 2025
@jwasinger

Copy link
Copy Markdown
Contributor

@alexb5dh I changed the title by mistake. Have corrected it now. This reflects EIP-7951

Comment on lines 1 to 9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for preparing for the Fusaka! If you also consider implementing testdata, here is more extended version in a newer PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I have updated the test vectors.

Comment thread params/protocol_params.go Resolved
@fjl

fjl commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

@MariusVanDerWijden PTAL

@MariusVanDerWijden MariusVanDerWijden left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

JonathanOppenheimer added a commit to ava-labs/libevm that referenced this pull request Aug 11, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
JonathanOppenheimer added a commit to ava-labs/libevm that referenced this pull request Aug 12, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
JonathanOppenheimer added a commit to ava-labs/libevm that referenced this pull request Aug 12, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
JonathanOppenheimer added a commit to ava-labs/libevm that referenced this pull request Aug 12, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
JonathanOppenheimer pushed a commit to ava-labs/libevm that referenced this pull request Aug 13, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
JonathanOppenheimer pushed a commit to ava-labs/libevm that referenced this pull request Aug 13, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 2025
ethereum/EIPs#9833

Based on ethereum#27540, ethereum#30043

---------

Co-authored-by: Ulaş Erdoğan <uerdogan2001@hotmail.com>
ARR4N added a commit to ava-labs/libevm that referenced this pull request Oct 18, 2025
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 28, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 28, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Sep 28, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 1, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 1, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 1, 2026
…thereum#31991, close XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Fixes XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 2, 2026
…thereum#31991, part of XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Part of XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 3, 2026
…thereum#31991, part of XinFinOrg#2690

The Osaka precompile set stopped at 0x09, so secp256r1 signature verification
was not available: contracts relying on WebAuthn or passkey style verification
cannot be deployed once Osaka gets scheduled.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Part of XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 3, 2026
…thereum#31991, part of XinFinOrg#2690

The Osaka precompile set had no secp256r1 verifier, so contracts relying on
WebAuthn or passkey style verification could not be deployed once Osaka gets
scheduled. EIP-7951 places it at 0x100.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Part of XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 3, 2026
…thereum#31991, part of XinFinOrg#2690

The Osaka precompile set had no secp256r1 verifier, so contracts relying on
WebAuthn or passkey style verification could not be deployed once Osaka gets
scheduled. EIP-7951 places it at 0x100.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

Part of XinFinOrg#2690
gzliudan added a commit to gzliudan/XDPoSChain that referenced this pull request Oct 3, 2026
…thereum#31991, part of XinFinOrg#2690

The Osaka precompile set had no secp256r1 verifier, so contracts relying on
WebAuthn or passkey style verification could not be deployed once Osaka gets
scheduled. EIP-7951 places it at 0x100.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

The p256Verify block itself - its doc comments, the package-level input length
constant and Name - is kept verbatim from upstream master, which normalized it
in 98a0080 (ethereum#35473); the precompile caching that same commit introduced is
the part left out above.

Part of XinFinOrg#2690
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Oct 3, 2026
…thereum#31991, part of #2690 (#2694)

The Osaka precompile set had no secp256r1 verifier, so contracts relying on
WebAuthn or passkey style verification could not be deployed once Osaka gets
scheduled. EIP-7951 places it at 0x100.

Ported from geth b3131f0 (ethereum#31991). The verifier only uses crypto/ecdsa and
crypto/elliptic, so no dependency is added. The precompile is registered at
0x100 in PrecompiledContractsOsaka and the 782 official test vectors are
included. geth's Cacheable and NormalizeInput methods and the exported
PrecompiledContractsP256Verify set are left out: this fork's
PrecompiledContract interface has no caller for them.

The p256Verify block itself - its doc comments, the package-level input length
constant and Name - is kept verbatim from upstream master, which normalized it
in 98a0080 (ethereum#35473); the precompile caching that same commit introduced is
the part left out above.

Part of #2690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants