Skip to content

FIP: secp256r1 (P-256) P256VERIFY precompile#1228

Open
snissn wants to merge 9 commits intofilecoin-project:masterfrom
snissn:secp256r1_precompile
Open

FIP: secp256r1 (P-256) P256VERIFY precompile#1228
snissn wants to merge 9 commits intofilecoin-project:masterfrom
snissn:secp256r1_precompile

Conversation

@snissn
Copy link
Contributor

@snissn snissn commented Jan 21, 2026

Abstract

This FIP proposes adding a P256VERIFY precompile at Ethereum address 0x0000000000000000000000000000000000000100 (i.e., 0x0100) to the FEVM. The precompile verifies an ECDSA signature (r,s) against a 32-byte message hash and an uncompressed public key (x,y) on the secp256r1 curve, returning 0x…01 on success and an empty byte array on failure.

For Filecoin’s purposes, EIP-7951 and RIP-7212 should be understood as addressing the same user-facing feature: a P256VERIFY precompile at 0x0100. At the EVM interface level they are equivalent: same address, same 160-byte input format, and same return values/failure behavior. The key difference is that EIP-7951 tightens validation/verification requirements (notably: a point-at-infinity check and a modular comparison r' ≡ r (mod n)), while Ethereum’s fixed EVM gas schedule for this precompile is not directly applicable to FEVM’s gas accounting model.

Accordingly, this FIP targets EIP-7951 semantics while remaining interface-compatible with RIP-7212-style callers.

Discussion

#1227

Reference Implementation

filecoin-project/builtin-actors#1708

@rvagg
Copy link
Member

rvagg commented Jan 21, 2026

@snissn uncontroversial IMO so let's assign FIP number 0113 to this one - update filename, frontmatter and README.

Copy link
Contributor

@lanzafame lanzafame left a comment

Choose a reason for hiding this comment

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

Approval assumes changes put forward by rvagg

snissn and others added 2 commits February 25, 2026 16:37
@snissn
Copy link
Contributor Author

snissn commented Feb 26, 2026

@snissn uncontroversial IMO so let's assign FIP number 0113 to this one - update filename, frontmatter and README.

4a80485

@snissn
Copy link
Contributor Author

snissn commented Feb 26, 2026

@rvagg I addressed your open comments, I'm looking forward to our next steps!

From the latest round of comments here are the open TODOs:

  • builtin-actors#1721 (OPEN): vendor EIP-7951 test-vectors.json into builtin-actors and wire P256VERIFY tests to consume
    it (referencing builtin-actors#1708).
  • FIPS/fip-0113.md ## TODO (still open work items):
    • Decide target network upgrade / actor bundle version for activation.
    • Benchmark gas for representative P256VERIFY calls under FEVM’s Wasm-instrumented gas accounting.
    • Validate EIP-7951 vectors against a deployed 0x0100 precompile once available in a target network.
    • Check whether 0x0100 has been occupied on relevant networks prior to reserving it, and document findings.
  • FIPS/fip-0113.md ## Implementation:
    • Lotus (integration test): TODO (still a placeholder to replace with a link/issue/PR).

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.

4 participants