Merged
Conversation
Implement a native p256Verify precompile for secp256r1 signature verification and wire it into the Berlin precompile set and test harness. Added core/vm/contracts.go implementation (160-byte input, returns 32-byte true on success), updated precompile maps and evm tests to include the new address, and registered the gas cost via params.P256VerifyGas (params updated). Included comprehensive test vectors and benchmarks in core/vm/testdata/precompiles/p256Verify.json and test entries in core/vm/contracts_test.go and core/vm/evm_test.go. Added crypto/secp256r1/verifier.go and verifier_test.go providing the verification logic and unit tests.
purplesmoke05
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #135
This pull request adds support for secp256r1 (P-256) signature verification as a new Ethereum precompiled contract, making it available at address
0x0100for the "Berlin" fork.New P-256 Signature Verification Precompile:
p256Verifyfor secp256r1 (P-256) signature verification, accessible at address0x0100in the Berlin precompile set (core/vm/contracts.go). [1] [2]crypto/secp256r1, including public key validation and signature checking (crypto/secp256r1/verifier.go).params/protocol_params.go(P256VerifyGas).Testing and Integration:
core/vm/contracts_test.go,crypto/secp256r1/verifier_test.go). [1] [2] [3]core/vm/evm_test.go).