Skip to content

Support secp256r1 #3

Open
Open

Description

@wjmelements

A registry user wanting to support multiple curves would need to check both, or have a flag identifying which.

Without FIL having the precompile, would need to support it via a library like https://gist.github.com/Vectorized/599b0d8a94d21bc74700eb1354e2f55c

There are some differences between these libraries and ecrecover

  1. ecrecover returns an address (pk-hash)
  2. these libraries and also 7212 and eip-7951 require you to pass the public key to the signature verification

So this will be a more complicated flow than secp256k1 unless we can find a library that recovers the public key.

Activity

  1. moved this to 📌 Triage in FOCon Oct 7, 2025
  2. moved this from 📌 Triage to 🐱 Todo in FOCon Oct 7, 2025
  3. BigLep commented on Dec 3, 2025

    @BigLep
    Contributor

    I'm not knowledgeable about this area usecase. What type of user is going to be impacted, and what "thing" will the be trying to do and why that is impacted? I'm asking so we can gage priority.

  4. rvagg commented on Dec 4, 2025

    @rvagg

    Background here: we use secp256k1 everywhere, including in the registry, because that's the native Ethereum curve. But, unfortunately, WebAuthn, that lets you generate and securely store and use private keys in a browser environment, don't support k1, so we can't have nice, safe session keys generated by a browser. Instead, we have to do it purely in software, without the use of a secure enclave to house the private key. The session key private material is exposed to JavaScript and potentially browser extensions/malware, whereas secure enclave storage keeps the key material isolated from the application layer.

    On the flip side, our EVM doesn't support efficient secp256r1 operations, so we can't make use of WebAuthn as it is unless we do one of two things:

    • Leverage an existing library and do it all in Solidity, which is not super efficient, but possible
    • Add a precompile to FEVM to make it efficient, this would require a FIP, but has been requested and wouldn't be too hard to do, it's just more work

    And, the other important point here is that the API is more complex since we can't just use ecrecover on an address, you have to pass in an additional public key unless we get a library or a precompile that gives us an ecrecover we can use. The problem is that if we have to also pass the public key then that hits everything because extraData needs to be extended from the SDK through to FWSS, which is a bit too annoying.

    This might be nice to have for GA if we could get over the ecrecover hurdle, but also it seems like it might have to be a stretch goal, and more than likely it'll end up being a v2 thing.

  5. BigLep commented on Dec 4, 2025

    @BigLep
    Contributor

    Great explanation - thank you! Unless we have already heard clear customer demand for this, I think we'll need to punt to post GA given we already have a lot to do for GA. (I realize that comes with having to swallow doing the extra work later of a filecoin-pay contract migration...). As a result, I'm leaving this with the MX milestone.

  6. rvagg commented on Dec 8, 2025

    @rvagg

    This is the EIP we want to track for this to get a precompile into Filecoin: EIP-7951

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    • Status
      🐱 Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions