-
Notifications
You must be signed in to change notification settings - Fork 183
FIP: secp256r1 (P-256) P256VERIFY precompile #1228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
@snissn uncontroversial IMO so let's assign FIP number 0113 to this one - update filename, frontmatter and README. |
lanzafame
left a comment
There was a problem hiding this 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
| ## 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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. | |
| For Filecoin’s purposes, **EIP-7951 and [RIP-7212](https://github.com/ethereum/RIPs/blob/master/RIPS/rip-7212.md) 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. |
We seem to be missing a pointer to RIP-7212, despite many subsequent references and overall relevance.
Abstract
This FIP proposes adding a
P256VERIFYprecompile at Ethereum address0x0000000000000000000000000000000000000100(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, returning0x…01on 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
P256VERIFYprecompile at0x0100. 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 comparisonr' ≡ 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